Commit d0f3c6d5 authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-路由添加公共query

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