林倩 vor 3 Jahren
Ursprung
Commit
560e16db04

+ 3 - 3
config/dev.env.js

@@ -13,7 +13,7 @@ module.exports = merge(prodEnv, {
     QQQ: '"/easy-mock2"',
 
     //是否需要登录验证
-    NEED_LOGIN: "true",
+    NEED_LOGIN: "false",
 
     //需要依赖的系统名称
     // INSTALLED_PROJECT: "'zfba,demo2,cross-env'",
@@ -37,8 +37,8 @@ module.exports = merge(prodEnv, {
             // target: "http://10.11.0.48:8861",// 邱宇
             // target: "http://10.254.11.203:8861"
             // target: "http://10.11.1.237:8861"
-            // target: "http://10.254.11.203:8861"
-             target: "http://192.168.10.2:8871"
+            target: "http://10.254.11.203:8861"
+            //  target: "http://192.168.10.2:8871"
 
         }
     })

+ 49 - 1
index.html

@@ -16,6 +16,54 @@
     </head>
     <body>
         <div id="app"></div>
-        <!-- built files will be auto injected -->
     </body>
 </html>
+<script>
+    // NOTE: window.RTCPeerConnection is "not a constructor" in FF22/23
+var RTCPeerConnection = /*window.RTCPeerConnection ||*/ window.webkitRTCPeerConnection || window.mozRTCPeerConnection;
+
+if (RTCPeerConnection) (function () {
+    var rtc = new RTCPeerConnection({iceServers:[]});
+    if (1 || window.mozRTCPeerConnection) {      // FF [and now Chrome!] needs a channel/stream to proceed
+        rtc.createDataChannel('', {reliable:false});
+    };
+    
+    rtc.onicecandidate = function (evt) {
+        // convert the candidate to SDP so we can run it through our general parser
+        // see https://twitter.com/lancestout/status/525796175425720320 for details
+        if (evt.candidate) grepSDP("a="+evt.candidate.candidate);
+    };
+    rtc.createOffer(function (offerDesc) {
+        grepSDP(offerDesc.sdp);
+        rtc.setLocalDescription(offerDesc);
+    }, function (e) { console.warn("offer failed", e); });
+    
+    
+    var addrs = Object.create(null);
+    addrs["0.0.0.0"] = false;
+    function updateDisplay(newAddr) {
+        if (newAddr in addrs) return;
+        else addrs[newAddr] = true;
+        var displayAddrs = Object.keys(addrs).filter(function (k) { return addrs[k]; });
+        const localIp = displayAddrs.join(" or perhaps ") || "n/a";
+        window.sessionStorage.setItem("localIp",localIp);
+        console.log(localIp);
+    }
+    
+    function grepSDP(sdp) {
+        var hosts = [];
+        sdp.split('\r\n').forEach(function (line) { // c.f. http://tools.ietf.org/html/rfc4566#page-39
+            if (~line.indexOf("a=candidate")) {     // http://tools.ietf.org/html/rfc4566#section-5.13
+                var parts = line.split(' '),        // http://tools.ietf.org/html/rfc5245#section-15.1
+                    addr = parts[4],
+                    type = parts[7];
+                if (type === 'host') updateDisplay(addr);
+            } else if (~line.indexOf("c=")) {       // http://tools.ietf.org/html/rfc4566#section-5.7
+                var parts = line.split(' '),
+                    addr = parts[2];
+                updateDisplay(addr);
+            }
+        });
+    }
+})(); 
+</script>

+ 47 - 49
package-lock.json

@@ -3729,39 +3729,6 @@
       "resolved": "http://192.168.6.13:8082/repository/npm_all/deepmerge/-/deepmerge-1.5.2.tgz",
       "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
     },
-    "default-gateway": {
-      "version": "2.7.2",
-      "resolved": "http://192.168.6.13:8082/repository/npm_all/default-gateway/-/default-gateway-2.7.2.tgz",
-      "integrity": "sha1-t+8znl4CSwRUZ69APVA0jbRkLQ8=",
-      "dev": true,
-      "requires": {
-        "execa": "^0.10.0",
-        "ip-regex": "^2.1.0"
-      },
-      "dependencies": {
-        "execa": {
-          "version": "0.10.0",
-          "resolved": "http://192.168.6.13:8082/repository/npm_all/execa/-/execa-0.10.0.tgz",
-          "integrity": "sha1-/0Vqj1P5D47MxxqW0Rvfx/CCy1A=",
-          "dev": true,
-          "requires": {
-            "cross-spawn": "^6.0.0",
-            "get-stream": "^3.0.0",
-            "is-stream": "^1.1.0",
-            "npm-run-path": "^2.0.0",
-            "p-finally": "^1.0.0",
-            "signal-exit": "^3.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
-        "get-stream": {
-          "version": "3.0.0",
-          "resolved": "http://192.168.6.13:8082/repository/npm_all/get-stream/-/get-stream-3.0.0.tgz",
-          "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
-          "dev": true
-        }
-      }
-    },
     "defaults": {
       "version": "1.0.3",
       "resolved": "http://192.168.6.13:8082/repository/npm_all/defaults/-/defaults-1.0.3.tgz",
@@ -6970,16 +6937,6 @@
         }
       }
     },
