初次进入App时进入登录页
This commit is contained in:
parent
0ca2bd20b8
commit
ff1d17eb31
4
App.vue
4
App.vue
@ -13,14 +13,16 @@
|
|||||||
// 初始化应用配置
|
// 初始化应用配置
|
||||||
this.initConfig()
|
this.initConfig()
|
||||||
// 检查用户登录状态
|
// 检查用户登录状态
|
||||||
|
//#ifdef H5
|
||||||
this.checkLogin()
|
this.checkLogin()
|
||||||
|
//#endif
|
||||||
},
|
},
|
||||||
initConfig() {
|
initConfig() {
|
||||||
this.globalData.config = config
|
this.globalData.config = config
|
||||||
},
|
},
|
||||||
checkLogin() {
|
checkLogin() {
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
uni.reLaunch({ url: '/pages/login' })
|
this.$tab.reLaunch('/pages/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
pages.json
17
pages.json
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"pages": [{
|
"pages": [{
|
||||||
|
"path": "pages/login",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "登录"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
"path": "pages/index",
|
"path": "pages/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "若依移动端框架",
|
"navigationBarTitleText": "若依移动端框架",
|
||||||
@ -50,12 +55,6 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "关于我们"
|
"navigationBarTitleText": "关于我们"
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
"path": "pages/login",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "登录"
|
|
||||||
}
|
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/common/webview/index",
|
"path": "pages/common/webview/index",
|
||||||
"style": {
|
"style": {
|
||||||
@ -77,14 +76,12 @@
|
|||||||
"iconPath": "static/images/tabbar/home.png",
|
"iconPath": "static/images/tabbar/home.png",
|
||||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
"selectedIconPath": "static/images/tabbar/home_.png",
|
||||||
"text": "首页"
|
"text": "首页"
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"pagePath": "pages/work/index",
|
"pagePath": "pages/work/index",
|
||||||
"iconPath": "static/images/tabbar/work.png",
|
"iconPath": "static/images/tabbar/work.png",
|
||||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||||
"text": "工作台"
|
"text": "工作台"
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"pagePath": "pages/mine/index",
|
"pagePath": "pages/mine/index",
|
||||||
"iconPath": "static/images/tabbar/mine.png",
|
"iconPath": "static/images/tabbar/mine.png",
|
||||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||||
|
Loading…
Reference in New Issue
Block a user