From bc35d48bada733a0a4677cce54f3aa5ce3080be6 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期四, 20 六月 2024 17:33:35 +0800
Subject: [PATCH] 提交

---
 src/store/modules/user.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 3421f46..9276e82 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,7 +2,7 @@
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import defAva from '@/assets/images/profile.jpg'
 import Cookies from "js-cookie";
-import {getUserById} from "@/api/sysUsers";
+import {getUserById} from "@/api/onlineEducation/user";
 const useUserStore = defineStore(
   'user',
   {
@@ -25,7 +25,11 @@
         return new Promise( (resolve, reject) => {
           login(username, password, code, uuid, identity).then( async res => {
             setToken(res.data.token)
-            Cookies.set('userInfo',JSON.stringify(res.data))
+            if(res.data && res.data.id){
+              const info = await getUserById(res.data.id);
+              if(info.data.code === 200){}
+              Cookies.set('userInfo',JSON.stringify(info.data))
+            }
             this.token = res.data.token
             resolve()
           }).catch(error => {

--
Gitblit v1.9.2