Browse Source

无权限时传参处理

cxmo 1 year ago
parent
commit
905501c440

+ 3 - 3
src/views/hzyb/forexCalendar/Index.vue

@@ -111,12 +111,12 @@ function getPermissionList(){
             hasAuth.value = false
             noAuth.value = res.data
             //将无权限信息传到transIndex,transIndex显示无权限
-            window.parent.postMessage({
+            window.parent.postMessage(JSON.stringify({
                 path:'/hzyb/forex/noauth',
                 query:{
-                    noAuth:noAuth.value
+                   noAuth:noAuth.value
                 }
-            },'*')
+            }),'*')
         }
     })
 }

+ 1 - 1
src/views/hzyb/forexCalendar/components/NoAuth.vue

@@ -104,7 +104,7 @@ const goBack=()=>{
     </block>
 
     <block v-if="authType == 3">
-      <div style="margin-bottom: 15px">您暂无权限查看图库</div>
+      <div style="margin-bottom: 15px">您暂无权限查看事件日历</div>
       <div>若想查看可以申请开通</div>
       <div class="global-btn-yellow-change btn" style="margin-top: 30px" @click="handleApply">立即申请</div>
     </block>

+ 6 - 1
src/views/hzyb/forexCalendar/transIndex.vue

@@ -41,7 +41,12 @@ const forceLandscape = (id = '.iframe-class') => {
 };
 const router = useRouter()
 function changeRoute(msg){
-    const {path,query} = msg.data
+    let path='',query=''
+    if(typeof msg.data === 'string'){
+        const data = JSON.parse(msg.data)
+        path = data.path||''
+        query = data.query||''
+    }
     if(!path||!query) return //vue-devtools也会发message
     if(path.includes('noauth')){
         noAuth.value = query.noAuth