46 lines
913 B
Vue
46 lines
913 B
Vue
<script>
|
|
import { isLoggedIn, getRole } from '@/utils/auth'
|
|
|
|
// 需要登录才能访问的页面路径
|
|
const AUTH_PAGES = [
|
|
'pages/points/index',
|
|
'pages/points/detail',
|
|
'pages/mine/index',
|
|
'pages/mine/profile',
|
|
'pages/mine/verify-records',
|
|
'pages/coupon/my-coupons',
|
|
'pages/coupon/store-coupons',
|
|
'pages/merchant/index',
|
|
'pages/merchant/records'
|
|
]
|
|
|
|
/**
|
|
* 路由守卫已禁用,不再自动跳转登录页
|
|
*/
|
|
|
|
export default {
|
|
onLaunch: function() {
|
|
console.log('App Launch')
|
|
// 已登录的商户自动跳转商户端
|
|
if (isLoggedIn() && getRole() === 'merchant') {
|
|
uni.reLaunch({ url: '/pages/merchant/index' })
|
|
}
|
|
},
|
|
onShow: function() {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function() {
|
|
console.log('App Hide')
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/* 全局公共样式 */
|
|
page {
|
|
background-color: #f5f5f5;
|
|
font-size: 28rpx;
|
|
color: #333333;
|
|
}
|
|
</style>
|