From c7566bba45e6f90594d36ec4b80ac4ff89f577ee Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 08 十月 2026 14:19:36 +0800
Subject: [PATCH] 项目重构

---
 src/store/modules/user.js |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 66ed920..b1e5df4 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -15,6 +15,8 @@
       id: '',
       name: '',
       nickName: '',
+      nameEn: '',
+      userName: '',
       avatar: '',
       roles: [],
       permissions: []
@@ -24,10 +26,8 @@
       login(userInfo) {
         const username = userInfo.username.trim()
         const password = userInfo.password
-        const code = userInfo.code
-        const uuid = userInfo.uuid
         return new Promise((resolve, reject) => {
-          login(username, password, code, uuid).then(res => {
+          login(username, password).then(res => {
             setToken(res.token)
             this.token = res.token
             useLockStore().unlockScreen()
@@ -55,6 +55,8 @@
             this.id = user.userId
             this.name = user.userName
             this.nickName = user.nickName
+            this.nameEn = user.nameEn
+            this.userName = user.userName
             this.avatar = avatar
             cache.session.set('pwrChrtype', res.pwdChrtype)
             /* 鍒濆瀵嗙爜鎻愮ず */
@@ -78,12 +80,18 @@
       // 閫�鍑虹郴缁�
       logOut() {
         return new Promise((resolve, reject) => {
-          logout(this.token).then(() => {
-            this.token = ''
-            this.roles = []
-            this.permissions = []
-            removeToken()
-            resolve()
+          logout(this.token).then((res) => {
+            // 涓氬姟瀹氬埗锛氬悗绔繑鍥炶烦杞湴鍧�鏃惰蛋缁熶竴璁よ瘉鐧诲嚭锛堝 SSO 鍗曠偣閫�鍑猴級锛�
+            // 杩斿洖绌哄垯鎸夊父瑙勫墠绔櫥鍑哄鐞�
+            if (res.data) {
+              window.location.href = res.data
+            } else {
+              this.token = ''
+              this.roles = []
+              this.permissions = []
+              removeToken()
+              resolve()
+            }
           }).catch(error => {
             reject(error)
           })

--
Gitblit v1.9.3