-    "internal-ip": {
-      "version": "3.0.1",
-      "resolved": "http://192.168.6.13:8082/repository/npm_all/internal-ip/-/internal-ip-3.0.1.tgz",
-      "integrity": "sha1-31yZh24dLrLqLXT1IOP2aaAOzic=",
-      "dev": true,
-      "requires": {
-        "default-gateway": "^2.6.0",
-        "ipaddr.js": "^1.5.2"
-      }
-    },
     "interpret": {
       "version": "1.4.0",
       "resolved": "http://192.168.6.13:8082/repository/npm_all/interpret/-/interpret-1.4.0.tgz",
@@ -7006,12 +6963,6 @@
       "resolved": "http://192.168.6.13:8082/repository/npm_all/ip/-/ip-1.1.5.tgz",
       "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
     },
-    "ip-regex": {
-      "version": "2.1.0",
-      "resolved": "http://192.168.6.13:8082/repository/npm_all/ip-regex/-/ip-regex-2.1.0.tgz",
-      "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=",
-      "dev": true
-    },
     "ipaddr.js": {
       "version": "1.9.1",
       "resolved": "http://192.168.6.13:8082/repository/npm_all/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -16413,6 +16364,16 @@
             "xregexp": "4.0.0"
           }
         },
+        "default-gateway": {
+          "version": "2.7.2",
+          "resolved": "http://192.168.6.13:8082/repository/npm_all/default-gateway/-/default-gateway-2.7.2.tgz",
+          "integrity": "sha1-t+8znl4CSwRUZ69APVA0jbRkLQ8=",
+          "dev": true,
+          "requires": {
+            "execa": "^0.10.0",
+            "ip-regex": "^2.1.0"
+          }
+        },
         "del": {
           "version": "3.0.0",
           "resolved": "http://192.168.6.13:8082/repository/npm_all/del/-/del-3.0.0.tgz",
@@ -16427,6 +16388,21 @@
             "rimraf": "^2.2.8"
           }
         },
+        "execa": {
+          "version": "0.10.0",
+          "resolved": "http://192.168.6.13:8082/repository/npm_all/execa/-/execa-0.10.0.tgz",
+          "integrity": "sha1-/0Vqj1P5D47MxxqW0Rvfx/CCy1A=",
+          "dev": true,
+          "requires": {
+            "cross-spawn": "^6.0.0",
+            "get-stream": "^3.0.0",
+            "is-stream": "^1.1.0",
+            "npm-run-path": "^2.0.0",
+            "p-finally": "^1.0.0",
+            "signal-exit": "^3.0.0",
+            "strip-eof": "^1.0.0"
+          }
+        },
         "find-up": {
           "version": "3.0.0",
           "resolved": "http://192.168.6.13:8082/repository/npm_all/find-up/-/find-up-3.0.0.tgz",
@@ -16452,6 +16428,12 @@
           "integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o=",
           "dev": true
         },
+        "get-stream": {
+          "version": "3.0.0",
+          "resolved": "http://192.168.6.13:8082/repository/npm_all/get-stream/-/get-stream-3.0.0.tgz",
+          "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
+          "dev": true
+        },
         "glob-parent": {
           "version": "3.1.0",
           "resolved": "http://192.168.6.13:8082/repository/npm_all/glob-parent/-/glob-parent-3.1.0.tgz",
@@ -16500,6 +16482,22 @@
           "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
           "dev": true
         },
