Ver código fonte

登录方法密码加密

gao.qiang 1 ano atrás
pai
commit
995cc6f44f

+ 3 - 1
hazard-admin/src/main/java/com/ozs/web/controller/system/SysLoginController.java

@@ -8,6 +8,7 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.model.LoginUser;
 import com.ozs.common.core.redis.RedisCache;
 import com.ozs.common.utils.StringUtils;
+import com.ozs.common.utils.stateSecrets.SymmetryTest;
 import com.ozs.framework.web.service.TokenService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -59,8 +60,9 @@ public class SysLoginController extends BaseController {
     @PostMapping("/login")
     public AjaxResult login(@RequestBody LoginBody loginBody) {
         AjaxResult ajax = AjaxResult.success();
+        String decrypt = SymmetryTest.decrypt(loginBody.getPassword(), "1234567890abcdef");
         // 生成令牌
-        String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
+        String token = loginService.login(loginBody.getUsername(), decrypt, loginBody.getCode(),
                 loginBody.getUuid());
         ajax.put(Constants.TOKEN, token);
         LoginUser loginedUser = tokenService.getLoginedUserByToken(token);