weixin_52219567 1 hafta önce
ebeveyn
işleme
bec0bcf35a

+ 1 - 1
src/layout/index.vue

@@ -8,7 +8,7 @@
       <Workbench ref="WorkbenchRef" v-if="meta.workbench" />
       <router-view> </router-view>
     </div>
-    <Foot v-if="meta.foot != 'hide'" />
+    <Foot />
   </div>
 </template>
 

+ 31 - 22
src/utils/request.ts

@@ -127,29 +127,38 @@ service.interceptors.response.use(
     if (code === 401) {
       if (!isRelogin.show) {
         isRelogin.show = true;
-        ElMessageBox.confirm('登录状态已过期,请重新登录', '登录提示', {
-          confirmButtonText: '重新登录',
-          type: 'warning'
-        })
-          .then(() => {
-            isRelogin.show = false;
-            useUserStore()
-              .logout()
-              .then(() => {
-                let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
+        let url = `https://${import.meta.env.VITE_DOMAIN_WWW}`;
+        if (import.meta.env.PROD) {
+          url = `${url}/index`;
+        } else {
+          const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+          url = `${url}:${devPort}/index`;
+        }
+        window.location.href = url;
+        isRelogin.show = false;
+        // ElMessageBox.confirm('登录状态已过期,请重新登录', '登录提示', {
+        //   confirmButtonText: '重新登录',
+        //   type: 'warning'
+        // })
+        //   .then(() => {
+        //     isRelogin.show = false;
+        //     useUserStore()
+        //       .logout()
+        //       .then(() => {
+        //         let url = `https://${import.meta.env.VITE_DOMAIN_PASSPORT}`;
 
-                if (import.meta.env.PROD) {
-                  url = `${url}/login`;
-                } else {
-                  const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
-                  url = `${url}:${devPort}/login`;
-                }
-                window.location.href = url;
-              });
-          })
-          .catch(() => {
-            isRelogin.show = false;
-          });
+        //         if (import.meta.env.PROD) {
+        //           url = `${url}/login`;
+        //         } else {
+        //           const devPort = window.location.port || import.meta.env.VITE_APP_PORT;
+        //           url = `${url}:${devPort}/login`;
+        //         }
+        //         window.location.href = url;
+        //       });
+        //   })
+        //   .catch(() => {
+        //     isRelogin.show = false;
+        //   });
       }
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
     } else if (code === HttpStatus.SERVER_ERROR) {

+ 1 - 1
src/views/home/index-enterprise.vue

@@ -111,7 +111,7 @@
     <JDProducts />
 
     <!-- 4. 页脚 -->
-    <JDFooter />
+    <!-- <JDFooter /> -->
   </div>
 </template>
 

+ 11 - 3
src/views/home/jdcomponents/JDUserPanel.vue

@@ -10,7 +10,7 @@
       </div>
       <div class="u-info">
         <p class="name">{{ userInfo.nickName }}</p>
-        <p @click="onPath('/breg')" class="links">切换企业账号<span class="divider">|</span>注册</p>
+        <!-- <p @click="onPath('/breg')" class="links">切换企业账号<span class="divider">|</span>注册</p> -->
       </div>
     </div>
 
@@ -19,8 +19,8 @@
       <div class="c-tag">企业会员</div>
       <div class="c-main flex-between">
         <div class="c-left">
-          <div class="c-h">企业授信额</div>
-          <p class="credit-num">20000元</p>
+          <div class="c-h">授信额</div>
+          <p class="credit-num">{{ salesInfo.creditAmount || '0.00' }}元</p>
         </div>
       </div>
     </div>
@@ -83,6 +83,7 @@
 
 <script setup lang="ts">
 import { currentQuickEntryModule } from '@/api/home/index-enterprise';
+import { getEnterpriseInfo } from '@/api/pc/enterprise';
 import { getInfo } from '@/api/login';
 import { onPath } from '@/utils/siteConfig';
 import { countOrder } from '@/api/home/index';
@@ -91,6 +92,13 @@ const dataList = ref<any>([]);
 const dataInfo = ref<any>({});
 const userInfo = ref<any>({});
 const countData = ref<any>({});
+const salesInfo = ref<any>({});
+
+getEnterpriseInfo().then((res) => {
+  if (res.code == 200) {
+    salesInfo.value = res.data.customerSalesInfoVo || {};
+  }
+});
 
 currentQuickEntryModule({}).then((res) => {
   if (res.code == 200) {