修复路由bug

This commit is contained in:
weipengfei 2023-08-11 09:12:18 +08:00
parent effded7ac0
commit cc827a5c09
2 changed files with 598 additions and 594 deletions

View File

@ -9,8 +9,8 @@
<!-- #endif -->
<view class="my_info flex_a_c">
<view class="">
<u--image :showLoading="true" :src="myOaInfo.avatar||'../../static/img/public/avatar.png'"
width="130.28rpx" height="130.28rpx" shape="circle"></u--image>
<u--image :showLoading="true" :src="myOaInfo.avatar||'../../static/img/public/avatar.png'" width="130.28rpx"
height="130.28rpx" shape="circle"></u--image>
</view>
<view v-if="!$store.state.app.token" @click="login" class="mesg_box">
<view class="name">
@ -49,8 +49,7 @@
<view class="backlog" :class="!ApproveList.length>0?'backlog_no_data':''">
<view class="head_title flex_a_c_j_sb">
<view class="title">公告列表</view>
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')">更多 <view
class="iconfont icon-you">
<view class="flex_a_c" @click="navTo('/subpkg/noticeList/noticeList')">更多 <view class="iconfont icon-you">
<uni-icons type="forward"></uni-icons>
</view>
</view>

View File

@ -7,10 +7,15 @@ const whiteList = ['/','/pages/oaHome/oaHome', '/pages/oaExamine/oaExamine', '/p
]
const hasPermission = (url) => {
if (whiteList.indexOf(url) !== -1 || uni.getStorageSync("TOKEN")) {
try{
if (whiteList.indexOf(url) !== -1 || whiteList.indexOf(url.split('?')[0]) || uni.getStorageSync("TOKEN")) {
return true;
}
return false;
}catch(e){
console.log(e);
return false;
}
}
const initRouter = () => {