浏览代码

代码优化

wangliang 2 年之前
父节点
当前提交
5b3f1e717c

+ 5 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/OpenApiController.java

@@ -152,9 +152,11 @@ public class OpenApiController {
         if (Objects.isNull(signature) || Objects.equals(signature, "")) {
         if (Objects.isNull(signature) || Objects.equals(signature, "")) {
             throw ExceptionResultEnum.PARAMS_ERROR.exception("鉴权信息不能为空");
             throw ExceptionResultEnum.PARAMS_ERROR.exception("鉴权信息不能为空");
         }
         }
+        signature = URLDecoder.decode(signature, SystemConstant.CHARSET_NAME);
         if (Objects.isNull(account) || Objects.equals(account, "")) {
         if (Objects.isNull(account) || Objects.equals(account, "")) {
             throw ExceptionResultEnum.PARAMS_ERROR.exception("工号不能为空");
             throw ExceptionResultEnum.PARAMS_ERROR.exception("工号不能为空");
         }
         }
+        account = URLDecoder.decode(account, SystemConstant.CHARSET_NAME);
 
 
         BasicSchool basicSchool = AuthThirdUtil.hasPermissionCas(time, path, signature);
         BasicSchool basicSchool = AuthThirdUtil.hasPermissionCas(time, path, signature);
         OpenParams openParams = null;
         OpenParams openParams = null;
@@ -172,6 +174,9 @@ public class OpenApiController {
         Optional.ofNullable(sysUser).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("用户不存在"));
         Optional.ofNullable(sysUser).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("用户不存在"));
 
 
         LoginResult loginResult = teachcloudCommonService.login(sysUser.getPassword(), sysUser, AppSourceEnum.CAS_THIRD);
         LoginResult loginResult = teachcloudCommonService.login(sysUser.getPassword(), sysUser, AppSourceEnum.CAS_THIRD);
+        if (Objects.isNull(returnUrl) || Objects.equals(returnUrl, "")) {
+            returnUrl = URLDecoder.decode(returnUrl, SystemConstant.CHARSET_NAME);
+        }
         loginResult.setReturnUrl(returnUrl);
         loginResult.setReturnUrl(returnUrl);
         return ResultUtil.ok(loginResult);
         return ResultUtil.ok(loginResult);
     }
     }