shaogen1995 %!s(int64=2) %!d(string=hai) anos
pai
achega
f77880aaab
Modificáronse 2 ficheiros con 5 adicións e 6 borrados
  1. 3 2
      houtai/src/pages/Login/index.tsx
  2. 2 4
      houtai/src/utils/http.ts

+ 3 - 2
houtai/src/pages/Login/index.tsx

@@ -9,7 +9,7 @@ import { setTokenInfo } from "@/utils/storage";
 import history from "@/utils/history";
 import { MessageFu } from "@/utils/message";
 import { userLoginAPI } from "@/store/action/layout";
-import logoImg from '@/assets/img/logo.png'
+import logoImg from "@/assets/img/logo.png";
 
 export default function Login() {
   // 账号密码
@@ -35,7 +35,8 @@ export default function Login() {
       // 用户信息存到本地
       setTokenInfo(res.data);
       history.push("/");
-    }
+    } else if (res.code === 3014)
+      MessageFu.warning("用户名不存在或密码错误,请联系管理员!");
   };
 
   return (

+ 2 - 4
houtai/src/utils/http.ts

@@ -10,7 +10,7 @@ export const baseURL =
   // process.env.NODE_ENV === "development"
   //   ? "http://192.168.20.55:8042/api/"
   //   : "";
-process.env.NODE_ENV === "development" ? "https://bengbubwg.4dage.com" : "";
+  process.env.NODE_ENV === "development" ? "https://bengbubwg.4dage.com" : "";
 
 // 处理  类型“AxiosResponse<any, any>”上不存在属性“code”
 declare module "axios" {
@@ -68,9 +68,7 @@ http.interceptors.response.use(
       }, 200);
     } else if (response.data.code === 0) {
       // MessageFu.success(response.data.msg);
-    } else if (response.data.code === 3014)
-      MessageFu.warning("用户名不存在或密码错误,请联系管理员!");
-    else MessageFu.warning(response.data.msg);
+    } else MessageFu.warning(response.data.msg);
 
     // 上传成功之后更改  取消上传 的状态
     if (store.getState().layoutStore.closeUpFile.state)