lanan-repair-app/pages/index/index.vue
2024-10-25 18:52:01 +08:00

46 lines
752 B
Vue

<template>
<view class="content">
</view>
</template>
<script>
import {getToken,getUserInfo} from "@/utils/auth";
export default {
data() {
return {
}
},
onLoad() {
if(getToken()){
//跳转首页
//判断是否是仓管,仓管需要跳单独的首页
let userInfo = getUserInfo()
if(userInfo.roleCodes.includes('repair_warehouse')){
//仓管
uni.navigateTo({
url: '/pages-warehouse/home/home'
})
}else{
uni.navigateTo({
url: '/pages-home/home/home'
})
}
}else{
uni.navigateTo({
url: '/pages/login/login'
})
}
},
methods: {
}
}
</script>
<style>
</style>