Jelajahi Sumber

fix: 增加全局缓存站点

周玉环 4 hari lalu
induk
melakukan
601c1bda2e

+ 1 - 0
xinkeaboard-seller/src/models/global.js

@@ -94,6 +94,7 @@ export default {
       };
     },
     setCurrentSite(state, { payload }) {
+      localStorage.setItem('currentSite', payload)
       return {
         ...state,
         currentSite: payload,

+ 1 - 1
xinkeaboard-seller/src/utils/utils.js

@@ -1379,7 +1379,7 @@ export function getSldStatYTitle() {
  * */
 export function sldComRequest(method, url, params, data_type = '') {
   const state = window.g_app._store.getState();
-  const currentSite = state.global.currentSite;
+  const currentSite = state.global.currentSite || localStorage.getItem('currentSite');
   const currentPath = state.routing.location.pathname;
   if (!currentPath.includes('/apply') && !currentPath.includes('/user/login')) {
     params = Object.assign({}, params ?? {}, { webSite: currentSite })