Browse Source

初次进入App时进入登录页

RuoYi 2 years ago
parent
commit
ff1d17eb31
2 changed files with 10 additions and 11 deletions
  1. 3 1
      App.vue
  2. 7 10
      pages.json

+ 3 - 1
App.vue

@@ -13,14 +13,16 @@
         // 初始化应用配置
         this.initConfig()
         // 检查用户登录状态
+        //#ifdef H5
         this.checkLogin()
+        //#endif
       },
       initConfig() {
         this.globalData.config = config
       },
       checkLogin() {
         if (!getToken()) {
-          uni.reLaunch({ url: '/pages/login' })
+          this.$tab.reLaunch('/pages/login') 
         }
       }
     }

+ 7 - 10
pages.json

@@ -1,5 +1,10 @@
 {
   "pages": [{
+    "path": "pages/login",
+    "style": {
+      "navigationBarTitleText": "登录"
+    }
+  }, {
     "path": "pages/index",
     "style": {
       "navigationBarTitleText": "若依移动端框架",
@@ -50,12 +55,6 @@
     "style": {
       "navigationBarTitleText": "关于我们"
     }
-  }, {
-    "path": "pages/login",
-    "style": {
-      "navigationBarTitleText": "登录"
-    }
-
   }, {
     "path": "pages/common/webview/index",
     "style": {
@@ -77,14 +76,12 @@
         "iconPath": "static/images/tabbar/home.png",
         "selectedIconPath": "static/images/tabbar/home_.png",
         "text": "首页"
-      },
-      {
+      }, {
         "pagePath": "pages/work/index",
         "iconPath": "static/images/tabbar/work.png",
         "selectedIconPath": "static/images/tabbar/work_.png",
         "text": "工作台"
-      },
-      {
+      }, {
         "pagePath": "pages/mine/index",
         "iconPath": "static/images/tabbar/mine.png",
         "selectedIconPath": "static/images/tabbar/mine_.png",