魏熙美 6 лет назад
Родитель
Сommit
96f229b84d
3 измененных файлов: 2 добавлений и 3 удалений
  1. 1
    1
      src/layout/default/index.vue
  2. 1
    0
      src/router.js
  3. 0
    2
      src/views/Login.vue

+ 1
- 1
src/layout/default/index.vue Просмотреть файл

129
         this.$router.push({
129
         this.$router.push({
130
           name: 'login',
130
           name: 'login',
131
           query: {
131
           query: {
132
-            from: this.$route.name,
132
+            from: 'indexWelcome', // this.$route.name
133
           }
133
           }
134
         })
134
         })
135
       })
135
       })

+ 1
- 0
src/router.js Просмотреть файл

58
 router.beforeEach((to, from, next) => {
58
 router.beforeEach((to, from, next) => {
59
   NProgress.start()
59
   NProgress.start()
60
 
60
 
61
+  console.log(to)
61
   const toLogin = { name: 'login', query: { from: to.name } }
62
   const toLogin = { name: 'login', query: { from: to.name } }
62
   const toIndex = { name: 'index' }
63
   const toIndex = { name: 'index' }
63
   const to403 = { name: 'norights' }
64
   const to403 = { name: 'norights' }

+ 0
- 2
src/views/Login.vue Просмотреть файл

66
     submit() {
66
     submit() {
67
       this.login({ username: this.formdata.username, password: md5(this.formdata.password) }).then(() => {
67
       this.login({ username: this.formdata.username, password: md5(this.formdata.password) }).then(() => {
68
         this.$router.push({ name: this.fromRoute })
68
         this.$router.push({ name: this.fromRoute })
69
-        // 默认进入欢迎语页面
70
-        this.$router.push({ name: 'indexWelcome' })
71
       }).catch((err) => {
69
       }).catch((err) => {
72
         this.$message({
70
         this.$message({
73
           showClose: true,
71
           showClose: true,