Commit 86acea80 authored by 杨梦雪's avatar 杨梦雪

11

parent d706b17e
...@@ -38,9 +38,10 @@ export default { ...@@ -38,9 +38,10 @@ export default {
}; };
}, },
created() { created() {
const doubt_code = window.localStorage.getItem("doubt_code"); let code = this.$store.state.indexIdentity;
const doubt_info = window.localStorage.getItem("doubt_info"); const doubt_code = window.localStorage.getItem("doubt_code" + code);
const doubt_check = window.localStorage.getItem("doubt_check"); const doubt_info = window.localStorage.getItem("doubt_info" + code);
const doubt_check = window.localStorage.getItem("doubt_check" + code);
// console.log(doubt_check, "doubt_check"); // console.log(doubt_check, "doubt_check");
const newArr = [ const newArr = [
{ {
...@@ -65,12 +66,12 @@ export default { ...@@ -65,12 +66,12 @@ export default {
}, },
]; ];
let arr = []; let arr = [];
// console.log(newArr, "newArr"); console.log(newArr, "newArr");
for (let i = 0; i < newArr.length; i++) { for (let i = 0; i < newArr.length; i++) {
const item = newArr[i]; const item = newArr[i];
if ( if (
(doubt_code == 0 && item.status == 1) || (doubt_code == 0 && item.status == 1) ||
(doubt_info == 0 && item.status == 2)|| (doubt_info == 0 && item.status == 2) ||
(doubt_check == 0 && item.status == 3) (doubt_check == 0 && item.status == 3)
) { ) {
} else { } else {
......
...@@ -48,7 +48,9 @@ export default { ...@@ -48,7 +48,9 @@ export default {
data() { data() {
return { return {
isHover: true, isHover: true,
system_logo: window.localStorage.getItem("system_logo"+this.$store.state.indexIdentity), system_logo: window.localStorage.getItem(
"system_logo" + this.$store.state.indexIdentity
),
isLogin: false, isLogin: false,
phone: window.localStorage.getItem( phone: window.localStorage.getItem(
"phone" + this.$store.state.indexIdentity "phone" + this.$store.state.indexIdentity
...@@ -56,7 +58,7 @@ export default { ...@@ -56,7 +58,7 @@ export default {
}; };
}, },
created() { created() {
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
this.isLogin = !!localStorage.getItem("index-token" + code); this.isLogin = !!localStorage.getItem("index-token" + code);
}, },
methods: { methods: {
...@@ -93,20 +95,26 @@ export default { ...@@ -93,20 +95,26 @@ export default {
await logout({}); await logout({});
// if (res.code !== 200) return this.$message.error(res.message); // if (res.code !== 200) return this.$message.error(res.message);
// 清除本地缓存除了大学logo // 清除本地缓存除了大学logo
window.localStorage.clear(); // window.localStorage.clear();
// window.localStorage.removeItem("doubt_code"); let code = this.$store.state.indexIdentity;
// window.localStorage.removeItem("doubt_info");
// window.localStorage.removeItem("doubt_check"); window.localStorage.removeItem("doubt_code" + code);
// window.localStorage.removeItem("index-identity"); window.localStorage.removeItem("doubt_info" + code);
// window.localStorage.removeItem("index-token"); window.localStorage.removeItem("doubt_check" + code);
// window.localStorage.removeItem("phone"); window.localStorage.removeItem("index-token" + code);
// window.localStorage.removeItem("camp_name"); window.localStorage.removeItem("phone" + code);
// window.localStorage.removeItem("system_color"); window.localStorage.removeItem("camp_name" + code);
// window.localStorage.removeItem("has_amount"); window.localStorage.removeItem("system_color" + code);
// window.localStorage.removeItem("campsite_id"); window.localStorage.removeItem("system_logo" + code);
// window.localStorage.removeItem("order_no"); window.localStorage.removeItem("has_amount" + code);
// window.localStorage.removeItem("campindex_type"); window.localStorage.removeItem("campsite_id" + code);
// window.localStorage.removeItem("bk_pic"); window.localStorage.removeItem("order_no" + code);
window.localStorage.removeItem("campindex_type" + code);
window.localStorage.removeItem("bk_pic" + code);
window.localStorage.removeItem("examine_status" + code);
window.localStorage.removeItem("examine_reason" + code);
window.localStorage.removeItem("sign_up_file_18355151517" + code);
window.localStorage.removeItem("schoolName" + code);
this.isLogin = false; this.isLogin = false;
}, },
onMouserEnter(val) { onMouserEnter(val) {
......
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
}); });
}, },
getCams() { getCams() {
getCam(false).then((res) => { getCam(this.$store.state.indexIdentity).then((res) => {
// console.log(res, "res"); // console.log(res, "res");
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input <el-input
v-model="referForm.phone" v-model="phone"
placeholder="请输入手机号" placeholder="请输入手机号"
size="small" size="small"
:disabled="true" :disabled="true"
...@@ -526,28 +526,18 @@ export default { ...@@ -526,28 +526,18 @@ export default {
}, },
mounted() {}, mounted() {},
created() { created() {
// this.phone = window.localStorage.getItem("phone"); //本地取用户手机号 const code = this.$store.state.indexIdentity;
const code = this.$store.state.indexIdentity; this.phone = window.localStorage.getItem("phone" + code); //本地取用户手机号
let signUpFile = window.localStorage.getItem( let signUpFile = window.localStorage.getItem(
"sign_up_file_" + window.localStorage.getItem("phone"+code) "sign_up_file_" + window.localStorage.getItem("phone" + code)
); );
// console.log(signUpFile) // console.log(signUpFile)
if (signUpFile && JSON.parse(signUpFile).length > 0) { if (signUpFile && JSON.parse(signUpFile).length > 0) {
this.fileList = JSON.parse(signUpFile); this.fileList = JSON.parse(signUpFile);
} }
//回显图片
// let aPath=window.localStorage.getItem("achievement_path")
// console.log(aPath)
// if (window.localStorage.getItem("achievement_path")!=null) {
// this.fileList = window.localStorage.getItem("achievement_path");
// }
// console.log(window.localStorage.getItem("achievement_path"))
// console.log(this.fileList);
console.log(this.$parent.event, " this.$parent");
this.getSchool(); this.getSchool();
this.getProAndCity(); this.getProAndCity();
this.getTenYear(); this.getTenYear();
this.getAccount(); this.getAccount();
}, },
watch: { watch: {
...@@ -749,8 +739,9 @@ export default { ...@@ -749,8 +739,9 @@ export default {
// console.log(res) // console.log(res)
if (res.data.code === 200) { if (res.data.code === 200) {
this.schoolName = res.data.school_list; this.schoolName = res.data.school_list;
const code = this.$store.state.indexIdentity;
window.localStorage.setItem( window.localStorage.setItem(
"schoolName", "schoolName" + code,
JSON.stringify(res.data.list) JSON.stringify(res.data.list)
); );
for (let key in this.schoolName) { for (let key in this.schoolName) {
...@@ -875,7 +866,8 @@ export default { ...@@ -875,7 +866,8 @@ export default {
// console.log(this.fileList, " this.fileList"); // console.log(this.fileList, " this.fileList");
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem( window.localStorage.setItem(
"sign_up_file_" + +window.localStorage.getItem("phone"+code), "sign_up_file_" +
+window.localStorage.getItem("phone" + code),
JSON.stringify(this.fileList) JSON.stringify(this.fileList)
); );
}) })
...@@ -920,7 +912,7 @@ export default { ...@@ -920,7 +912,7 @@ export default {
this.fileList.splice(idx, 1); this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem( window.localStorage.setItem(
"sign_up_file_" + window.localStorage.getItem("phone"+code), "sign_up_file_" + window.localStorage.getItem("phone" + code),
JSON.stringify(this.fileList) JSON.stringify(this.fileList)
); );
} }
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
created() {}, created() {},
methods: { methods: {
handleDownload() { handleDownload() {
getCam(false).then((res) => { getCam(this.$store.state.indexIdentity).then((res) => {
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
......
...@@ -183,18 +183,54 @@ export function request(config) { ...@@ -183,18 +183,54 @@ export function request(config) {
instance.interceptors.response.use( instance.interceptors.response.use(
(res) => { (res) => {
console.log(res) console.log(res)
if (res.data.code == 400023) {
console.log(store.state.indexIdentity,'store.state.indexIdentity') if (res.data.code == 400023||res.data.code == 400001) {
console.log(777) console.log(store.state.indexIdentity, 'store.state.indexIdentity')
window.localStorage.clear() let code = store.state.indexIdentity;
window.localStorage.removeItem("doubt_code" + code);
window.localStorage.removeItem("doubt_info" + code);
window.localStorage.removeItem("doubt_check" + code);
window.localStorage.removeItem("index-token" + code);
window.localStorage.removeItem("phone" + code);
window.localStorage.removeItem("camp_name" + code);
window.localStorage.removeItem("system_color" + code);
window.localStorage.removeItem("system_logo" + code);
window.localStorage.removeItem("has_amount" + code);
window.localStorage.removeItem("campsite_id" + code);
window.localStorage.removeItem("order_no" + code);
window.localStorage.removeItem("campindex_type" + code);
window.localStorage.removeItem("bk_pic" + code);
window.localStorage.removeItem("examine_status" + code);
window.localStorage.removeItem("examine_reason" + code);
window.localStorage.removeItem("sign_up_file_18355151517" + code);
window.localStorage.removeItem("schoolName" + code);
router.push({ router.push({
path: '/' + store.state.indexIdentity, path: '/' + store.state.indexIdentity,
}) })
return return this.$message.error(res.data.message);
} }
if (res.data.code == 400003) { if (res.data.code == 400003) {
window.localStorage.clear() let code = this.$store.state.indexIdentity;
window.localStorage.removeItem("doubt_code" + code);
window.localStorage.removeItem("doubt_info" + code);
window.localStorage.removeItem("doubt_check" + code);
window.localStorage.removeItem("index-token" + code);
window.localStorage.removeItem("phone" + code);
window.localStorage.removeItem("camp_name" + code);
window.localStorage.removeItem("system_color" + code);
window.localStorage.removeItem("system_logo" + code);
window.localStorage.removeItem("has_amount" + code);
window.localStorage.removeItem("campsite_id" + code);
window.localStorage.removeItem("order_no" + code);
window.localStorage.removeItem("campindex_type" + code);
window.localStorage.removeItem("bk_pic" + code);
window.localStorage.removeItem("examine_status" + code);
window.localStorage.removeItem("examine_reason" + code);
window.localStorage.removeItem("sign_up_file_18355151517" + code);
window.localStorage.removeItem("schoolName" + code);
router.push({ router.push({
path: '/login', path: '/login',
query: { query: {
......
...@@ -90,8 +90,11 @@ router.onError((error) => { ...@@ -90,8 +90,11 @@ router.onError((error) => {
}) })
function checkCam(code, cb) { function checkCam(code, cb) {
// console.log(code, 'code') console.log(code, 'code')
// console.log(cb, 'cb') // console.log(cb, 'cb')
// const code=store.status.indexIdentity
store.state.indexIdentity = code;
console.log(code, 'code')
if (!code) { if (!code) {
Message({ Message({
message: "请访问正确的营地链接地址", message: "请访问正确的营地链接地址",
...@@ -101,16 +104,23 @@ function checkCam(code, cb) { ...@@ -101,16 +104,23 @@ function checkCam(code, cb) {
return false; return false;
} }
getCam(code).then((res) => { getCam(code).then((res) => {
console.log(res) // if (res.data.code != 200) {
if (res.data.code != 200) { // Message({
Message({ // message: "请访问正确的营地链接地址",
message: "请访问正确的营地链接地址", // type: 'waring'
type: 'waring' // });
}); //40003
cb && cb(false); if (res.data.code == 400034 || res.data.code == 400035 || res.data.code == 400001 || res.data.code == 400002 || res.data.code == 400003) {
return false; Message({
} message: res.data.message,
store.state.indexIdentity = code; type: 'waring'
});
cb && cb(false);
return false;
}
// }
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
let root = document.querySelector(":root"); let root = document.querySelector(":root");
root.style.setProperty("--color", res.data.system_color); root.style.setProperty("--color", res.data.system_color);
...@@ -171,13 +181,13 @@ router.beforeEach((to, from, next) => { ...@@ -171,13 +181,13 @@ router.beforeEach((to, from, next) => {
code = to.params.code ? to.params.code : to.query.code; code = to.params.code ? to.params.code : to.query.code;
let token = window.localStorage.getItem("index-token" + code); let token = window.localStorage.getItem("index-token" + code);
if (!token) { if (!token) {
// console.log(token, 'token') checkCam(code, (res) => {
return next(toLogin); if (res) {
return next(toLogin);
}
});
} else { } else {
checkCam(code, (res) => { checkCam(code, (res) => {
if (res) { if (res) {
if (token) { if (token) {
return next(); return next();
...@@ -188,7 +198,6 @@ router.beforeEach((to, from, next) => { ...@@ -188,7 +198,6 @@ router.beforeEach((to, from, next) => {
}); });
} }
} }
// return nextUrl ? next(nextUrl) : next();
}) })
// 页面跳转之后页面回滚到顶部 // 页面跳转之后页面回滚到顶部
......
...@@ -98,10 +98,10 @@ export default { ...@@ -98,10 +98,10 @@ export default {
console.log(22222); console.log(22222);
// console.log(res, "signUpInit"); // console.log(res, "signUpInit");
if (res.data.code != 200) { if (res.data.code != 200) {
if (res.data.code == 400001) { // if (res.data.code == 400001) {
this.status = 6; // this.status = 6;
this.type = "success"; // this.type = "success";
} // }
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
this.status = res.data.status; this.status = res.data.status;
......
...@@ -257,20 +257,20 @@ export default { ...@@ -257,20 +257,20 @@ export default {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
let code = this.$store.state.indexIdentity;
// token存储 // token存储
window.localStorage.setItem("index-token" + code, res.data.token); window.localStorage.setItem("index-token" + code, res.data.token);
window.localStorage.setItem("phone" + code, this.registerForm.phone); window.localStorage.setItem("phone" + code, this.registerForm.phone);
// 报名信息 // 报名信息
window.localStorage.setItem("camp_name", res.data.cam.name); window.localStorage.setItem("camp_name" + code, res.data.cam.name);
//获取主题色 //获取主题色
window.localStorage.setItem( window.localStorage.setItem(
"system_color"+ code, "system_color" + code,
res.data.cam.system_color res.data.cam.system_color
); );
// 跳转到报名 // 跳转到报名
let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/examInfo?code=" + code); this.$router.push("/signUp/examInfo?code=" + code);
}); });
}); });
......
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