From 11654d9ba0a8496d21aef58e2f9ee3e2b21e4fe8 Mon Sep 17 00:00:00 2001 From: zhaoguoqiang <849348323@qq.com> Date: Fri, 13 Aug 2021 16:08:20 +0800 Subject: [PATCH] 1 --- src/views/login.vue | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 7b02c46..5562e44 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -6,22 +6,22 @@ let url = this.$route.query; let token; let url_string = JSON.stringify(url); - // if (url_string == "{}") { - // this.$toast('请先登录') - // } else { - // token = url.token_type + " " + url.access_token; - // this.$store.commit("user/setToken", token); - // this.$router.push({ - // path: "/home", - // }); - // } - - token = - "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA" - this.$store.commit("user/setToken", token); - this.$router.push({ + if (url_string == "{}") { + this.$toast('请先登录') + } else { + token = url.token_type + " " + url.access_token; + this.$store.commit("user/setToken", token); + this.$router.push({ path: "/home", }); + } + + // token = + // "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA" + // this.$store.commit("user/setToken", token); + // this.$router.push({ + // path: "/home", + // }); }, };