zhujindu 7 mesiacov pred
rodič
commit
a8a8b59c2f

+ 40 - 31
public/index.html

@@ -1,38 +1,47 @@
 <!DOCTYPE html>
 <html lang="">
-<head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta
-            name="viewport"
-            content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
-    />
-    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+      name="viewport"
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
     <title><%= webpackConfig.name %></title>
-</head>
-<body class="bgcolor">
-<noscript>
-    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-</noscript>
-<div id="app"></div>
-<script>
-    if (GetQueryValue("loginName") != null) {
-        localStorage.removeItem('loginType')
-        localStorage.setItem('loginName', GetQueryValue("loginName"));
-        location.href=location.href.split("?")[0]+"?v="+new Date().getTime();
-    }
-    function GetQueryValue(queryName) {
+  </head>
+  <body class="bgcolor">
+    <noscript>
+      <strong
+        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without
+        JavaScript enabled. Please enable it to continue.</strong
+      >
+    </noscript>
+    <div id="app"></div>
+    <script>
+      //   if (GetQueryValue('loginName') != null) {
+      //     localStorage.removeItem('loginType');
+      //     localStorage.setItem('loginName', GetQueryValue('loginName'));
+      //     let href = location.href.split('?');
+      //     location.href = href[0] + '?v=' + new Date().getTime() + '&' + href[1];
+      //   }
+      function GetQueryValue(queryName) {
         var query = decodeURI(window.location.search.substring(1));
-        var vars = query.split("&");
-        for (var i = 0; i < vars.length; i++) {var pair = vars[i].split("=");if (pair[0] == queryName) {return pair[1];}}
+        var vars = query.split('&');
+        for (var i = 0; i < vars.length; i++) {
+          var pair = vars[i].split('=');
+          if (pair[0] == queryName) {
+            return pair[1];
+          }
+        }
         return null;
-    }
-</script>
-<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
-<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
-<!--生产、uat-->
-<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service,tools&key=Y7SBZ-PI5K5-FOJIT-ILHLY-PN66T-HKB4A"></script>
-</body>
+      }
+    </script>
+    <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
+    <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
+    <!--生产、uat-->
+    <script
+      charset="utf-8"
+      src="https://map.qq.com/api/gljs?v=1.exp&libraries=service,tools&key=Y7SBZ-PI5K5-FOJIT-ILHLY-PN66T-HKB4A"></script>
+  </body>
 </html>
-

+ 4 - 0
src/permission.js

@@ -4,6 +4,10 @@ import store from './store';
 const whiteList = ['/login', '/auth-redirect', '/bind', '/register'];
 
 router.beforeEach((to, from, next) => {
+  let queryLoginName = to.query.loginName || null;
+  if (queryLoginName) {
+    localStorage.setItem('loginName', queryLoginName);
+  }
   const username = localStorage.getItem('loginName');
   if (username) {
     /* has token*/

+ 18 - 20
src/views/week/dailyHistoricalDetails.vue

@@ -806,9 +806,21 @@ export default {
         message: '加载中...',
         forbidClick: true,
       });
-      getDetailById({ reportId: this.$route.query.reportId })
-        .then((res) => {
-          loading1.clear();
+      getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
+        loading1.clear();
+        if (res.code == 500 && this.source == 'share') {
+          this.$dialog
+            .confirm({
+              title: '系统提示',
+              message: res.msg,
+              showCancelButton: false,
+            })
+            .then(() => {
+              this.$router.replace({
+                path: '/home',
+              });
+            });
+        } else {
           this.GZQuota = false;
           this.JZQuota = false;
           this.YFQuota = res.data.postType == 'YF' ? true : false;
@@ -854,22 +866,8 @@ export default {
             }
           }
           this.imgList = imgList;
-        })
-        .catch((err) => {
-          if (err.code == 500 && this.source == 'share') {
-            this.$dialog
-              .confirm({
-                title: '系统提示',
-                message: '没有权限',
-                showCancelButton: false,
-              })
-              .then(() => {
-                this.$router.push({
-                  path: '/home',
-                });
-              });
-          }
-        });
+        }
+      });
     },
     userTodayPlanNum() {
       userTodayPlanNum().then((res) => {
@@ -885,7 +883,7 @@ export default {
     },
     onClickLeft() {
       if (this.source == 'share') {
-        this.$router.push({
+        this.$router.replace({
           path: '/subordinateHistoricalDaily',
         });
       } else {