Sfoglia il codice sorgente

用户名可能会包含特殊字符,所以改为base64编码后传输

dengsixing 9 mesi fa
parent
commit
2a62f82954

+ 7 - 0
src/main/java/com/fdkankan/scene/Interceptor/CheckViewBizAuthAspect.java

@@ -1,5 +1,6 @@
 package com.fdkankan.scene.Interceptor;
 
+import cn.hutool.core.codec.Base64;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.URLUtil;
 import com.alibaba.fastjson.JSON;
@@ -179,6 +180,7 @@ public class CheckViewBizAuthAspect {
 				}else{
 					//业务授权校验用户名密码
 					userName = (String) params.get("userName");
+					userName = Base64Converter.decode(userName);
 					String password = (String) params.get("password");
 					if(StrUtil.isEmpty(userName) || StrUtil.isEmpty(password)){
 						throw new BusinessException(ErrorCode.USERNAME_PASSWORD_REQUIRE);
@@ -225,4 +227,9 @@ public class CheckViewBizAuthAspect {
 		sysLogService.save(sysLog);
 	}
 
+	public static void main(String[] args) {
+		String encode = Base64.encode("zgwhzx".getBytes());
+		System.out.println(encode);
+	}
+
 }