li.shaoyi 2 年之前
父节点
当前提交
894123d372
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/business/login/index.ts

+ 5 - 3
src/business/login/index.ts

@@ -29,7 +29,7 @@ export function useLogin(persist = false) {
     const formData = reactive<Proto.LoginReq>({
         LoginID: localStorage.getItem('app_loginId') ?? '',
         LoginPWD: '',
-        GUID: v4(),
+        GUID: '',
         LoginType: 0,
         ClientType: 0,
         Version: '2.0.0.0',
@@ -89,6 +89,7 @@ export function useLogin(persist = false) {
                     })
                 }
             })
+            payload.GUID = v4()
             await login(payload).then(async (res) => {
                 // 更新登录信息
                 loginStore.setLoginInfo({
@@ -97,12 +98,12 @@ export function useLogin(persist = false) {
                     token: res.Token,
                     userId: res.UserID,
                 }, persist)
-                
+
                 // 更新自动登录信息
                 loginStore.setAutoLoginData({
                     clientType: payload.ClientType,
                     password: payload.LoginPWD,
-                    userName: payload.LoginID 
+                    userName: payload.LoginID
                 })
 
                 localStorage.setItem('app_loginId', formData.LoginID) // 记住登录ID
@@ -122,6 +123,7 @@ export function useLogin(persist = false) {
         timerTask.clearAll()
 
         logout().finally(() => {
+            accountStore.$reset()
             loginStore.clearAutoLoginData()
             loginStore.clearLoginInfo()
             callback && callback()