Browse Source

更新core

tongshangming 7 months ago
parent
commit
4c7ce74b9e
4 changed files with 15 additions and 9 deletions
  1. 1 1
      package.json
  2. 4 4
      pnpm-lock.yaml
  3. 1 1
      src/api/user.ts
  4. 9 3
      src/stores/user.ts

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
   },
   },
   "dependencies": {
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
     "@element-plus/icons-vue": "^2.3.1",
-    "@fskj-admin/core": "^1.2.13",
+    "@fskj-admin/core": "^1.2.14",
     "@fskj-admin/micro": "^0.1.0",
     "@fskj-admin/micro": "^0.1.0",
     "@icon-park/vue-next": "^1.4.2",
     "@icon-park/vue-next": "^1.4.2",
     "@sentry/vue": "^8.3.0",
     "@sentry/vue": "^8.3.0",

+ 4 - 4
pnpm-lock.yaml

@@ -9,8 +9,8 @@ dependencies:
     specifier: ^2.3.1
     specifier: ^2.3.1
     version: 2.3.1(vue@3.4.27)
     version: 2.3.1(vue@3.4.27)
   '@fskj-admin/core':
   '@fskj-admin/core':
-    specifier: ^1.2.13
-    version: 1.2.13
+    specifier: ^1.2.14
+    version: 1.2.14
   '@fskj-admin/micro':
   '@fskj-admin/micro':
     specifier: ^0.1.0
     specifier: ^0.1.0
     version: 0.1.0
     version: 0.1.0
@@ -821,8 +821,8 @@ packages:
     resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==}
     resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==}
     dev: false
     dev: false
 
 
-  /@fskj-admin/core@1.2.13:
-    resolution: {integrity: sha512-dL0eSdzWOgvSy54FFlXMUTuAMXNjjnmjZXaA1o87Tvf5yhuOJRuDUnTPT3nttJTkOS1V37S1jMkTDbn7LD1sgA==}
+  /@fskj-admin/core@1.2.14:
+    resolution: {integrity: sha512-L/W/b4Ik81iOZSYdN0YExw3wCLq16d4NsggeZGHKFRzRLKBhKTD8GVNCf+yNYMJSZH6tlXRW2IXoc/fPfU67pA==}
     dev: false
     dev: false
 
 
   /@fskj-admin/micro@0.1.0:
   /@fskj-admin/micro@0.1.0:

+ 1 - 1
src/api/user.ts

@@ -5,7 +5,7 @@ export function login(data: any) {
 }
 }
 
 
 export function getUserInfo() {
 export function getUserInfo() {
-  return request.get('/user')
+  return request.get('/system/user/userInfo')
 }
 }
 
 
 // 用户列表
 // 用户列表

+ 9 - 3
src/stores/user.ts

@@ -1,7 +1,7 @@
 import router from '@/router'
 import router from '@/router'
 import config from '@/config/defaultSetting'
 import config from '@/config/defaultSetting'
 import { useRouterStore } from '@/stores/router'
 import { useRouterStore } from '@/stores/router'
-import { getMenuList, login } from '@/api/user'
+import { getMenuList, login, getUserInfo } from '@/api/user'
 
 
 export const useUserStore = defineStore({
 export const useUserStore = defineStore({
   id: 'user',
   id: 'user',
@@ -15,8 +15,14 @@ export const useUserStore = defineStore({
   }),
   }),
   actions: {
   actions: {
     async getUserInfo() {
     async getUserInfo() {
-      // const userRes: any = await getUserInfo()
-      // this.user = userRes.infos[0]
+      try {
+        const userRes: any = await getUserInfo()
+        this.user = userRes.data.user
+        this.permission = userRes.data.permissions
+        this.permission && useStorage('permissionList', this.permission)
+      } catch (error) {
+        console.log(error)
+      }
 
 
       if (config.isDynamicRouter) {
       if (config.isDynamicRouter) {
         const res: any = await getMenuList()
         const res: any = await getMenuList()