瀏覽代碼

Merge branch 'master' of http://git.dayaedu.com/molingzhide/dy-admin-manager

lex-xin 5 年之前
父節點
當前提交
80abb1fdef
共有 4 個文件被更改,包括 9 次插入2 次删除
  1. 2 0
      package.json
  2. 1 1
      src/layout/components/Navbar.vue
  3. 1 0
      src/main.js
  4. 5 1
      src/views/login/index.vue

+ 2 - 0
package.json

@@ -19,6 +19,7 @@
     "axios": "0.18.1",
     "default-passive-events": "^1.0.10",
     "element-ui": "^2.12.0",
+    "i": "^0.3.6",
     "js-cookie": "2.2.0",
     "normalize.css": "7.0.0",
     "npm": "^6.13.0",
@@ -44,6 +45,7 @@
     "babel-core": "7.0.0-bridge.0",
     "babel-eslint": "10.0.1",
     "babel-jest": "23.6.0",
+    "babel-polyfill": "^6.26.0",
     "chalk": "2.4.2",
     "connect": "3.6.6",
     "eslint": "5.15.3",

+ 1 - 1
src/layout/components/Navbar.vue

@@ -76,7 +76,7 @@ export default {
     },
     async logout () {
       await this.$store.dispatch("user/logout");
-      this.$router.push(`/login?redirect=${this.$route.fullPath}`);
+      this.$router.push(`/login`);
     }
   }
 };

+ 1 - 0
src/main.js

@@ -2,6 +2,7 @@ import Vue from 'vue'
 import ElementUI from 'element-ui'
 import 'normalize.css/normalize.css' // A modern alternative to CSS resets
 import 'default-passive-events'
+import 'babel-polyfill'
 
 import 'element-ui/lib/theme-chalk/index.css'
 import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

+ 5 - 1
src/views/login/index.vue

@@ -139,7 +139,11 @@ export default {
             .dispatch("user/login", this.loginForm)
             .then(() => {
               console.log('登录成功');
-              this.$router.push({ path: this.redirect || "/" });
+              this.$nextTick(res => {
+                this.$router.push({ path: "/main/main" });
+              })
+
+
 
             })
             .catch(() => {