3 Ревизии 01633e8655 ... ca2871c1e1

Автор SHA1 Съобщение Дата
  armg ca2871c1e1 Merge branch 'master' into dev-cym преди 2 седмици
  armg ea0384382c 缓存weChat преди 2 седмици
  armg 8c204a0dc7 处理weChat преди 2 седмици
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/router/index.ts

+ 3 - 1
src/router/index.ts

@@ -108,6 +108,9 @@ router.beforeEach(async (to, from, next) => {
     // 判断当前登录模式,分发处理逻辑
     const isNewLoginMode = sessionStorage.getItem('isNewLoginMode') === 'true';
     if (isNewLoginMode) {
+      if(wxid){
+        window.localStorage.setItem('weChat', wxid);
+      }
       await handleWxidLoginMode(to, next, wxid, WecomType);
     } else {
       await handleCodeLoginMode(to, next);
@@ -138,7 +141,6 @@ async function handleWxidLoginMode(to, next, wxid, WecomType) {
     // 4. wxid参数校验
     let wxId = wxid ? wxid : window.localStorage.getItem("weChat");
     if (!wxId) return redirectToError(next, "wxid参数缺失,无权限");
-    window.localStorage.setItem('weChat', wxId);
     const formData = new FormData();
     const timestamp = new Date().getTime().toString();
     const nonce = getGuid();