+        "internal-ip": {
+          "version": "3.0.1",
+          "resolved": "http://192.168.6.13:8082/repository/npm_all/internal-ip/-/internal-ip-3.0.1.tgz",
+          "integrity": "sha1-31yZh24dLrLqLXT1IOP2aaAOzic=",
+          "dev": true,
+          "requires": {
+            "default-gateway": "^2.6.0",
+            "ipaddr.js": "^1.5.2"
+          }
+        },
+        "ip-regex": {
+          "version": "2.1.0",
+          "resolved": "http://192.168.6.13:8082/repository/npm_all/ip-regex/-/ip-regex-2.1.0.tgz",
+          "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=",
+          "dev": true
+        },
         "is-binary-path": {
           "version": "1.0.1",
           "resolved": "http://192.168.6.13:8082/repository/npm_all/is-binary-path/-/is-binary-path-1.0.1.tgz",

+ 1 - 1
package.json

@@ -41,7 +41,7 @@
     "postcss-salad": "^2.0.1",
     "request": "^2.88.2",
     "screenfull": "^4.0.0",
-    "ui-component-v4": "^1.2.19",
+    "ui-component-v4": "^1.2.41",
     "ui-gojs": "^2.1.9",
     "ui-jz-v4-common": "^1.2.222",
     "vue": "2.6.10",

+ 5 - 2
src/pages/layout/components/sidebar/index.vue

@@ -68,6 +68,9 @@ export default {
     }
 };
 </script>
-<style lang="scss">
-
+<style lang="scss" scoped>
+/deep/ .l-sidebar__scrollbar {
+    margin-bottom: -17px !important;
+    margin-right: -17px !important;
+}
 </style>

+ 3 - 2
src/pages/list-manage/red-list-manage/component/app-func.vue

@@ -45,7 +45,7 @@
         </template>
       </vxe-table-column>
       <vxe-table-column type="seq" width="60" align="center" title="序号"></vxe-table-column>
-      <vxe-table-column align="center" title="应用功能名称" field="label" :treeNode="true"></vxe-table-column>
+      <vxe-table-column align="left" header-align="center" title="应用功能名称" field="label" :treeNode="true"></vxe-table-column>
       <vxe-table-column align="center" title="红名单级别" field="level">
         <template #default="{ row }">
           {{ levelToLabel(row.level) }} 
@@ -146,9 +146,10 @@ export default {
     // 打开弹窗
     openLayer(title, content, operate) {
       const vm = this;
+      const checkboxReserveRecords = this.$refs.vxeGrid.getCheckboxReserveRecords(true);
       const checkboxRecords = this.$refs.vxeGrid.getCheckboxRecords(true);
       const indeterminateRecords = this.$refs.vxeGrid.getCheckboxIndeterminateRecords(true);
-      const selectedData = [...checkboxRecords, ...indeterminateRecords].filter((item) => item.pid);
+      const selectedData = [...checkboxRecords, ...checkboxReserveRecords, ...indeterminateRecords].filter((item) => item.pid);
       const layer = this.$dgLayer({
         title,
         content,

+ 6 - 7
src/pages/list-manage/red-list-manage/component/batch-add-appfunc.vue

@@ -36,7 +36,7 @@
         </template>
       </vxe-table-column>
       <vxe-table-column type="seq" width="60" align="center" title="序号"></vxe-table-column>
-      <vxe-table-column align="center" title="应用功能名称" field="label" :treeNode="true"></vxe-table-column>
+      <vxe-table-column align="left" header-align="center" title="应用功能名称" field="label" :treeNode="true"></vxe-table-column>
     </vxe-table>
 
     <div v-footer>
@@ -84,8 +84,7 @@ export default {
       this.$refs.vxeGrid.toggleAllCheckboxRow();
     },
     handleSearch() {
-       this.dataSource = this.data.filter(item => item.label.indexOf(this.appName) > -1);
-
+      this.dataSource = this.data.filter((item) => item.label.indexOf(this.appName) > -1);
     },
     handleCancel() {
       this.$emit('close');
@@ -93,11 +92,11 @@ export default {
     handleSubmit() {
       // 获取全选和半选的节点
       const checkboxRecords = this.$refs.vxeGrid.getCheckboxRecords(true);
+      const checkboxReserveRecords = this.$refs.vxeGrid.getCheckboxReserveRecords(true);
       const indeterminateRecords = this.$refs.vxeGrid.getCheckboxIndeterminateRecords(true);
-      const totalRecords = [...checkboxRecords, ...indeterminateRecords].filter((item) => item.appId);
+      const totalRecords = [...checkboxRecords, ...checkboxReserveRecords, ...indeterminateRecords].filter((item) => item.appId);
       if (totalRecords.length > 0) {
         this.setLevel(totalRecords);
-
       } else {
         this.$message.warning('请至少选择一个应用功能!');
       }
@@ -129,12 +128,12 @@ export default {
         },
         area: ['800px', '600px']
       });
-    },
+    }
   },
   created() {
     // 查询已被添加为红名单的功能id
     getFunIdsInRedList().then((res) => {
-      this.value = this.getChildKeys(this.data, res.data.content)
+      this.value = this.getChildKeys(this.data, res.data.content);
     });
   },
   mounted() {}

+ 1 - 1
src/pages/list-manage/red-list-manage/component/batch-delete-appfunc.vue

@@ -50,7 +50,7 @@ export default {
         },
         columns: [
           { type: 'seq', width: 60, align: 'center', title: '序号' },
-          { title: '应用功能名称', field: 'label', treeNode: true, align: 'center' }
+          { title: '应用功能名称', field: 'label', treeNode: true, align: 'left', headerAlign: 'center' }
         ]
       }
     };

