Jelajahi Sumber

Signed-off-by: zhaobao <528046418@qq.com>

zhaobao 3 tahun lalu
induk
melakukan
43d1562771
1 mengubah file dengan 13 tambahan dan 1 penghapusan
  1. 13 1
      src/views/login/index.vue

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

@@ -112,7 +112,19 @@ export default {
   watch: {
     $route: {
       handler: function(route) {
-        this.redirect = route.query && route.query.redirect
+        // this.redirect = route.query && route.query.redirect
+        // console.log(route.query)
+        if (route.query.username) {
+          this.$store.dispatch('user/login', {
+            username: route.query.username,
+            password: route.query.password
+          }).then(async(res) => {
+            this.loading = false
+            this.$router.push({ path: '/', query: this.otherQuery })
+          }).catch(() => {
+            this.loading = false
+          })
+        }
       },
       immediate: true
     }