跨域报错、zt:url使用

This commit is contained in:
username 2024-09-18 10:53:02 +08:00
parent 0b13fc0432
commit b038b7e0c2
3 changed files with 8 additions and 4 deletions

View File

@ -36,4 +36,4 @@ cbs8:
OA: OA:
data_source_code: yc_oa data_source_code: yc_oa
zt: zt:
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -29,6 +29,7 @@ import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -67,6 +68,9 @@ public class SysSendMessageLogServiceImpl extends BaseService<SysSendMessageLogE
@Resource @Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao; private ISysApplicationApiParaDao sysApplicationApiParaDao;
@Value("${zt.url}")
private String url ;
private ISysSendMessageLogDao sysSendMessageLogDao; private ISysSendMessageLogDao sysSendMessageLogDao;
@Autowired @Autowired
@ -291,7 +295,7 @@ public class SysSendMessageLogServiceImpl extends BaseService<SysSendMessageLogE
logger.error("未找到该应用类型"); logger.error("未找到该应用类型");
break; break;
} }
String result = HttpRequest.post("http://ufidahz.com.cn:9067/kangarooDataCenterV3/entranceController/externalCallInterface"). String result = HttpRequest.post(url).
header("appId", warningAppCode.toString()). header("appId", warningAppCode.toString()).
header("apiCode", warningApiCode.toString()). header("apiCode", warningApiCode.toString()).
header("publicKey", "ZJYA7v6DubGMm8EdBPGo+Jj9wCpUeCGJEpfBRLiInq4dvDlCe7eDIk+3zDUT+v578prj"). header("publicKey", "ZJYA7v6DubGMm8EdBPGo+Jj9wCpUeCGJEpfBRLiInq4dvDlCe7eDIk+3zDUT+v578prj").

View File

@ -10,10 +10,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
* @content * @content
* @date 2024-09-14 17:10 * @date 2024-09-14 17:10
*/ */
@Configuration //@Configuration
public class CorsConfig implements WebMvcConfigurer { public class CorsConfig implements WebMvcConfigurer {
@Override // @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") registry.addMapping("/**")
.allowedOrigins("*") .allowedOrigins("*")