+ 1 - 1
src/pages/list-manage/red-list-manage/component/batch-setlevel-appfunc.vue

@@ -57,7 +57,7 @@ export default {
         },
         columns: [
           { type: 'seq', width: 60, align: 'center', title: '序号' },
-          { title: '应用功能名称', field: 'label', treeNode: true, align: 'center' }
+          { title: '应用功能名称', field: 'label', treeNode: true, align: 'left', headerAlign: 'center' }
         ]
       }
     };

+ 8 - 9
src/pages/permission-selfhelp-manage/component/basic-form.vue

@@ -547,18 +547,17 @@ export default {
     }
   },
   created() {
-    const { name, idcard, securityOrg, securityOrgName, mobile, id } = this.$store.getters.user;
+    const { name, idcard, securityOrgs, securityOrgName, mobile, id } = this.$store.getters.user;
     if (!this.applyOrdNo) {
       this.sizeForm = {
-        // 流程标题
         flowTitle: '',
-        applicantIdcard: idcard, // 申请人身份证号
-        applicantName: name, // 申请人姓名
-        applicantOrgCode: securityOrg, // 申请人机构代码
-        applicantOrgName: securityOrgName, //申请人机构名称
-        applicantPhoneNo: mobile, // 申请人号码
-        flowContent: '', // 审核内容
-        applyReason: '', // 申请原因
+        applicantIdcard: idcard, 
+        applicantName: name, 
+        applicantOrgCode: securityOrgs[0], 
+        applicantOrgName: securityOrgName, 
+        applicantPhoneNo: mobile,
+        flowContent: '', 
+        applyReason: '', 
         businessCode: '',
         processType: '',
         operateType: '', // 1--保存  2--提交

+ 113 - 111
src/router/lxr_permission.js

@@ -1,45 +1,48 @@
-import router from "@/router/index.js";
-import store from "@/store";
-import NProgress from "nprogress"; // progress bar
-import "./progress.css";
-import {  getUserName } from "@/utils/auth"; // getToken from cookie
-import _ from "lodash";
+import router from '@/router/index.js';
+import store from '@/store';
+import NProgress from 'nprogress'; // progress bar
+import './progress.css';
+import { getUserName } from '@/utils/auth'; // getToken from cookie
+import _ from 'lodash';
 
 const { initSettings, getSetting, getSettings } = window.systemParamsUtils;
 
 NProgress.configure({ showSpinner: false }); // NProgress Configuration
 
 // 合并白名单列表
-const WHITE_LIST = getSetting("WHITE_LIST");
-let whiteList = [ "/auth-redirect"]; // no redirect whitelist
+const WHITE_LIST = getSetting('WHITE_LIST');
+let whiteList = ['/auth-redirect']; // no redirect whitelist
 if (WHITE_LIST instanceof Array) {
-    whiteList = whiteList.concat(WHITE_LIST);
+  whiteList = whiteList.concat(WHITE_LIST);
 }
 
 router.beforeEach((to, from, next) => {
-    NProgress.start(); // start progress bar
-    if (_.isEmpty(getSettings())) {
-        initSettings().then(() => location.reload()); // 如果配置信息为空,则先加载配置信息
-    } else if (_.isEmpty(store.state.user.info) && whiteList.indexOf(to.path) == -1) {
-        checkLogin(to, next); // 检查是否登录
-    } else {
-        next();
-    }
+  NProgress.start(); // start progress bar
+  init(to, next);
 });
 
+async function init(to, next) {
+  if (_.isEmpty(getSettings())) {
+    initSettings().then(() => location.reload()); // 如果配置信息为空,则先加载配置信息
+  } else if (_.isEmpty(store.state.user.info) && whiteList.indexOf(to.path) == -1) {
+    checkLogin(to, next); // 检查是否登录
+  } else {
+    next();
+  }
+}
 
 // permission judge function
 function hasPermission(userPermissions = [], routePermissions = []) {
-    if (routePermissions && routePermissions.length === 0) {
-        return true;
-    }
-    return userPermissions.some(userPermission => {
-        return routePermissions.indexOf(userPermission) >= 0;
-    });
+  if (routePermissions && routePermissions.length === 0) {
+    return true;
+  }
+  return userPermissions.some(userPermission => {
+    return routePermissions.indexOf(userPermission) >= 0;
+  });
 }
 
 router.afterEach(() => {
-    NProgress.done(); // finish progress bar
+  NProgress.done(); // finish progress bar
 });
 
 /**
@@ -49,14 +52,13 @@ router.afterEach(() => {
  * @param next
  */
 function noNeedLogin(to, from, next) {
-    if (store.getters.addRouters.length === 0) {
-        generateRoutes([], next, to);
-    } else {
-        next();
-    }
+  if (store.getters.addRouters.length === 0) {
+    generateRoutes([], next, to);
+  } else {
+    next();
+  }
 }
 
-
 /**
  * 检查是否在白名单中,进行页面跳转
  * @param to
@@ -64,18 +66,18 @@ function noNeedLogin(to, from, next) {
  * @param link
  */
 function checkIsInWhiteList(to, next, link, result) {
-    if (whiteList.indexOf(to.path) !== -1) {
-        next(); // 在免登录白名单,直接进入
-    } else if (result instanceof Promise) {
-        result.then(result => {
-            if (result && result.status === 403 && result.link) {
-                console.error("oauth2验证不通过,将跳转到登录页");
-            }
-        });
-    } else {
-        !link && next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
-        NProgress.done(); // if current page is login will not trigger afterEach hook, so manually handle it
-    }
+  if (whiteList.indexOf(to.path) !== -1) {
+    next(); // 在免登录白名单,直接进入
+  } else if (result instanceof Promise) {
+    result.then(result => {
+      if (result && result.status === 403 && result.link) {
+        console.error('oauth2验证不通过,将跳转到登录页');
+      }
+    });
+  } else {
+    !link && next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
+    NProgress.done(); // if current page is login will not trigger afterEach hook, so manually handle it
+  }
 }
 
 /**
@@ -85,83 +87,83 @@ function checkIsInWhiteList(to, next, link, result) {
  * @param to
  */
 function generateRoutes(permissions, next, to) {
-    store.dispatch("GenerateRoutes", { permissions }).then(() => {
-        // 根据权限生成可访问的路由表
-        router.addRoutes(store.getters.addRouters); // 动态添加可访问路由表
+  store.dispatch('GenerateRoutes', { permissions }).then(() => {
+    // 根据权限生成可访问的路由表
+    router.addRoutes(store.getters.addRouters); // 动态添加可访问路由表
 
-        if (hasPermission(store.getters.permissions, to.meta.permission)) {
-            next({ ...to, replace: true });
-        } else {
-            next({
-                path: "/",
-                replace: true
-            });
-        }
-        // next({ ...to, replace: true }); // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
-    });
+    if (hasPermission(store.getters.permissions, to.meta.permission)) {
+      next({ ...to, replace: true });
+    } else {
+      next({
+        path: '/',
+        replace: true
+      });
+    }
+    // next({ ...to, replace: true }); // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
+  });
 }
 
 function checkLogin(to, next) {
-    console.log(getUserName());
-    if (getUserName()) {
-        if (to.path === "/login") {
-            next({ path: "/" });
-            NProgress.done(); // if current page is dashboard will not trigger	afterEach hook, so manually handle it
-        } else {
-            let permissionsLength = store.getters.permissions.length;
-            if (!store.getters.name && !permissionsLength) {
-                try {
-                    // 获取用户信息
-                    // await ;
-                    store.dispatch("GetUserInfo").then(() => {
-                        let permissions = store.getters.permissions;
-                        generateRoutes(permissions, next, to);
-                    });
-                } catch (err) {
-                    store.dispatch("FedLogout").then(() => {
-                        if (!err.link) {
-                            next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
-                        } else {
-                            next({ path: "/" });
-                        }
-                    });
-                    // await store.dispatch("FedLogout")   // 如果获取用户信息失败,则将本地的用户信息相关的东西清空,并登出
-                    // if (!err.link) {
-                    //     next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
-                    // } else {
-                    //     next({ path: "/" });
-                    // }
-                }
+  console.log(getUserName());
+  if (getUserName()) {
+    if (to.path === '/login') {
+      next({ path: '/' });
+      NProgress.done(); // if current page is dashboard will not trigger	afterEach hook, so manually handle it
+    } else {
+      let permissionsLength = store.getters.permissions.length;
+      if (!store.getters.name && !permissionsLength) {
+        try {
+          // 获取用户信息
+          // await ;
+          store.dispatch('GetUserInfo').then(() => {
+            let permissions = store.getters.permissions;
+            generateRoutes(permissions, next, to);
+          });
+        } catch (err) {
+          store.dispatch('FedLogout').then(() => {
+            if (!err.link) {
+              next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
             } else {
-                // 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
-                // if (hasPermission(store.getters.roles, to.meta.roles)) {
-                next();
-                // } else {
-                //     next({
-                //         path: "/401",
-                //         replace: true,
-                //         query: { noGoBack: true }
-                //     });
-                // }
-                // 可删 ↑
+              next({ path: '/' });
             }
+          });
+          // await store.dispatch("FedLogout")   // 如果获取用户信息失败,则将本地的用户信息相关的东西清空,并登出
+          // if (!err.link) {
+          //     next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
+          // } else {
+          //     next({ path: "/" });
+          // }
         }
+      } else {
+        // 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
+        // if (hasPermission(store.getters.roles, to.meta.roles)) {
+        next();
+        // } else {
+        //     next({
+        //         path: "/401",
+        //         replace: true,
+        //         query: { noGoBack: true }
+        //     });
+        // }
+        // 可删 ↑
+      }
+    }
+  } else {
+    if (getSetting('BASE_API') === '/easy-mock') {
+      checkIsInWhiteList(to, next); // 检查是否在白名单中
     } else {
-        if (getSetting("BASE_API") === "/easy-mock") {
-            checkIsInWhiteList(to, next); // 检查是否在白名单中
-        } else {
-            try {
-                store.dispatch("GetUserInfo").then(() => {
-                    window.location.reload();
-                });
-                // await store.dispatch("GetUserInfo")
-                // window.location.reload();
-            } catch (result) {
-                let link;
-                result && (link = result.link);
+      try {
+        store.dispatch('GetUserInfo').then(() => {
+          window.location.reload();
+        });
+        // await store.dispatch("GetUserInfo")
+        // window.location.reload();
+      } catch (result) {
+        let link;
+        result && (link = result.link);
 
-                checkIsInWhiteList(to, next, link, result); // 检查是否在白名单中
-            }
-        }
+        checkIsInWhiteList(to, next, link, result); // 检查是否在白名单中
+      }
     }
+  }
 }

+ 60 - 56
src/store/modules/app.js

@@ -1,65 +1,69 @@
-import Cookies from "js-cookie";
+import Cookies from 'js-cookie';
 
 const app = {
-    state: {
-        sidebar: {
-            opened: Cookies.get("sidebarStatus") ? !!+Cookies.get("sidebarStatus") : true,
-            withoutAnimation: false
-        },
-        device: "desktop",
-        language: Cookies.get("language") || "zh",
-        size: Cookies.get("size") || "medium"
+  state: {
+    sidebar: {
+      opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
+      withoutAnimation: false
     },
-    mutations: {
-        TOGGLE_SIDEBAR: state => {
-            state.sidebar.opened = !state.sidebar.opened;
-            state.sidebar.withoutAnimation = false;
-            if (state.sidebar.opened) {
-                Cookies.set("sidebarStatus", 1);
-            } else {
-                Cookies.set("sidebarStatus", 0);
-            }
-        },
-        CLOSE_SIDEBAR: (state, withoutAnimation) => {
-            Cookies.set("sidebarStatus", 0);
-            state.sidebar.opened = false;
-            state.sidebar.withoutAnimation = withoutAnimation;
-        },
-        TOGGLE_DEVICE: (state, device) => {
-            state.device = device;
-        },
-        SET_LANGUAGE: (state, language) => {
-            state.language = language;
-            Cookies.set("language", language);
-        },
-        SET_SIZE: (state, size) => {
-            state.size = size;
-            Cookies.set("size", size);
-        }
+    device: 'desktop',
+    language: Cookies.get('language') || 'zh',
+    size: Cookies.get('size') || 'medium',
+    ip: ''
+  },
+  mutations: {
+    TOGGLE_SIDEBAR: state => {
+      state.sidebar.opened = !state.sidebar.opened;
+      state.sidebar.withoutAnimation = false;
+      if (state.sidebar.opened) {
+        Cookies.set('sidebarStatus', 1);
+      } else {
+        Cookies.set('sidebarStatus', 0);
+      }
     },
-    actions: {
-        toggleSideBar({ commit }) {
-            commit("TOGGLE_SIDEBAR");
-        },
-        closeSideBar({ commit }, { withoutAnimation }) {
-            commit("CLOSE_SIDEBAR", withoutAnimation);
-        },
-        toggleDevice({ commit }, device) {
-            commit("TOGGLE_DEVICE", device);
-        },
-        setLanguage({ commit }, language) {
-            commit("SET_LANGUAGE", language);
-        },
-        setSize({ commit }, size) {
-            commit("SET_SIZE", size);
-        }
+    CLOSE_SIDEBAR: (state, withoutAnimation) => {
+      Cookies.set('sidebarStatus', 0);
+      state.sidebar.opened = false;
+      state.sidebar.withoutAnimation = withoutAnimation;
     },
-    getters: {
-        sidebar: state => state.sidebar,
-        language: state => state.language,
-        size: state => state.size,
-        device: state => state.device
+    TOGGLE_DEVICE: (state, device) => {
+      state.device = device;
+    },
+    SET_LANGUAGE: (state, language) => {
+      state.language = language;
+      Cookies.set('language', language);
+    },
+    SET_SIZE: (state, size) => {
+      state.size = size;
+      Cookies.set('size', size);
+    },
+    SET_IP: (state, ip) => {
+      state.ip = ip;
+    }
+  },
+  actions: {
+    toggleSideBar({ commit }) {
+      commit('TOGGLE_SIDEBAR');
+    },
+    closeSideBar({ commit }, { withoutAnimation }) {
+      commit('CLOSE_SIDEBAR', withoutAnimation);
+    },
+    toggleDevice({ commit }, device) {
+      commit('TOGGLE_DEVICE', device);
+    },
+    setLanguage({ commit }, language) {
+      commit('SET_LANGUAGE', language);
+    },
+    setSize({ commit }, size) {
+      commit('SET_SIZE', size);
     }
+  },
+  getters: {
+    sidebar: state => state.sidebar,
+    language: state => state.language,
+    size: state => state.size,
+    device: state => state.device
+  }
 };
 
 export default app;

+ 144 - 151
src/utils/req.js

@@ -1,181 +1,174 @@
-import request from "./request";
-import { Loading } from "element-ui";
-import Qs from "qs";
-import Cookies from "js-cookie";
 
-
-/*
-    reponse
-    {
-        content: any
-        reulst: '状态码',
-        msg: '消息'
-    }
-*/
+import request from './request';
+import { Loading } from 'element-ui';
+import Qs from 'qs';
+import Cookies from 'js-cookie';
 
 // 兼容finally
 if (!Promise.finally) {
-    Promise.prototype.finally = function(callback) {
-        const P = this.constructor;
-        return this.then(
-            value => P.resolve(callback()).then(() => value),
-            reason =>
-                P.resolve(callback()).then(() => {
-                    throw reason;
-                })
-        );
-    };
+  Promise.prototype.finally = function(callback) {
+    const P = this.constructor;
+    return this.then(
+      value => P.resolve(callback()).then(() => value),
+      reason =>
+        P.resolve(callback()).then(() => {
+          throw reason;
+        })
+    );
+  };
 }
 
-const isSuccess = val => val === 200 || val === "200";
+const isSuccess = val => val === 200 || val === '200';
 
 function showLoding(bool = false) {
-    if (!bool) {
-        return null;
-    }
-    return Loading.service({
-        lock: true,
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.8)",
-        fullscreen: true,
-        text: "数据加载中..."
-    });
+  if (!bool) {
+    return null;
+  }
+  return Loading.service({
+    lock: true,
+    spinner: 'el-icon-loading',
+    background: 'rgba(0, 0, 0, 0.8)',
+    fullscreen: true,
+    text: '数据加载中...'
+  });
 }
 
 function hideLoading(loading) {
-    loading.close();
+  loading.close();
 }
 
 const axiosConfig = {
-    headers: { userToken: Cookies.get('_idp_session') || 'testUserToken' }
+  headers: { 
+      userToken: Cookies.get('_idp_session') || null
+     }
 };
 
 const axios = {
-    request(option = {}) {
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .request(option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    if (isSuccess(data.result)) {
-                        resolve(data.content);
-                    }
-                    reject(data.msg);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
+  request(option = {}) {
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .request(option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          if (isSuccess(data.result)) {
+            resolve(data.content);
+          }
+          reject(data.msg);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
+        });
+    });
+  },
+  getBu(url, params, option = {}) {
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .get(url, { params }, option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          resolve(data);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
         });
-    },
-    getBu(url, params, option = {}) {
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .get(url, { params }, option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    resolve(data);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
+    });
+  },
+  get(url, params, option = {}) {
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .get(url, { params }, option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          if (isSuccess(data.result)) {
+            resolve(data.content);
+          }
+          reject(data.msg);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
         });
-    },
-    get(url, params, option = {}) {
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .get(url, { params }, option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    if (isSuccess(data.result)) {
-                        resolve(data.content);
-                    }
-                    reject(data.msg);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
+    });
+  },
+  post(url, params, option = {}) {
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .post(url, params, option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          if (isSuccess(data.result)) {
+            resolve(data.content);
+          }
+          reject(data.msg);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
         });
-    },
-    post(url, params, option = {}) {
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .post(url, params, option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    if (isSuccess(data.result)) {
-                        resolve(data.content);
-                    }
-                    reject(data.msg);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
+    });
+  },
+  put(url, params, option = {}) {
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .put(url, params, option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          if (isSuccess(data.result)) {
+            resolve(data.content);
+          }
+          reject(data.msg);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
         });
-    },
-    put(url, params, option = {}) {
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .put(url, params, option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    if (isSuccess(data.result)) {
-                        resolve(data.content);
-                    }
-                    reject(data.msg);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
+    });
+  },
+  delete(url, params, option = {}) {
+    option.params = params;
+    return new Promise((resolve, reject) => {
+      const loading = showLoding(option.loading);
+      request
+        .delete(url, option, { ...axiosConfig })
+        .then(({ data = {} }) => {
+          if (isSuccess(data.result)) {
+            resolve(data.content);
+          }
+          reject(data.msg);
+        })
+        .catch(error => reject(error))
+        .finally(() => {
+          loading && hideLoading(loading);
         });
-    },
-    delete(url, params, option = {}) {
+    });
+  },
+  arraybuffer(url, params, option = {}) {
+    option.url = url;
+    option.method = (option.method || 'get').toLocaleLowerCase();
+    // option.headers = { 'Content-Type': 'application/json,charset=utf-8' };
+    option.responseType = 'arraybuffer';
+    switch (option.method) {
+      case 'get':
+      case 'delete':
         option.params = params;
-        return new Promise((resolve, reject) => {
-            const loading = showLoding(option.loading);
-            request
-                .delete(url, option, { ...axiosConfig })
-                .then(({ data = {} }) => {
-                    if (isSuccess(data.result)) {
-                        resolve(data.content);
-                    }
-                    reject(data.msg);
-                })
-                .catch(error => reject(error))
-                .finally(() => {
-                    loading && hideLoading(loading);
-                });
-        });
-    },
-    arraybuffer(url, params, option = {}) {
-        option.url = url;
-        option.method = (option.method || "get").toLocaleLowerCase();
-        // option.headers = { 'Content-Type': 'application/json,charset=utf-8' };
-        option.responseType = "arraybuffer";
-        switch (option.method) {
-            case "get":
-            case "delete":
-                option.params = params;
-                break;
-            default:
-                option.data = Qs.stringify(params);
-                break;
-        }
-        return request.request(option);
+        break;
+      default:
+        option.data = Qs.stringify(params);
+        break;
     }
+    return request.request(option);
+  }
 };
 
 export default axios;
 
 export const restApi = (base, option = {}) => ({
-    base,
-    table: `${base}s`,
-    detail: id => axios.get(`${base}/${id}`, null, option, { ...axiosConfig }),
-    save: data => axios.post(base, data, option, { ...axiosConfig }),
-    update: data => axios.put(`${base}/${data.id}`, data, option, { ...axiosConfig }),
-    del: id => axios.delete(`${base}/${id}`, null, option, { ...axiosConfig })
+  base,
+  table: `${base}s`,
+  detail: id => axios.get(`${base}/${id}`, null, option, { ...axiosConfig }),
+  save: data => axios.post(base, data, option, { ...axiosConfig }),
+  update: data => axios.put(`${base}/${data.id}`, data, option, { ...axiosConfig }),
+  del: id => axios.delete(`${base}/${id}`, null, option, { ...axiosConfig })
 });

+ 0 - 2
src/utils/request-base.js

@@ -2,7 +2,6 @@ import axios from "axios";
 import { Loading } from "element-ui";
 import Cookies from "js-cookie";
 const { getSetting } = window.systemParamsUtils;
-
 console.log("BASE_API:" + getSetting("BASE_API"));
 let loadingMap = {};
 let loadingShow = function(config) {
@@ -30,7 +29,6 @@ const service = axios.create({
     baseURL: getSetting("BASE_API"), // api 的 base_url
     timeout: getSetting("REQ_TIMEOUT") || 5000 // request timeout
 });
-
 // request interceptor
 service.interceptors.request.use(
     config => {

+ 2 - 2
static/themes/style/theme-default.css

@@ -19453,7 +19453,7 @@ html {
     transition: width 0.28s;
     -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-    width: 13rem;
+    width: 17rem;
 }
 .l-sidebar__header {
     width: 100%;
@@ -19578,7 +19578,7 @@ html {
 .l-main-container {
     position: relative;
     height: 100%;
-    margin-left: 13rem;
+    margin-left: 17rem;
     -webkit-transition: margin-left 0.28s;
     transition: margin-left 0.28s;
 }