浏览代码

优化异常返回

linzhiwei 2 年之前
父节点
当前提交
42a90b43a9

+ 1 - 1
tofly-auth/src/main/java/com/tofly/auth/oauth/ToFlyUserDetailsService.java

@@ -64,7 +64,7 @@ public class ToFlyUserDetailsService implements UserDetailsService {
      */
     private UserDetails getUserDetails(ResultRespone<UserInfo> result,String username) {
         if (result == null || result.getResult() == null) {
-            throw new UsernameNotFoundException(username+"用户不存在");
+            throw new UsernameNotFoundException("用户名或密码错误");
         }
 
         UserInfo userInfo=result.getResult();

+ 1 - 3
tofly-auth/src/main/java/com/tofly/auth/util/AESUtil.java

@@ -1,8 +1,7 @@
 package com.tofly.auth.util;
 
 import org.apache.commons.codec.binary.Base64;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
+
 
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
@@ -13,7 +12,6 @@ import javax.crypto.spec.SecretKeySpec;
  */
 
 public class AESUtil {
-
     // 加密
     public static String encry(String content, String key) throws Exception {
         String IV = key;