Browse Source

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

gez 1 day ago
parent
commit
87306920cb
2 changed files with 31 additions and 4 deletions
  1. 12 0
      src/pages/common/webview/index.vue
  2. 19 4
      src/pages/index.vue

+ 12 - 0
src/pages/common/webview/index.vue

@@ -5,6 +5,9 @@
         <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
         <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
       </view>
       </view>
     </template>
     </template>
+    <template #center>
+      <view class="u-navbar__content__left__item" style="color:#fff">{{ state.title }}</view>
+    </template>
   </u-navbar>
   </u-navbar>
   <view v-if="params.url">
   <view v-if="params.url">
     <web-view :webview-styles="webviewStyles" :src="`${params.url}`" allow></web-view>
     <web-view :webview-styles="webviewStyles" :src="`${params.url}`" allow></web-view>
@@ -39,12 +42,21 @@ const state = reactive({
       color: "#FF3333",
       color: "#FF3333",
     },
     },
   },
   },
+  // title:undefined
 });
 });
 
 
 const { params, webviewStyles } = toRefs(state);
 const { params, webviewStyles } = toRefs(state);
 
 
 onLoad((event) => {
 onLoad((event) => {
   params.value = event;
   params.value = event;
+  console.log(params._object.params.url)
+  if(params._object.params.url.indexOf('login?token=') > 0){
+    var name = '智慧办公系统(U8)'
+    wx.setNavigationBarTitle({
+      title: name
+    });
+  }
+  state.title = name;
 });
 });
 
 
 onShow(() => {
 onShow(() => {

+ 19 - 4
src/pages/index.vue

@@ -109,7 +109,7 @@ import * as jwx from "@/utils/jssdk.js"; //引入js sdk的封装
 import { getToken, setToken, removeToken } from "@/utils/auth";
 import { getToken, setToken, removeToken } from "@/utils/auth";
 import { storage, storageSystem } from "@/utils/storage"; // 公共方法引用
 import { storage, storageSystem } from "@/utils/storage"; // 公共方法引用
 import { getTenantByUser } from "@/api/system/user.js";
 import { getTenantByUser } from "@/api/system/user.js";
-import { decrypt } from "@/plugins/jsencrypt";
+import { decrypt, encrypt } from "@/plugins/jsencrypt";
 /*----------------------------------公共变量-----------------------------------*/
 /*----------------------------------公共变量-----------------------------------*/
 const { proxy } = getCurrentInstance();
 const { proxy } = getCurrentInstance();
 const useStore = useStores();
 const useStore = useStores();
@@ -276,9 +276,24 @@ function navItemClick(item) {
     storageSystem.set("homeList", state);
     storageSystem.set("homeList", state);
 
 
     if (item.path.indexOf("http") != -1) {
     if (item.path.indexOf("http") != -1) {
-      uni.navigateTo({
-        url: "/pages/common/webview/index?url=" + item.path,
-      });
+      if(item.path.indexOf("token") > 0){
+        var name = JSON.parse(localStorage.getItem("storage_data"))?.data?.name
+        if(name){
+          var params = {
+              user:name,
+              time:new Date().getTime(),
+              form:"SAAS_MOB"
+          }
+          var jm = encrypt(JSON.stringify(params))
+          uni.navigateTo({
+            url: `/pages/common/webview/index?url=${item.path}=${encodeURIComponent(jm)}`,
+          });
+        }else{
+          uni.navigateTo({
+            url: "/pages/common/webview/index?url=" + item.path,
+          });
+        }
+      }
     } else {
     } else {
       uni.navigateTo({
       uni.navigateTo({
         url: item.path,
         url: item.path,