|
|
@@ -54,12 +54,12 @@
|
|
|
loading: false,
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
+ mounted() {
|
|
|
var token = window.location.search.substr(1).split('=')[1];
|
|
|
if (token) {
|
|
|
this.loading = true;
|
|
|
- console.log(token)
|
|
|
- this.casualBacking = token
|
|
|
+
|
|
|
+ this.casualBacking = token,
|
|
|
this.secretLogin()
|
|
|
} else {
|
|
|
this.loading = false;
|
|
|
@@ -81,44 +81,50 @@
|
|
|
return null;
|
|
|
},
|
|
|
secretLogin() {
|
|
|
- let data = {
|
|
|
- casualBacking: this.casualBacking,
|
|
|
- ip:sessionStorage.getItem("ip")
|
|
|
- };
|
|
|
- this.$post("/secretLogin", data)
|
|
|
- .then(
|
|
|
- response => {
|
|
|
- if (response.status == 200) {
|
|
|
- if (response.data.success == true) {
|
|
|
- window.localStorage.removeItem("menuName");
|
|
|
- window.localStorage.removeItem("menuIndex");
|
|
|
- window.localStorage.setItem(
|
|
|
- "userId",
|
|
|
- response.data.data.dealerID
|
|
|
- );
|
|
|
- window.localStorage.setItem(
|
|
|
- "zptoken",
|
|
|
- response.data.data.name
|
|
|
- );
|
|
|
- window.localStorage.setItem(
|
|
|
- "personInfo",
|
|
|
- JSON.stringify(response.data.data)
|
|
|
- );
|
|
|
- this.$router.replace({path: "/home/order"})
|
|
|
+ var that = this;
|
|
|
+ setTimeout(function() {
|
|
|
+ let data = {
|
|
|
+ casualBacking: that.casualBacking + "@@"+sessionStorage.getItem("ip"),
|
|
|
+ ips:sessionStorage.getItem("ip")
|
|
|
+ };
|
|
|
+ that.$post("/secretLogin", data)
|
|
|
+ .then(
|
|
|
+ response => {
|
|
|
+ if (response.status == 200) {
|
|
|
+ if (response.data.success == true) {
|
|
|
+ window.localStorage.removeItem("menuName");
|
|
|
+ window.localStorage.removeItem("menuIndex");
|
|
|
+ window.localStorage.setItem(
|
|
|
+ "userId",
|
|
|
+ response.data.data.dealerID
|
|
|
+ );
|
|
|
+ window.localStorage.setItem(
|
|
|
+ "zptoken",
|
|
|
+ response.data.data.name
|
|
|
+ );
|
|
|
+ window.localStorage.setItem(
|
|
|
+ "personInfo",
|
|
|
+ JSON.stringify(response.data.data)
|
|
|
+ );
|
|
|
+ that.$router.replace({path: "/home/order"})
|
|
|
+
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ that.loginShow = true;
|
|
|
+ that.loading = false;
|
|
|
+ that.$message.error("跳转失败,请手动登录");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.loginShow = true;
|
|
|
+ that.loading = false;
|
|
|
+ that.$message.error("跳转失败,请手动登录");
|
|
|
+ }
|
|
|
|
|
|
- // });
|
|
|
- } else {
|
|
|
- this.loginShow = true;
|
|
|
- this.loading = false;
|
|
|
- this.$message.error("跳转失败,请手动登录");
|
|
|
}
|
|
|
- } else {
|
|
|
- this.loginShow = true;
|
|
|
- this.loading = false;
|
|
|
- this.$message.error("跳转失败,请手动登录");
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+ );
|
|
|
+ }, (1000));
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
login() {
|
|
|
this.$post("/login", this.formInline)
|