xgj 1 ماه پیش
والد
کامیت
5eb7c285c4

+ 3 - 3
src/assets/json/authMenuList.json

@@ -25,7 +25,7 @@
             "isHide": false,
             "isFull": false,
             "isAffix": true,
-            "isKeepAlive": true
+            "isKeepAlive": false
           }
         },
         {
@@ -39,7 +39,7 @@
             "isHide": false,
             "isFull": false,
             "isAffix": true,
-            "isKeepAlive": true
+            "isKeepAlive": false
           }
         },
 
@@ -54,7 +54,7 @@
             "isHide": false,
             "isFull": false,
             "isAffix": true,
-            "isKeepAlive": true
+            "isKeepAlive": false
           }
         }
       ]

+ 1 - 1
src/layouts/LayoutColumns/index.vue

@@ -99,5 +99,5 @@ const changeSubMenu = (item: Menu.MenuOptions) => {
 </script>
 
 <style scoped lang="scss">
-@import "./index.scss";
+@import "./index";
 </style>

+ 1 - 1
src/layouts/LayoutTransverse/index.vue

@@ -57,5 +57,5 @@ const handleClickMenu = (subItem: Menu.MenuOptions) => {
 </script>
 
 <style scoped lang="scss">
-@import "./index.scss";
+@import "./index";
 </style>

+ 7 - 3
src/layouts/LayoutVertical/index.vue

@@ -5,7 +5,7 @@
       <div class="aside-box" :style="{ width: isCollapse ? '65px' : '210px' }">
         <div class="logo flx-center">
           <img class="logo-img" src="@/assets/images/logo.svg" alt="logo" />
-          <span v-show="!isCollapse" class="logo-text">{{ title }}</span>
+          <span v-show="!isCollapse" class="logo-text">{{ title }} </span>
         </div>
         <el-scrollbar>
           <el-menu
@@ -33,6 +33,7 @@
 <script setup lang="ts" name="layoutVertical">
 import { computed } from "vue";
 import { useRoute } from "vue-router";
+import { useUserStore } from "@/stores/modules/user";
 import { useAuthStore } from "@/stores/modules/auth";
 import { useGlobalStore } from "@/stores/modules/global";
 import Main from "@/layouts/components/Main/index.vue";
@@ -40,7 +41,10 @@ import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft.vue";
 import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
 import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
 
-const title = import.meta.env.VITE_GLOB_APP_TITLE;
+// const title = import.meta.env.VITE_GLOB_APP_TITLE;
+
+const userStore = useUserStore();
+const title = computed(() => userStore.userInfo.name);
 
 const route = useRoute();
 const authStore = useAuthStore();
@@ -52,5 +56,5 @@ const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu
 </script>
 
 <style scoped lang="scss">
-@import "./index.scss";
+@import "./index";
 </style>

+ 1 - 1
src/stores/modules/user.ts

@@ -6,7 +6,7 @@ export const useUserStore = defineStore({
   id: "geeker-user",
   state: (): UserState => ({
     token: "",
-    userInfo: { name: "Geeker" }
+    userInfo: { name: "" }
   }),
   getters: {},
   actions: {

+ 4 - 0
src/views/login/components/LoginForm.vue

@@ -40,6 +40,7 @@ import { useKeepAliveStore } from "@/stores/modules/keepAlive";
 import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
 import { CircleClose, UserFilled } from "@element-plus/icons-vue";
 import type { ElForm } from "element-plus";
+import request from "@/api";
 
 const router = useRouter();
 const userStore = useUserStore();
@@ -70,6 +71,9 @@ const login = (formEl: FormInstance | undefined) => {
       const { data } = await loginApi({ ...loginForm, password: loginForm.password });
       userStore.setToken(data.token);
 
+      request.get("/archivesService/agency/profile").then(resp => {
+        userStore.setUserInfo({ ...resp.data.profile, name: resp.data.profile.nickname });
+      });
       // 2.添加动态路由
       await initDynamicRouter();
 

+ 3 - 0
src/views/promotion/invoice.vue

@@ -225,6 +225,9 @@ const changePage = page => {
 
 const initData = () => {
   getList();
+  request.get("/archivesService/agency/profile").then(resp => {
+    console.log("resp");
+  });
 };
 
 initData();

+ 1 - 1
src/views/promotion/order.vue

@@ -248,7 +248,7 @@ const getList = () => {
 const getMemberCardList = () => {
   http
     .get("archivesService/agency/promotionGoods/list", {
-      params: { status: 1 }
+      status: 1
     })
     .then(resp => {
       memberCardList.value = resp.data;