Commit d0f3c6d5 authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-路由添加公共query

parent 248ce87b
......@@ -65,7 +65,13 @@
return false;
}
this.$store.commit('setIndexIdentity', code)
this.$router.push('/signUp/undefined?code=' + code)
this.$router.push({
path: "/signUp/undefined",
query: {
...this.$store.state.query,
code: code
}
});
}
},
watch: {
......
......@@ -62,7 +62,13 @@
methods: {
toLogin() {
let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code);
this.$router.replace({
path: "/login",
query: {
...this.$store.state.query,
code: code
}
});
},
handleCommand(command) {
if (command == 2) {
......
......@@ -56,7 +56,12 @@ export default {
// 清除本地缓存除了大学logo
window.localStorage.clear();
let code = this.$store.state.indexIdentity;
await this.$router.replace("/" + code);
await this.$router.replace({
path: "/" + code,
query: {
...this.$store.state.query,
}
});
this.$message.success("退出成功");
await logout({});
},
......@@ -64,7 +69,12 @@ export default {
toRecruit() {
// 清除本地缓存除了大学logo
let code = this.$store.state.indexIdentity;
this.$router.replace("/" + code);
this.$router.replace({
path: "/" + code,
query: {
...this.$store.state.query,
}
});
},
},
};
......
......@@ -250,14 +250,30 @@
let allToken = window.localStorage.getItem('index-token-all');
if (allToken) {
this.$store.commit('setIndexIdentity', this.activeInfo.identity)
this.$router.push('/signUp/undefined?code=' + this.activeInfo.identity);
this.$router.push({
path: '/signUp/undefined',
query: {
...this.$store.state.query,
code: this.activeInfo.identity
}
});
} else {
this.$router.push('/baseLogin');
this.$router.push({
path: '/baseLogin',
query: {
...this.$store.state.query,
}
});
}
},
// 去活动详情页面(当前活动/往期活动回顾区域)
toActiveInfo(id) {
this.$router.push('/active/' + id);
this.$router.push({
path: '/active/' + id,
query: {
...this.$store.state.query,
}
});
},
// 锚点跳转方法
anchorSkip(id) {
......
......@@ -59,7 +59,6 @@
</div>
<div class="active-list-item-cont-txt3">报名截止时间:{{formatYMDChina(item.bmEndTime)}}</div>
</div>
<!-- $router.push('/active/'+item.id)-->
<div @click="toActive(item.id)" class="active-list-item-bottom">
<div>查看详情</div>
<i class="el-icon-right"></i>
......
......@@ -257,11 +257,21 @@
},
// 忘记账号/密码
forgetPwd() {
this.$router.push("/baseReset");
this.$router.push({
path: '/baseReset',
query: {
...this.$store.state.query,
}
});
},
// 去注册
register() {
this.$router.push("/baseRegister");
this.$router.push({
path: '/baseRegister',
query: {
...this.$store.state.query,
}
});
},
// 改变密码显示状态
changePwdStatus() {
......@@ -305,7 +315,12 @@
window.localStorage.setItem("index-phone-all", this.loginForm.phone);
window.localStorage.setItem("index-email-all", res.data.email);
let previousPath = this.$store.state.previousPath;
this.$router.push(previousPath);
this.$router.push({
path: previousPath,
query: {
...this.$store.state.query,
}
});
this.$store.commit('setPreviousPath', '/');
});
});
......
......@@ -254,7 +254,6 @@
intervalHandle(startTime, endTime) {
// 时间差
const timeLag = intervalTime(startTime, endTime);
console.log(timeLag);
if (!this.timer) {
this.count = timeLag - 1;
this.showCode = false;
......@@ -310,7 +309,12 @@
window.localStorage.setItem("index-phone-all", this.registerForm.phone);
let previousPath = this.$store.state.previousPath;
this.$router.push(previousPath);
this.$router.push({
path: previousPath,
query: {
...this.$store.state.query,
}
});
this.$store.commit('setPreviousPath', '/');
});
});
......
......@@ -219,7 +219,12 @@
methods: {
// 去注册
toLogin() {
this.$router.push("/baseLogin");
this.$router.push({
path: '/baseLogin',
query: {
...this.$store.state.query,
}
});
},
// 改变密码显示状态
changePwdStatus() {
......
......@@ -90,9 +90,7 @@ export default {
},
watch: {},
created() {
// this.ToSignUp(this.index);
this.ToSignUp(this.index);
// this.$refs.child.signUpInit();
},
mounted() {
window.addEventListener("scroll", this.handleScrollX, true);
......@@ -104,16 +102,8 @@ export default {
},
methods: {
ToSignUp(index) {
console.log(index, "index");
let code = this.$store.state.indexIdentity;
this.campindex_type = index;
// if (this.campindex_type == 0) {
// this.$router.push("Info/personalInfo?code=" + code);
// } else
// if (this.campindex_type == 1) {
// this.$router.push("/password?code=" + code);
// }
},
onResize() {
const refLeft = this.$refs["leftBox"];
......
......@@ -807,14 +807,11 @@ export default {
this.$message.error(err);
});
} else {
// console.log(this.schoolName, 111);
for (let key in this.schoolName) {
// console.log(key, this.schoolName[key]);
if (this.schoolName[key].city_id == val) {
currentSchool.push(this.schoolName[key]);
}
}
// console.log(currentSchool, 222);
return currentSchool;
}
return currentSchool;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment