From 31ab2edfa500364818d2cc2c30acc1f4ae5b8dac Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期二, 20 八月 2024 17:25:30 +0800
Subject: [PATCH] bug修改

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

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 4451a04..8461d2e 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -3,6 +3,7 @@
 import defAva from '@/assets/images/profile.jpg'
 import Cookies from "js-cookie";
 import {getUserById} from "@/api/hazardousChemicals/user";
+import {getConfigById} from "@/api/hazardousChemicals/config";
 const useUserStore = defineStore(
   'user',
   {
@@ -27,8 +28,15 @@
             setToken(res.data.token)
             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))
+              if(info.code === 200){
+                Cookies.set('userInfo',JSON.stringify(info.data))
+              }
+              if(info.data.userType != 0){
+                const con = await getConfigById(res.data.companyId);
+                if(con.code === 200){
+                  Cookies.set('configInfo',JSON.stringify(con.data))
+                }
+              }
             }
             this.token = res.data.token
             resolve()

--
Gitblit v1.9.2