libushang 1 هفته پیش
والد
کامیت
f5e8453dbe
8فایلهای تغییر یافته به همراه19 افزوده شده و 14 حذف شده
  1. 1 1
      .env.development
  2. 2 0
      .env.production
  3. 2 2
      index.html
  4. 7 0
      public/static/eruda.js
  5. 0 0
      public/static/h5player.min.js
  6. 1 1
      src/components/YzyCallback/index.vue
  7. 6 9
      src/permission.ts
  8. 0 1
      src/views/signPage/index.vue

+ 1 - 1
.env.development

@@ -12,7 +12,7 @@ VITE_BASE_DOWNLOAD_API = '/file/download/'
 #VITE_BASE_API = 'http://127.0.0.1:9988'
 
 # 开发环境启用 cdn eruda 调试工具。若不启用,将 true 修改为 false 或其他任意值即可
-VITE_ENABLE_ERUDA = "false"
+VITE_ENABLE_ERUDA = "true"
 
 # 线上环境平台打包路径
 VITE_PUBLIC_PATH = /yjxp/

+ 2 - 0
.env.production

@@ -10,6 +10,8 @@ VITE_APP_BASE_API2 = '/'
 VITE_BASE_API = ""
 VITE_BASE_DOWNLOAD_API = '/file/download/'
 
+VITE_ENABLE_ERUDA = "true"
+
 # 线上环境平台打包路径
 VITE_PUBLIC_PATH = "/yjxp/"
 

+ 2 - 2
index.html

@@ -8,7 +8,7 @@
       content="width=device-width,initial-scale=1.0,user-scalable=no"
     />
     <link rel="icon" href="/favicon.ico" />
-    <script src="/h5player.min.js"></script>
+    <script src="/static/h5player.min.js"></script>
     <!-- script src="/static/szca_crypto.js"></script -->
     <!-- script src="/static/szca_base64.js"></script -->
     <title>应急工作台移动端</title>
@@ -55,7 +55,7 @@
     </div>
     <script type="module" src="/src/main.ts"></script>
     <% if (ENABLE_ERUDA === "true") { %>
-    <script src="//cdn.jsdelivr.net/npm/eruda"></script>
+    <script src="/static/eruda.js"></script>
     <script>
       eruda.init();
     </script>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 7 - 0
public/static/eruda.js


+ 0 - 0
public/h5player.min.js → public/static/h5player.min.js


+ 1 - 1
src/components/YzyCallback/index.vue

@@ -20,7 +20,7 @@ const do_callback = () => {
   callback({code, state}).then((res)=>{
       loading.value = false;
       var access_token = res.data.access_token;
-      var redirect_url = res.data.redirect_url;
+      var redirect_url = sessionStorage.getItem(state) || "/";
       setToken(access_token);
       
       console.log('redirect_url:', redirect_url);

+ 6 - 9
src/permission.ts

@@ -68,18 +68,15 @@ router.beforeEach(async (to, from, next) => {
         next(`/mplogin?redirect=${redirect}`); // 否则全部重定向到登录页
         NProgress.done();
       }
-      /*
       else if (/(wxworklocal)/i.test(navigator.userAgent)) {
-        let state_json = {
-          "redirect_url": to.fullPath || '/',
-          "rnd": Math.floor(Math.random() * 1000000)
-        };
-        const state = JSON.stringify(state_json);
-        let redirect_uri = encodeURIComponent(window.location.protocol + "//" + window.location.host + "/yjxp/#/yzy/callback")
-        let next_url = `https://open.weixin.qq.com/connect/Oauth2/authorize?appid=wld341060039&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&agentid=1004302&state=${state}#wechat_redirect`;
+
+        const rnd = Math.floor(Math.random() * 900000) + 100000;
+        const state = `F${rnd}`;
+        const redirect_uri = encodeURIComponent(window.location.protocol + "//" + window.location.host + "/api/yzy/callback.html")
+        let next_url = `https://open.weixin.qq.com/connect/Oauth2/authorize?appid=wl2bee594e73&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&agentid=1004000&state=${state}#wechat_redirect`;
+        sessionStorage.setItem(state, to.fullPath || '/');
         window.location.href = next_url; // 粤政易自动登录
       }
-      */
       else {
         const redirect = encodeURIComponent(to.fullPath || '/');
         next(`/login?redirect=${redirect}`); // 否则全部重定向到登录页

+ 0 - 1
src/views/signPage/index.vue

@@ -1,4 +1,3 @@
-<script src="../../api/event.ts"></script>
 <template>
   <div class="container">
     <div style="padding: 16px 0 ;display:flex;flex-direction: row;justify-content: space-between;" v-if="type === '2'">

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است