Browse Source

Merge branch 'ming' of uskycloud/usky-web-mobile into master

gez 5 months ago
parent
commit
c903b13869
3 changed files with 32 additions and 7 deletions
  1. 2 1
      src/manifest.json
  2. 17 4
      src/pages/login.vue
  3. 13 2
      src/store/modules/setting.js

+ 2 - 1
src/manifest.json

@@ -190,7 +190,8 @@
             "urlCheck" : false,
             "checkSiteMap" : false
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+        "navigateToMiniProgramAppIdList":["wxf5ad8734295d43f8"]
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 17 - 4
src/pages/login.vue

@@ -301,10 +301,23 @@ onShow(() => {
 });
 
 onLoad((options) => {
-  if(options.xcx){
-    state.xcxData=decrypt(decodeURIComponent(options.xcx))
-    login(state.xcxData)
-  }
+  // console.log(linkUrl.value)
+  console.log('options')
+  console.log(options)
+
+  if(options.dataToken){
+      localStorage.setItem("App-Token", options.dataToken)
+      localStorage.setItem("type", 'innerH5')
+      useStore.GetInfo()
+      proxy.$tab.reLaunch("/pages/index");
+
+      // window.location.href = `${linkUrl.value}pages/index`;
+    }
+
+  // if(options.xcx){
+  //   state.xcxData=decrypt(decodeURIComponent(options.xcx))
+  //   login(state.xcxData)
+  // }
 });
 </script>
 

+ 13 - 2
src/store/modules/setting.js

@@ -2,6 +2,7 @@ import { defineStore } from "pinia";
 import { useStores } from "@/store/modules/index";
 import { storage, storageSystem } from "@/utils/storage";
 import { getToken, setToken, removeToken } from "@/utils/auth";
+import wx from 'weixin-js-sdk'
 // 接口引用
 import { uploadAvatar, updateUserProfile } from "@/api/system/user";
 import { baseAppInfoApi } from "@/api/common/index";
@@ -359,10 +360,20 @@ const settingStores = defineStore("storage-setting", {
             const useStore = useStores();
             modal.confirm("确定注销并退出系统吗?").then(() => {
                 useStore.LogOut().then(() => {
-                    tab.reLaunch("/pages/index");
+                   
+                    if(localStorage.getItem("type")) {
+                        console.log('内嵌h5')
+                        wx.miniProgram.navigateTo({
+                            appId:'wxf5ad8734295d43f8',
+                            url:'/pages/login?type=logout'
+                          })
+                    }  else{
+                        tab.reLaunch("/pages/index");
+                    }                 
+
                 });
             });
-        },
+        },     
         /**
          * @初始化默认主题
          */