Browse Source

本地

pull/12/head
zhaoguoqiang 3 years ago
parent
commit
41ab203b1d
  1. 5
      .env.online
  2. 2
      package.json
  3. 33
      src/views/login.vue

5
.env.online

@ -1,3 +1,4 @@
NODE_ENV=production
NODE_ENV=online
BUILD_ENV=online
VUE_APP_ENV=online
VUE_APP_ENV=online
VUE_APP_BASE_URL="http://test.qingweilai888.xyz"

2
package.json

@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode development",
"serve": "vue-cli-service serve --mode online",
"build:dev": "vue-cli-service build --mode development",
"build:pro": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"

33
src/views/login.vue

@ -6,22 +6,25 @@
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",
// });
// }
if (process.env.NODE_ENV == "online") {
token =
"bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LnFpbmd3ZWlsYWk4ODgueHl6XC9hZG1pblwvbG9naW4iLCJpYXQiOjE2Mjc0NjU1ODksImV4cCI6MTk4NzQ2NTU4OSwibmJmIjoxNjI3NDY1NTg5LCJqdGkiOiJ6clVHYnJCOXlPWkpRanRUIiwic3ViIjoxNjEsInBydiI6IjBiMzZjMGUwMjMyZGVlZTlkOTZhZDA0NGY3YWE2MjQ2YTUwYTU3ZmEifQ.aFc5fCUffmDN7zBRn-D13kx1LuLNG1Ej7vQOu4O2_AA"
this.$store.commit("user/setToken", token);
this.$router.push({
path: "/home",
});
} else {
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",
});
},
};
</script>

Loading…
Cancel
Save