Sfoglia il codice sorgente

页签关闭,主应用菜单修改

quwangxin 3 anni fa
parent
commit
04adcd00ef

+ 2 - 3
src/api/saleOrder/index.js

@@ -14,14 +14,13 @@ export async function importFile (data) {
 export async function getPageList (data) {
   const res = await request.post(`/aps/salesorder/page`, data);
   if (res.data.code == 0) {
-    console.log(res.data);
     if (store.state.user.menus?.length) {
       for (const p of store.state.user.menus) {
         if (p.path === '/saleOrder') {
           store.dispatch('user/setMenuBadge', {
             path: '/saleOrder',
             value: res.data.data.count || 0,
-            color: 'red'
+            color: 'danger'
           });
           break;
         }
@@ -36,7 +35,7 @@ export async function getPageList (data) {
                 store.dispatch('user/setMenuBadge', {
                   path: '/saleOrder',
                   value: res.data.data.count || 0,
-                  color: 'red'
+                  color: 'danger'
                 });
                 break;
               }

+ 0 - 2
src/main.js

@@ -16,7 +16,6 @@ Vue.component('HeaderTitle', HeaderTitle);
 
 // // register globally
 import '@/icons';
-
 Vue.component('DictSelection', DictSelection);
 Vue.config.productionTip = false;
 
@@ -59,7 +58,6 @@ export async function bootstrap () {
 
 export async function mount (props) {
   console.log('[vue] props from main framework', props);
-
   Vue.prototype.$portalStore = props.store;
 
   initParentStore(props.store);

+ 1 - 1
src/public-path.js

@@ -2,7 +2,7 @@
   if (window.__POWERED_BY_QIANKUN__) {
     if (process.env.NODE_ENV === 'development') {
       // eslint-disable-next-line
-      __webpack_public_path__ = `//localhost:${process.env.VUE_APP_PORT}/`;
+      __webpack_public_path__ = `//localhost:8080/aps/`;
       console.log('__webpack_public_path__', __webpack_public_path__);
       return;
     }

+ 1 - 4
src/store/index.js

@@ -9,7 +9,6 @@ import user from './modules/user';
 import selectCache from './modules/selectCache';
 import theme from './modules/theme';
 import createPersistedState from 'vuex-persistedstate';
-import { createMutationObserve } from './plugins.js';
 
 import { SYSTEM_NAME } from '@/config/setting';
 
@@ -34,8 +33,6 @@ export default new Vuex.Store({
         : `private-vuex-${SYSTEM_NAME}`,
       storage: window.sessionStorage,
       paths: ['user']
-    }),
-    // 更新主应用 vuex
-    createMutationObserve({ modules: ['theme', 'user'] })
+    })
   ]
 });

+ 68 - 60
src/store/modules/theme.js

@@ -1,3 +1,4 @@
+import Vue from 'vue';
 /**
  * 主题状态管理
  */
@@ -86,7 +87,7 @@ let disableTransitionTimer, updateContentSizeTimer;
 /**
  * 读取缓存配置
  */
-function getCacheSetting() {
+function getCacheSetting () {
   try {
     const value = localStorage.getItem(THEME_STORE_NAME);
     if (value) {
@@ -104,7 +105,7 @@ function getCacheSetting() {
 /**
  * 缓存配置
  */
-function cacheSetting(key, value) {
+function cacheSetting (key, value) {
   const cache = getCacheSetting();
   if (cache[key] !== value) {
     cache[key] = value;
@@ -115,7 +116,7 @@ function cacheSetting(key, value) {
 /**
  * 开关响应式布局
  */
-function changeStyleResponsive(styleResponsive) {
+function changeStyleResponsive (styleResponsive) {
   if (styleResponsive) {
     document.body.classList.remove(BODY_LIMIT_CLASS);
   } else {
@@ -126,7 +127,7 @@ function changeStyleResponsive(styleResponsive) {
 /**
  * 切换色弱模式
  */
-function changeWeakMode(weakMode) {
+function changeWeakMode (weakMode) {
   if (weakMode) {
     document.body.classList.add(WEAK_CLASS);
   } else {
@@ -137,7 +138,7 @@ function changeWeakMode(weakMode) {
 /**
  * 切换主题
  */
-function changeTheme(value, dark) {
+function changeTheme (value, dark) {
   return new Promise((resolve, reject) => {
     try {
       changeColor(value, dark);
@@ -151,7 +152,7 @@ function changeTheme(value, dark) {
 /**
  * 切换布局时禁用过渡动画
  */
-function disableTransition() {
+function disableTransition () {
   disableTransitionTimer && clearTimeout(disableTransitionTimer);
   document.body.classList.add(DISABLES_CLASS);
   disableTransitionTimer = setTimeout(() => {
@@ -173,7 +174,7 @@ export default {
   })(),
   getters: {
     // 需要 keep-alive 的组件
-    keepAliveInclude(state) {
+    keepAliveInclude (state) {
       if (!TAB_KEEP_ALIVE || !state.showTabs) {
         return [];
       }
@@ -202,100 +203,100 @@ export default {
     }
   },
   mutations: {
-    SET(state, { key, value }) {
+    SET (state, { key, value }) {
       state[key] = value;
     }
   },
   actions: {
-    setTabs({ commit }, value) {
+    setTabs ({ commit }, value) {
       commit('SET', { key: 'tabs', value });
       //cacheSetting('tabs', value);
     },
-    setCollapse({ commit, dispatch }, value) {
+    setCollapse ({ commit, dispatch }, value) {
       commit('SET', { key: 'collapse', value });
       dispatch('delayUpdateContentSize', 800);
     },
-    setSideNavCollapse({ commit, dispatch }, value) {
+    setSideNavCollapse ({ commit, dispatch }, value) {
       commit('SET', { key: 'sideNavCollapse', value });
       dispatch('delayUpdateContentSize', 800);
     },
-    setBodyFullscreen({ commit, dispatch }, value) {
+    setBodyFullscreen ({ commit, dispatch }, value) {
       disableTransition();
       commit('SET', { key: 'bodyFullscreen', value });
       dispatch('delayUpdateContentSize', 800);
     },
-    setShowTabs({ commit, dispatch }, value) {
+    setShowTabs ({ commit, dispatch }, value) {
       commit('SET', { key: 'showTabs', value });
       cacheSetting('showTabs', value);
       dispatch('delayUpdateContentSize');
     },
-    setShowFooter({ commit, dispatch }, value) {
+    setShowFooter ({ commit, dispatch }, value) {
       commit('SET', { key: 'showFooter', value });
       cacheSetting('showFooter', value);
       dispatch('delayUpdateContentSize');
     },
-    setHeadStyle({ commit }, value) {
+    setHeadStyle ({ commit }, value) {
       commit('SET', { key: 'headStyle', value });
       cacheSetting('headStyle', value);
     },
-    setSideStyle({ commit }, value) {
+    setSideStyle ({ commit }, value) {
       commit('SET', { key: 'sideStyle', value });
       cacheSetting('sideStyle', value);
     },
-    setLayoutStyle({ commit, dispatch }, value) {
+    setLayoutStyle ({ commit, dispatch }, value) {
       disableTransition();
       commit('SET', { key: 'layoutStyle', value });
       cacheSetting('layoutStyle', value);
       dispatch('delayUpdateContentSize');
     },
-    setSideMenuStyle({ commit, dispatch }, value) {
+    setSideMenuStyle ({ commit, dispatch }, value) {
       disableTransition();
       commit('SET', { key: 'sideMenuStyle', value });
       cacheSetting('sideMenuStyle', value);
       dispatch('delayUpdateContentSize');
     },
-    setTabStyle({ commit }, value) {
+    setTabStyle ({ commit }, value) {
       commit('SET', { key: 'tabStyle', value });
       cacheSetting('tabStyle', value);
     },
-    setTransitionName({ commit }, value) {
+    setTransitionName ({ commit }, value) {
       commit('SET', { key: 'transitionName', value });
       cacheSetting('transitionName', value);
     },
-    setFixedHeader({ commit }, value) {
+    setFixedHeader ({ commit }, value) {
       disableTransition();
       commit('SET', { key: 'fixedHeader', value });
       cacheSetting('fixedHeader', value);
     },
-    setFixedSidebar({ commit }, value) {
+    setFixedSidebar ({ commit }, value) {
       disableTransition();
       commit('SET', { key: 'fixedSidebar', value });
       cacheSetting('fixedSidebar', value);
     },
-    setFixedBody({ commit }, value) {
+    setFixedBody ({ commit }, value) {
       disableTransition();
       commit('SET', { key: 'fixedBody', value });
       cacheSetting('fixedBody', value);
     },
-    setBodyFull({ commit, dispatch }, value) {
+    setBodyFull ({ commit, dispatch }, value) {
       commit('SET', { key: 'bodyFull', value });
       cacheSetting('bodyFull', value);
       dispatch('delayUpdateContentSize');
     },
-    setLogoAutoSize({ commit }, value) {
+    setLogoAutoSize ({ commit }, value) {
       disableTransition();
       commit('SET', { key: 'logoAutoSize', value });
       cacheSetting('logoAutoSize', value);
     },
-    setColorfulIcon({ commit }, value) {
+    setColorfulIcon ({ commit }, value) {
       commit('SET', { key: 'colorfulIcon', value });
       cacheSetting('colorfulIcon', value);
     },
-    setSideUniqueOpen({ commit }, value) {
+    setSideUniqueOpen ({ commit }, value) {
       commit('SET', { key: 'sideUniqueOpen', value });
       cacheSetting('sideUniqueOpen', value);
     },
-    setStyleResponsive({ commit }, value) {
+    setStyleResponsive ({ commit }, value) {
       changeStyleResponsive(value);
       commit('SET', { key: 'styleResponsive', value });
       cacheSetting('styleResponsive', value);
@@ -304,7 +305,7 @@ export default {
      * 切换色弱模式
      * @param value 是否是色弱模式
      */
-    setWeakMode({ commit }, value) {
+    setWeakMode ({ commit }, value) {
       return new Promise((resolve) => {
         changeWeakMode(value);
         commit('SET', { key: 'weakMode', value });
@@ -316,7 +317,7 @@ export default {
      * 切换暗黑模式
      * @param value 是否是暗黑模式
      */
-    setDarkMode({ commit, state }, value) {
+    setDarkMode ({ commit, state }, value) {
       return new Promise((resolve, reject) => {
         changeTheme(state.color, value)
           .then(() => {
@@ -333,7 +334,7 @@ export default {
      * 切换主题色
      * @param value 主题色
      */
-    setColor({ commit, state }, value) {
+    setColor ({ commit, state }, value) {
       return new Promise((resolve, reject) => {
         changeTheme(value, state.darkMode)
           .then(() => {
@@ -350,20 +351,20 @@ export default {
      * 设置主页路由对应的组件名称
      * @param components 组件名称
      */
-    setHomeComponents({ commit }, value) {
+    setHomeComponents ({ commit }, value) {
       commit('SET', { key: 'homeComponents', value });
     },
     /**
      * 设置刷新路由信息
      * @param option 路由刷新参数
      */
-    setRouteReload({ commit }, value) {
+    setRouteReload ({ commit }, value) {
       commit('SET', { key: 'routeReload', value });
     },
     /**
      * 更新屏幕尺寸
      */
-    updateScreenSize({ commit, dispatch }) {
+    updateScreenSize ({ commit, dispatch }) {
       commit('SET', { key: 'screenWidth', value: screenWidth() });
       commit('SET', { key: 'screenHeight', value: screenHeight() });
       dispatch('updateContentSize');
@@ -371,7 +372,7 @@ export default {
     /**
      * 更新内容区域尺寸
      */
-    updateContentSize({ commit }) {
+    updateContentSize ({ commit }) {
       commit('SET', { key: 'contentWidth', value: contentWidth() });
       commit('SET', { key: 'contentHeight', value: contentHeight() });
     },
@@ -379,7 +380,7 @@ export default {
      * 延时更新内容区域尺寸
      * @param delay 延迟时间
      */
-    delayUpdateContentSize({ dispatch }, delay) {
+    delayUpdateContentSize ({ dispatch }, delay) {
       updateContentSizeTimer && clearTimeout(updateContentSizeTimer);
       updateContentSizeTimer = setTimeout(() => {
         dispatch('updateContentSize');
@@ -388,7 +389,7 @@ export default {
     /**
      * 重置设置
      */
-    resetSetting({ commit, state }) {
+    resetSetting ({ commit, state }) {
       return new Promise((resolve, reject) => {
         disableTransition();
         [
@@ -431,7 +432,7 @@ export default {
     /**
      * 恢复主题
      */
-    recoverTheme({ state }) {
+    recoverTheme ({ state }) {
       // 关闭响应式布局
       if (!state.styleResponsive) {
         changeStyleResponsive(false);
@@ -451,7 +452,7 @@ export default {
      * 添加页签或更新相同 key 的页签数据
      * @param data 页签数据
      */
-    tabAdd({ dispatch, state }, data) {
+    tabAdd ({ dispatch, state }, data) {
       if (Array.isArray(data)) {
         data.forEach((d) => {
           dispatch('tabAdd', d);
@@ -475,28 +476,35 @@ export default {
      * 关闭页签
      * @param key 页签 key
      */
-    async tabRemove({ dispatch, state }, { key, active }) {
-      const i = state.tabs.findIndex(
-        (t) => t.key === key || t.fullPath === key
-      );
-      if (i === -1) {
-        return {};
-      }
-      const t = state.tabs[i];
-      if (!t.closable) {
-        return Promise.reject();
+    async tabRemove ({ dispatch, state }, { key, active }) {
+      if (window.__POWERED_BY_QIANKUN__) {
+        return Vue.prototype.$portalStore?.dispatch('theme/tabRemove', {
+          key,
+          active
+        });
+      } else {
+        const i = state.tabs.findIndex(
+          (t) => t.key === key || t.fullPath === key
+        );
+        if (i === -1) {
+          return {};
+        }
+        const t = state.tabs[i];
+        if (!t.closable) {
+          return Promise.reject();
+        }
+        const path = state.tabs[i - 1]?.fullPath;
+        dispatch(
+          'setTabs',
+          state.tabs.filter((_d, j) => j !== i)
+        );
+        return t.key === active ? { path, home: !path } : {};
       }
-      const path = state.tabs[i - 1]?.fullPath;
-      dispatch(
-        'setTabs',
-        state.tabs.filter((_d, j) => j !== i)
-      );
-      return t.key === active ? { path, home: !path } : {};
     },
     /**
      * 关闭左侧页签
      */
-    async tabRemoveLeft({ dispatch, state }, { key, active }) {
+    async tabRemoveLeft ({ dispatch, state }, { key, active }) {
       let index = -1; // 选中页签的 index
       for (let i = 0; i < state.tabs.length; i++) {
         if (state.tabs[i].key === active) {
@@ -520,7 +528,7 @@ export default {
     /**
      * 关闭右侧页签
      */
-    async tabRemoveRight({ dispatch, state }, { key, active }) {
+    async tabRemoveRight ({ dispatch, state }, { key, active }) {
       if (state.tabs.length) {
         let index = -1; // 选中页签的 index
         for (let i = 0; i < state.tabs.length; i++) {
@@ -557,7 +565,7 @@ export default {
     /**
      * 关闭其它页签
      */
-    async tabRemoveOther({ dispatch, state }, { key, active }) {
+    async tabRemoveOther ({ dispatch, state }, { key, active }) {
       let index = -1; // 选中页签的 index
       let path; // 关闭后跳转的 path
       const temp = state.tabs.filter((d, i) => {
@@ -582,7 +590,7 @@ export default {
      * 关闭全部页签
      * @param active 选中页签的 key
      */
-    async tabRemoveAll({ dispatch, state }, active) {
+    async tabRemoveAll ({ dispatch, state }, active) {
       const t = state.tabs.find((d) => d.key === active);
       const home = typeof t !== 'undefined' && t.closable === true; // 是否跳转主页
       const temp = state.tabs.filter((d) => !d.closable);
@@ -596,7 +604,7 @@ export default {
      * 修改页签
      * @param data 页签数据
      */
-    tabSetItem({ dispatch, state }, data) {
+    tabSetItem ({ dispatch, state }, data) {
       let i = -1;
       if (data.key) {
         i = state.tabs.findIndex((d) => d.key === data.key);

+ 23 - 14
src/store/modules/user.js

@@ -5,6 +5,7 @@ import { formatMenus, toTreeData, formatTreeData } from 'ele-admin';
 import { USER_MENUS } from '@/config/setting';
 import { getResourcesTree } from '@/api/layout';
 import { SYSTEM_NAME } from '@/config/setting';
+import Vue from 'vue';
 const formatRouter = (list) => {
   let menuList = []; // menuType
   let authorities = [];
@@ -170,20 +171,28 @@ export default {
      * 更新菜单的badge
      */
     setMenuBadge ({ commit, state }, { path, value, color }) {
-      const menus = formatTreeData(state.menus, (m) => {
-        if (path === m.path) {
-          return {
-            ...m,
-            meta: {
-              ...m.meta,
-              badge: value,
-              badgeColor: color
-            }
-          };
-        }
-        return m;
-      });
-      commit('setMenus', menus);
+      if (window.__POWERED_BY_QIANKUN__) {
+        Vue.prototype.$portalStore?.dispatch('user/setMenuBadge', {
+          path: `/page-${SYSTEM_NAME}${path}`,
+          value,
+          color
+        });
+      } else {
+        const menus = formatTreeData(state.menus, (m) => {
+          if (path === m.path) {
+            return {
+              ...m,
+              meta: {
+                ...m.meta,
+                badge: value,
+                badgeColor: color
+              }
+            };
+          }
+          return m;
+        });
+        commit('setMenus', menus);
+      }
     }
   }
 };

+ 6 - 23
src/store/plugins.js

@@ -1,36 +1,19 @@
-// import store from '../src/store';
 import vue from 'vue';
-// export default function (state) {
-//   if (!state) {
-//     return;
-//   }
-//   // 主题
-//   if (state.theme) {
-//     for (const key in state.theme) {
-//       store.commit('theme/SET', { key, value: state.theme[key] });
-//     }
-
-//     store.dispatch('theme/setColor', state.theme.color);
-//     store.dispatch('theme/setWeakMode', state.theme.weakMode);
-//     store.dispatch('theme/setStyleResponsive', state.theme.styleResponsive);
-//   }
-//   //   用户信息
-//   if (state.user?.info) {
-//     store.commit('user/setUserInfo', state.user.info);
-//   }
-// }
 
 export const createMutationObserve = ({ modules = [] }) => {
   return (store) => {
     store.subscribe((mutation, state) => {
       // 每次 mutation 之后调用
       // mutation 的格式为 { type, payload }
+      console.log(mutation, 'mutation');
       if (
         modules?.length &&
-        modules.find((i) => mutation?.type?.startsWith(i + '/'))
+        modules.find((i) => mutation?.type?.startsWith(i + '/')) &&
+        mutation.payload.toPort
       ) {
-        vue.$portalStore?.commit &&
-          vue.$portalStore?.commit(mutation.type, mutation.payload);
+        console.log(vue.prototype.$portalStore, 'vue.prototype.$portalStore');
+        vue.prototype.$portalStore?.commit &&
+          vue.prototype.$portalStore?.commit(mutation.type, mutation.payload);
       }
     });
   };

+ 22 - 19
src/utils/page-tab-util.js

@@ -6,6 +6,7 @@ import router from '@/router';
 import { Message } from 'element-ui';
 import { removeToken } from '@/utils/token-util';
 import { setDocumentTitle } from '@/utils/document-title-util';
+import { SYSTEM_NAME } from '@/config/setting';
 import {
   HOME_PATH,
   LAYOUT_PATH,
@@ -18,7 +19,7 @@ const BASE_URL = process.env.BASE_URL;
 /**
  * 刷新当前路由
  */
-export function reloadPageTab(option) {
+export function reloadPageTab (option) {
   if (!option) {
     // 刷新当前路由
     const { path, fullPath, query } = router.currentRoute;
@@ -49,7 +50,7 @@ export function reloadPageTab(option) {
 /**
  * 关闭当前页签
  */
-export function finishPageTab() {
+export function finishPageTab () {
   const key = getRouteTabKey();
   removePageTab({ key, active: key });
 }
@@ -59,7 +60,7 @@ export function finishPageTab() {
  * @param key 页签的key
  * @param active 选中页签的key
  */
-export function removePageTab(option) {
+export function removePageTab (option) {
   store
     .dispatch('theme/tabRemove', option)
     .then(({ path, home }) => {
@@ -77,7 +78,7 @@ export function removePageTab(option) {
 /**
  * 关闭左侧页签
  */
-export function removeLeftPageTab(option) {
+export function removeLeftPageTab (option) {
   store
     .dispatch('theme/tabRemoveLeft', option)
     .then(({ path }) => {
@@ -93,7 +94,7 @@ export function removeLeftPageTab(option) {
 /**
  * 关闭右侧页签
  */
-export function removeRightPageTab(option) {
+export function removeRightPageTab (option) {
   store
     .dispatch('theme/tabRemoveRight', option)
     .then(({ path, home }) => {
@@ -111,7 +112,7 @@ export function removeRightPageTab(option) {
 /**
  * 关闭其它页签
  */
-export function removeOtherPageTab(option) {
+export function removeOtherPageTab (option) {
   store
     .dispatch('theme/tabRemoveOther', option)
     .then(({ path, home }) => {
@@ -130,7 +131,7 @@ export function removeOtherPageTab(option) {
  * 关闭全部页签
  * @param active 当前选中页签
  */
-export function removeAllPageTab(active) {
+export function removeAllPageTab (active) {
   store
     .dispatch('theme/tabRemoveAll', active)
     .then(({ home }) => {
@@ -146,7 +147,7 @@ export function removeAllPageTab(active) {
 /**
  * 登录成功后清空页签
  */
-export function cleanPageTabs() {
+export function cleanPageTabs () {
   store.dispatch('theme/setTabs', []);
 }
 
@@ -154,7 +155,7 @@ export function cleanPageTabs() {
  * 添加页签
  * @param data 页签数据
  */
-export function addPageTab(data) {
+export function addPageTab (data) {
   store.dispatch('theme/tabAdd', data);
 }
 
@@ -162,7 +163,7 @@ export function addPageTab(data) {
  * 修改页签
  * @param data 页签数据
  */
-export function setPageTab(data) {
+export function setPageTab (data) {
   store.dispatch('theme/tabSetItem', data);
 }
 
@@ -170,7 +171,7 @@ export function setPageTab(data) {
  * 更新页签数据
  * @param data 页签数据
  */
-export function setPageTabs(data) {
+export function setPageTabs (data) {
   store.dispatch('theme/setTabs', data);
 }
 
@@ -178,7 +179,7 @@ export function setPageTabs(data) {
  * 修改页签标题
  * @param title 标题
  */
-export function setPageTabTitle(title) {
+export function setPageTabTitle (title) {
   setPageTab({ key: getRouteTabKey(), title });
   setDocumentTitle(title);
 }
@@ -186,17 +187,19 @@ export function setPageTabTitle(title) {
 /**
  * 获取当前路由对应的页签 key
  */
-export function getRouteTabKey() {
+export function getRouteTabKey () {
   const { path, fullPath, meta } = router.currentRoute;
   const isUnique = meta.tabUnique === false || REPEATABLE_TABS.includes(path);
-  return isUnique ? fullPath : path;
+  return `${window.__POWERED_BY_QIANKUN__ ? '/page-' + SYSTEM_NAME : ''}${
+    isUnique ? fullPath : path
+  }`;
 }
 
 /**
  * 设置主页的组件名称
  * @param components 组件名称
  */
-export function setHomeComponents(components) {
+export function setHomeComponents (components) {
   store.dispatch('theme/setHomeComponents', components);
 }
 
@@ -204,7 +207,7 @@ export function setHomeComponents(components) {
  * 设置路由刷新信息
  * @param option 路由刷新参数
  */
-export function setRouteReload(option) {
+export function setRouteReload (option) {
   return store.dispatch('theme/setRouteReload', option);
 }
 
@@ -212,7 +215,7 @@ export function setRouteReload(option) {
  * 判断路由是否是主页
  * @param route 路由信息
  */
-export function isHomeRoute(route) {
+export function isHomeRoute (route) {
   const { path, matched } = route;
   if (HOME_ROUTE === path) {
     return true;
@@ -228,7 +231,7 @@ export function isHomeRoute(route) {
  * 登录成功后跳转首页
  * @param from 登录前的地址
  */
-export function goHomeRoute(from) {
+export function goHomeRoute (from) {
   router.replace(from || HOME_ROUTE);
 }
 
@@ -237,7 +240,7 @@ export function goHomeRoute(from) {
  * @param from 是否使用路由跳转
  * @param from 登录后跳转的地址
  */
-export function logout(route, from) {
+export function logout (route, from) {
   removeToken();
   if (route) {
     router.push({

+ 2 - 2
vue.config.js

@@ -31,12 +31,12 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.38:8080', // 陈潇
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平
-        // target: 'http://192.168.3.51:18086', // 测试环境
+        target: 'http://192.168.3.51:18086', // 测试环境
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {