@SpringBootApplication
@MapperScan(basePackages = {"com.iwhalecloud.yn.portal.mapper"})
@EnableEncrypt
public class YnPortalServerApplication {
// @Resource
// private MyRsaEncryptAlgorithm myRsaEncryptAlgorithm;
public static void main(String[] args) {
SpringApplication.run(YnPortalServerApplication.class, args);
}
}
TestController
@RestController
@RequestMapping("/test")
public class TestController {
@RequestMapping("/hello")
public Result hello() {
return Result.buildFail("-440033", "服务器正常返回,但是返回的结果告知服务器或业务不对");
}
@Encrypt
@PostMapping(path = "/encryptTransmission" ,consumes="application/json")
public Result encryptTransmission(@RequestBody MyUserDetails myUserDetails) {
return Result.buildSuccess(myUserDetails);
}
}
postman请求响应正常,umi-request请求不正常
前端代码
后端代码 pom.xml
springboot主启动类
TestController
测试结果 postman
前端项目