feat: There is no way the, checkPageNoEncryption
This commit is contained in:
@@ -104,6 +104,32 @@ public class LoginRestController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "登录")
|
||||||
|
// @GetMapping(value = "/login")
|
||||||
|
@GetMapping(value = "/checkPageNoEncryption")
|
||||||
|
@ResponseBody
|
||||||
|
public ResponseMessage<String> checkPageNoEncryption(@RequestParam @NotNull(message = "请输入用户名") String username) throws UnsupportedEncodingException {
|
||||||
|
UserEO userEO = userService.getUserByLoginNameNotDeleted(username);
|
||||||
|
if (null == userEO) {
|
||||||
|
log.info("用户[{}]身份验证失败", username);
|
||||||
|
return Result.error("r0011", "您输入的帐号不存在");
|
||||||
|
}
|
||||||
|
if(userEO.getDisableFlag()==1){
|
||||||
|
log.info("用户[{}]身份验证失败", username);
|
||||||
|
return Result.error("r0011", "您输入的帐号已禁用");
|
||||||
|
}
|
||||||
|
|
||||||
|
String token = jwtUtils.generateToken(userEO.getUsid());
|
||||||
|
// 加密重要信息
|
||||||
|
BASE64Encoder encoder = new BASE64Encoder();
|
||||||
|
userEO.setToken(token);
|
||||||
|
String userStr = JSON.toJSONString(userEO);
|
||||||
|
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||||
|
userStr = encoder.encode(userStr2.getBytes());
|
||||||
|
return Result.success(userStr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "登录")
|
@ApiOperation(value = "登录")
|
||||||
@PostMapping(value = "/loginIdm")
|
@PostMapping(value = "/loginIdm")
|
||||||
|
|||||||
@@ -25,7 +25,12 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
InterceptorRegistration addInterceptor = registry.addInterceptor(getSecurityInterceptor());
|
InterceptorRegistration addInterceptor = registry.addInterceptor(getSecurityInterceptor());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录三大金刚
|
||||||
|
*/
|
||||||
addInterceptor.excludePathPatterns("/api/loginIdm");
|
addInterceptor.excludePathPatterns("/api/loginIdm");
|
||||||
|
addInterceptor.excludePathPatterns("/api/checkPage");
|
||||||
|
addInterceptor.excludePathPatterns("/api/checkPageNoEncryption");
|
||||||
/**
|
/**
|
||||||
* TODO 测试流程 开放 login 接口 正式环境 关闭
|
* TODO 测试流程 开放 login 接口 正式环境 关闭
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user