Commit d706b17e authored by 杨梦雪's avatar 杨梦雪

11

parent 88538974
...@@ -48,20 +48,20 @@ export default { ...@@ -48,20 +48,20 @@ export default {
data() { data() {
return { return {
isHover: true, isHover: true,
system_logo: window.localStorage.getItem("system_logo"), system_logo: window.localStorage.getItem("system_logo"+this.$store.state.indexIdentity),
isLogin: false, isLogin: false,
phone: window.localStorage.getItem( phone: window.localStorage.getItem(
"phone" + Cookie.get("index-identity") "phone" + this.$store.state.indexIdentity
), ),
}; };
}, },
created() { created() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.isLogin = !!localStorage.getItem("index-token" + code); this.isLogin = !!localStorage.getItem("index-token" + code);
}, },
methods: { methods: {
toLogin() { toLogin() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code); this.$router.push("/login?code=" + code);
}, },
handleCommand(command) { handleCommand(command) {
...@@ -73,11 +73,11 @@ export default { ...@@ -73,11 +73,11 @@ export default {
} }
}, },
toCenter() { toCenter() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.replace("/signUp/examInfo?code=" + code); this.$router.replace("/signUp/examInfo?code=" + code);
}, },
toRegister() { toRegister() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/register?code=" + code); this.$router.push("/register?code=" + code);
}, },
async logout() { async logout() {
......
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
}; };
}, },
created() { created() {
this.token = window.localStorage.getItem("index-token"+code); this.token = window.localStorage.getItem("index-token"+this.$store.state.indexIdentity);
this.has_amount = window.localStorage.getItem("has_amount"); this.has_amount = window.localStorage.getItem("has_amount"+this.$store.state.indexIdentity);
}, },
methods: { methods: {
async confirm() { async confirm() {
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
} else if (!this.dialogVisible) { } else if (!this.dialogVisible) {
return; return;
} else { } else {
let code=this.$store.state.indexIdentity
if (!this.token || this.token == "") { if (!this.token || this.token == "") {
this.token = window.localStorage.getItem("index-token"+code); this.token = window.localStorage.getItem("index-token"+code);
} }
...@@ -216,8 +217,8 @@ export default { ...@@ -216,8 +217,8 @@ export default {
websocketSend() { websocketSend() {
//数据发送 //数据发送
let sendData = { let sendData = {
order_no: window.localStorage.getItem("order_no"), order_no: window.localStorage.getItem("order_no"+this.$store.state.indexIdentity),
cam_id: window.localStorage.getItem("campsite_id"), cam_id: window.localStorage.getItem("campsite_id"+this.$store.state.indexIdentity),
token: this.token, token: this.token,
}; };
this.websocket.send(JSON.stringify(sendData)); this.websocket.send(JSON.stringify(sendData));
...@@ -236,7 +237,7 @@ export default { ...@@ -236,7 +237,7 @@ export default {
this.$emit("closeCFSUDialog", this.dialogVisible, true); this.$emit("closeCFSUDialog", this.dialogVisible, true);
// status=6,跳转到报名成功页面 // status=6,跳转到报名成功页面
// this.$emit("getstatus", res.data.status.status); // this.$emit("getstatus", res.data.status.status);
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/success?code="+code); this.$router.push("/signUp/success?code="+code);
} else { } else {
//收到服务器信息,心跳重置 //收到服务器信息,心跳重置
......
...@@ -30,8 +30,8 @@ export default { ...@@ -30,8 +30,8 @@ export default {
name: "Header", name: "Header",
data() { data() {
return { return {
phone: window.localStorage.getItem("phone"+Cookie.get("index-identity")), phone: window.localStorage.getItem("phone"+this.$store.state.indexIdentity),
system_logo: window.localStorage.getItem("system_logo"), system_logo: window.localStorage.getItem("system_logo"+this.$store.state.indexIdentity),
}; };
}, },
methods: { methods: {
...@@ -55,14 +55,13 @@ export default { ...@@ -55,14 +55,13 @@ export default {
// 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();
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.replace("/"+code); this.$router.replace("/"+code);
}, },
// 点击图片跳转到招生简章页面 // 点击图片跳转到招生简章页面
toRecruit() { toRecruit() {
// 清除本地缓存除了大学logo // 清除本地缓存除了大学logo
let code = this.$store.state.indexIdentity;
let code = Cookie.get("index-identity");
this.$router.replace("/"+code); this.$router.replace("/"+code);
}, },
}, },
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> --> </div> -->
<div class="check"> <div class="check">
<el-checkbox v-model="checked" <el-checkbox v-model="checked"
>我已阅读并了解《2021年历史学科暑假营报名须知》</el-checkbox >我已阅读并了解须知</el-checkbox
> >
</div> </div>
<div class="btn"> <div class="btn">
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
if (res.data.code !== 200) return this.$message.error(res.data.message); if (res.data.code !== 200) return this.$message.error(res.data.message);
this.$emit("getstatus", res.data.status); this.$emit("getstatus", res.data.status);
this.$message.success(res.data.message); this.$message.success(res.data.message);
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/invitation?code="+code); this.$router.push("/signUp/invitation?code="+code);
}); });
}, },
......
...@@ -28,20 +28,15 @@ export default { ...@@ -28,20 +28,15 @@ export default {
name: "Pass", name: "Pass",
data() { data() {
return { return {
examine_status: window.localStorage.getItem("examine_status"), examine_status: window.localStorage.getItem(
examine_reason: window.localStorage.getItem("examine_reason"), "examine_status" + this.$store.state.indexIdentity
),
examine_reason: window.localStorage.getItem(
"examine_reason" + this.$store.state.indexIdentity
),
}; };
}, },
created() { created() {
// let url = location.href; //把当前页面的地址赋给变量 url
// console.log(url)
// var times = url.split("?"); //分切变量 url 分隔符号为 "?"
// let code = Cookie.get("index-identity");
// if (times[1] != "code=" + code) {
// //如果?后的值不等于1表示没有刷新
// url += "?1"; //把变量 url 的值加入 ?1
// self.location.replace(url); //刷新页面
// }
this.signUpInit(); this.signUpInit();
}, },
...@@ -130,14 +125,20 @@ export default { ...@@ -130,14 +125,20 @@ export default {
this.$emit("getStatus", this.type); this.$emit("getStatus", this.type);
// this.getExamine = res.data.examine_status; // this.getExamine = res.data.examine_status;
// console.log(res.data.examine_status, "res.data.examine_status"); // console.log(res.data.examine_status, "res.data.examine_status");
const code = this.$store.state.indexIdentity;
//订单支付金额 //订单支付金额
window.localStorage.setItem("has_amount", res.data.has_amount); window.localStorage.setItem("has_amount" + code, res.data.has_amount);
window.localStorage.setItem("campsite_id", res.data.campsite_id); window.localStorage.setItem("campsite_id" + code, res.data.campsite_id);
window.localStorage.setItem("order_no", res.data.order_no); window.localStorage.setItem("order_no" + code, res.data.order_no);
this.examine_status = res.data.examine_status; this.examine_status = res.data.examine_status;
window.localStorage.setItem("examine_status", res.data.examine_status); //返回错误原因 window.localStorage.setItem(
window.localStorage.setItem("examine_reason", res.data.examine_reason); //资料审核状态 "examine_status" + code,
res.data.examine_status
); //返回错误原因
window.localStorage.setItem(
"examine_reason" + code,
res.data.examine_reason
); //资料审核状态
// window.localStorage.setItem("achievement_path", res.data.achievement_path); //上传的图片 // window.localStorage.setItem("achievement_path", res.data.achievement_path); //上传的图片
const aPath = res.data.achievement_path; const aPath = res.data.achievement_path;
if (aPath) { if (aPath) {
...@@ -149,7 +150,7 @@ export default { ...@@ -149,7 +150,7 @@ export default {
}; };
return obj; return obj;
}); });
const code = Cookie.get("index-identity"); const 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(fileList) JSON.stringify(fileList)
......
...@@ -80,8 +80,9 @@ export default { ...@@ -80,8 +80,9 @@ export default {
}; };
}, },
created() { created() {
this.camp_name = window.localStorage.getItem("camp_name"); const code=this.$store.state.indexIdentity
this.has_amount = window.localStorage.getItem("has_amount"); this.camp_name = window.localStorage.getItem("camp_name"+code);
this.has_amount = window.localStorage.getItem("has_amount"+code);
this.getAccount(); this.getAccount();
}, },
methods: { methods: {
......
...@@ -527,7 +527,7 @@ export default { ...@@ -527,7 +527,7 @@ export default {
mounted() {}, mounted() {},
created() { created() {
// this.phone = window.localStorage.getItem("phone"); //本地取用户手机号 // this.phone = window.localStorage.getItem("phone"); //本地取用户手机号
const code = Cookie.get("index-identity"); const code = this.$store.state.indexIdentity;
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)
); );
...@@ -873,6 +873,7 @@ export default { ...@@ -873,6 +873,7 @@ export default {
// this.fileList = fileList // this.fileList = fileList
// console.log(this.fileList, " this.fileList"); // console.log(this.fileList, " this.fileList");
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)
...@@ -917,6 +918,7 @@ export default { ...@@ -917,6 +918,7 @@ export default {
// console.log(item.url == file.url); // console.log(item.url == file.url);
if (item.url == file.url) { if (item.url == file.url) {
this.fileList.splice(idx, 1); this.fileList.splice(idx, 1);
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)
...@@ -978,7 +980,7 @@ export default { ...@@ -978,7 +980,7 @@ export default {
// console.log(res, "setAccount"); // console.log(res, "setAccount");
if (res.data.code != 200) { if (res.data.code != 200) {
if (res.data.code == 400068) { if (res.data.code == 400068) {
// let code = Cookie.get("index-identity"); // let code = this.$store.state.indexIdentity;
// this.$router.push("/signUp/check?code=" + code); // this.$router.push("/signUp/check?code=" + code);
this.$parent.statuss(); this.$parent.statuss();
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
...@@ -989,7 +991,7 @@ export default { ...@@ -989,7 +991,7 @@ export default {
this.$emit("getstatus", res.data.status); this.$emit("getstatus", res.data.status);
// this.$emit("getstatus", res.data.status); // this.$emit("getstatus", res.data.status);
this.$message.success(res.data.message); this.$message.success(res.data.message);
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/check?code=" + code); this.$router.push("/signUp/check?code=" + code);
// this.$parent.is_nextevent(); // this.$parent.is_nextevent();
this.referForm = res.data.data; this.referForm = res.data.data;
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
import { import {
request request
} from './network' } from './network'
import Cookie from "js-cookie" import store from '@/store'
const identity = Cookie.get('index-identity')
//登录前获取营地主题 //登录前获取营地主题
export function getCam(code) { export function getCam(code) {
let data = {}; let data = {};
data['identity'] = code ? code : identity; data['identity'] = code ? code : store.state.indexIdentity;
if(!data['identity']){ if (!data['identity']) {
return false; return false;
} }
return request({ return request({
...@@ -21,7 +21,7 @@ export function getCam(code) { ...@@ -21,7 +21,7 @@ export function getCam(code) {
} }
// 登录 // 登录
export function login(data) { export function login(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/login', url: '/web/auth/login',
...@@ -32,7 +32,7 @@ export function login(data) { ...@@ -32,7 +32,7 @@ export function login(data) {
// 退出 // 退出
export function logout(data) { export function logout(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/loginOut', url: '/web/auth/loginOut',
...@@ -42,7 +42,7 @@ export function logout(data) { ...@@ -42,7 +42,7 @@ export function logout(data) {
// 通过旧密码找回密码 // 通过旧密码找回密码
export function changePassOld(data) { export function changePassOld(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/changePassOld', url: '/web/auth/changePassOld',
...@@ -52,7 +52,7 @@ export function changePassOld(data) { ...@@ -52,7 +52,7 @@ export function changePassOld(data) {
// 通过验证码找回密码 // 通过验证码找回密码
export function changePassCode(data) { export function changePassCode(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/changePassCode', url: '/web/auth/changePassCode',
......
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
} from 'element-ui' } from 'element-ui'
import router from '@/router' import router from '@/router'
const instance = axios.create({ const instance = axios.create({
baseURL: SERVER_URL, baseURL: SERVER_URL,
timeout: 60000, timeout: 60000,
...@@ -37,7 +38,8 @@ instance.interceptors.request.use( ...@@ -37,7 +38,8 @@ instance.interceptors.request.use(
} }
// 调用接口请求添加token认证信息 // 调用接口请求添加token认证信息
// let token = localStorage.getItem("index-token"); // let token = localStorage.getItem("index-token");
const token = localStorage.getItem('index-token'+code)
const token = localStorage.getItem('index-token' + store.state.indexIdentity)
// //
config.headers.token = token config.headers.token = token
...@@ -124,10 +126,10 @@ export function request(config) { ...@@ -124,10 +126,10 @@ export function request(config) {
) { ) {
return config return config
} }
const token = localStorage.getItem('index-token'+code)
const token = localStorage.getItem('index-token' + store.state.indexIdentity)
if (token ) {
if (token) {
// console.log(token,'11') // console.log(token,'11')
config.headers.token = token config.headers.token = token
...@@ -180,7 +182,17 @@ export function request(config) { ...@@ -180,7 +182,17 @@ 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')
console.log(777)
window.localStorage.clear()
router.push({
path: '/' + store.state.indexIdentity,
})
return
}
if (res.data.code == 400003) { if (res.data.code == 400003) {
window.localStorage.clear() window.localStorage.clear()
router.push({ router.push({
...@@ -193,8 +205,8 @@ export function request(config) { ...@@ -193,8 +205,8 @@ export function request(config) {
res.data.code == 400801 || res.data.code == 400801 ||
res.data.code == 400910 || res.data.code == 400910 ||
res.data.code == 4002132 || res.data.code == 4002132 ||
res.data.code == 40068 || res.data.code == 40068
res.data.code == 401001
) { ) {
store.state.showDialog = true store.state.showDialog = true
store.state.dialogType = 1 store.state.dialogType = 1
...@@ -206,14 +218,14 @@ export function request(config) { ...@@ -206,14 +218,14 @@ export function request(config) {
return res return res
}, },
(error) => { (error) => {
// console.log(error.response.status) console.log(error.response.status, '5555')
Message.closeAll() Message.closeAll()
if (error.response.status === 404) { if (error.response.status === 404) {
// return this.$message.error("营地报名已结束") // return this.$message.error("营地报名已结束")
// 未登录 // 未登录
Notification({ Notification({
message: "营地报名已关闭", message: "营地报名已关闭",
duration: 2000, duration: 3000,
// onClose() { // onClose() {
// console.log('error'); // console.log('error');
// router.push("/admin/login"); // router.push("/admin/login");
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
import { import {
request request
} from './network' } from './network'
import Cookie from "js-cookie" import store from '@/store'
const identity = Cookie.get('index-identity')
// 报名初始化 // 报名初始化
export function getWxConfig(data) { export function getWxConfig(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'get', method: 'get',
url: '/web/pay/getWxPreselectionConfig', url: '/web/pay/getWxPreselectionConfig',
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
import { import {
request request
} from './network' } from './network'
import Cookie from "js-cookie" import store from '@/store'
const identity = Cookie.get('index-identity')
// 发送注册时候验证码 // 发送注册时候验证码
export function registerCode(data) { export function registerCode(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/code/registerCode', url: '/web/code/registerCode',
...@@ -16,7 +16,7 @@ export function registerCode(data) { ...@@ -16,7 +16,7 @@ export function registerCode(data) {
}) })
} }
export function passwordCode(data) { export function passwordCode(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/code/passwordCode', url: '/web/code/passwordCode',
...@@ -26,7 +26,7 @@ export function passwordCode(data) { ...@@ -26,7 +26,7 @@ export function passwordCode(data) {
// 填写注册信息 // 填写注册信息
export function setAccountInfo(data) { export function setAccountInfo(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/register/setAccountInfo', url: '/web/register/setAccountInfo',
...@@ -36,7 +36,7 @@ export function setAccountInfo(data) { ...@@ -36,7 +36,7 @@ export function setAccountInfo(data) {
// 获取注册信息 // 获取注册信息
export function getAccountInfo(data) { export function getAccountInfo(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/register/getAccountInfo', url: '/web/register/getAccountInfo',
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
import { import {
request request
} from './network' } from './network'
import Cookie from "js-cookie" import store from '@/store'
const identity =Cookie.get('index-identity')
// 报名初始化 // 报名初始化
export function signUpInit(data) { export function signUpInit(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/signUpInit', url: '/web/signUp/signUpInit',
...@@ -17,7 +16,7 @@ export function signUpInit(data) { ...@@ -17,7 +16,7 @@ export function signUpInit(data) {
// 确认报名须知 // 确认报名须知
export function setSignShould(data) { export function setSignShould(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/setSignShould', url: '/web/signUp/setSignShould',
...@@ -27,7 +26,7 @@ export function setSignShould(data) { ...@@ -27,7 +26,7 @@ export function setSignShould(data) {
// 绑定邀请码 // 绑定邀请码
export function setInviteCode(data) { export function setInviteCode(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/setInviteCode', url: '/web/signUp/setInviteCode',
...@@ -37,7 +36,7 @@ export function setInviteCode(data) { ...@@ -37,7 +36,7 @@ export function setInviteCode(data) {
// 页面个人获取 // 页面个人获取
export function getAccount(data) { export function getAccount(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/getAccount', url: '/web/signUp/getAccount',
...@@ -47,7 +46,7 @@ export function getAccount(data) { ...@@ -47,7 +46,7 @@ export function getAccount(data) {
// 获取学习成绩证明材料上传图片 // 获取学习成绩证明材料上传图片
export function getAchievementOss(data) { export function getAchievementOss(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/getAchievementOss', url: '/web/signUp/getAchievementOss',
...@@ -57,7 +56,7 @@ export function getAchievementOss(data) { ...@@ -57,7 +56,7 @@ export function getAchievementOss(data) {
//删除图片 //删除图片
export function delPic(data) { export function delPic(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/auth/delPic', url: '/web/auth/delPic',
...@@ -66,7 +65,7 @@ export function delPic(data) { ...@@ -66,7 +65,7 @@ export function delPic(data) {
} }
// 页面个人信息保存 // 页面个人信息保存
export function setAccount(data) { export function setAccount(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/setAccount', url: '/web/signUp/setAccount',
...@@ -76,7 +75,7 @@ export function setAccount(data) { ...@@ -76,7 +75,7 @@ export function setAccount(data) {
// 获取报名省份城市 // 获取报名省份城市
export function getProAndCity(data) { export function getProAndCity(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/getProAndCity', url: '/web/signUp/getProAndCity',
...@@ -86,7 +85,7 @@ export function getProAndCity(data) { ...@@ -86,7 +85,7 @@ export function getProAndCity(data) {
// 获取报名学校 // 获取报名学校
export function getSchool(data) { export function getSchool(data) {
data['identity'] = identity; data['identity'] = store.state.indexIdentity;
return request({ return request({
method: 'post', method: 'post',
url: '/web/signUp/getSchool', url: '/web/signUp/getSchool',
......
...@@ -101,6 +101,7 @@ function checkCam(code, cb) { ...@@ -101,6 +101,7 @@ 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: "请访问正确的营地链接地址",
...@@ -110,24 +111,23 @@ function checkCam(code, cb) { ...@@ -110,24 +111,23 @@ function checkCam(code, cb) {
return false; return false;
} }
store.state.indexIdentity = code; store.state.indexIdentity = code;
// 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);
root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图 root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图
window.localStorage.setItem("bk_pic", res.data.background_picture); window.localStorage.setItem("bk_pic" + code, res.data.background_picture);
//当前营地logo //当前营地logo
window.localStorage.setItem("system_logo", res.data.system_logo); window.localStorage.setItem("system_logo" + code, res.data.system_logo);
window.localStorage.setItem( window.localStorage.setItem(
"doubt_code", "doubt_code" + code,
res.data.fill_individual_Invitationcode res.data.fill_individual_Invitationcode
); //是否填写邀请码 ); //是否填写邀请码
window.localStorage.setItem( window.localStorage.setItem(
"doubt_info", "doubt_info" + code,
res.data.fill_individual_information res.data.fill_individual_information
); //是否填写个人资料 ); //是否填写个人资料
window.localStorage.setItem( window.localStorage.setItem(
"doubt_check", "doubt_check" + code,
res.data.audit_individual_information res.data.audit_individual_information
); //是否审核个人资料 ); //是否审核个人资料
store.state.info = res.data; store.state.info = res.data;
...@@ -138,6 +138,7 @@ function checkCam(code, cb) { ...@@ -138,6 +138,7 @@ function checkCam(code, cb) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// console.log(next, 'next')
let let
toLogin = "/login", toLogin = "/login",
toRegister = "/register", toRegister = "/register",
...@@ -149,7 +150,7 @@ router.beforeEach((to, from, next) => { ...@@ -149,7 +150,7 @@ router.beforeEach((to, from, next) => {
checkCam(code, (res) => { checkCam(code, (res) => {
if (res) { if (res) {
let token = window.localStorage.getItem("index-token" + code); let token = window.localStorage.getItem("index-token" + code);
console.log(token, "token") // console.log(token, "token")
//检查登陆情况 //检查登陆情况
if (token) { if (token) {
next("/" + code); next("/" + code);
...@@ -170,7 +171,7 @@ router.beforeEach((to, from, next) => { ...@@ -170,7 +171,7 @@ 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') // console.log(token, 'token')
return next(toLogin); return next(toLogin);
} else { } else {
......
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
}, },
ToSignUp(index) { ToSignUp(index) {
// console.log(index,'index') // console.log(index,'index')
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.campindex_type = index; this.campindex_type = index;
if (this.campindex_type == 0) { if (this.campindex_type == 0) {
this.$router.push("/signUp/" + this.index_status + "?code=" + code); this.$router.push("/signUp/" + this.index_status + "?code=" + code);
......
...@@ -57,6 +57,7 @@ export default { ...@@ -57,6 +57,7 @@ export default {
this.type = this.$route.params.type; this.type = this.$route.params.type;
// console.log(this.$route, "router"); // console.log(this.$route, "router");
this.statuss(); this.statuss();
// this.signUpInit();
}, },
watch: { watch: {
...@@ -89,16 +90,18 @@ export default { ...@@ -89,16 +90,18 @@ export default {
}, },
// status=4,跳到审核页面;status=3时,根据doubt_check做判断 // status=4,跳到审核页面;status=3时,根据doubt_check做判断
signUpInit(status_val) { signUpInit(status_val) {
console.log(11111);
// console.log(status_val, "11111"); // console.log(status_val, "11111");
// console.log(isNexts, "2222"); // console.log(isNexts, "2222");
signUpInit({}).then((res) => { signUpInit({}).then((res) => {
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;
...@@ -169,11 +172,12 @@ export default { ...@@ -169,11 +172,12 @@ export default {
// console.log(res.data.examine_status, "res.data.examine_status"); // console.log(res.data.examine_status, "res.data.examine_status");
//订单支付金额 //订单支付金额
window.localStorage.setItem("has_amount", res.data.has_amount); let code =this.$store.state.indexIdentity
window.localStorage.setItem("campsite_id", res.data.campsite_id); window.localStorage.setItem("has_amount"+code, res.data.has_amount);
window.localStorage.setItem("order_no", res.data.order_no); window.localStorage.setItem("campsite_id"+code, res.data.campsite_id);
window.localStorage.setItem("examine_status", res.data.examine_status); //返回错误原因 window.localStorage.setItem("order_no"+code, res.data.order_no);
window.localStorage.setItem("examine_reason", res.data.examine_reason); //资料审核状态 window.localStorage.setItem("examine_status"+code, res.data.examine_status); //返回错误原因
window.localStorage.setItem("examine_reason"+code, res.data.examine_reason); //资料审核状态
// window.localStorage.setItem("achievement_path", res.data.achievement_path); //上传的图片 // window.localStorage.setItem("achievement_path", res.data.achievement_path); //上传的图片
const aPath = res.data.achievement_path; const aPath = res.data.achievement_path;
if (aPath) { if (aPath) {
...@@ -185,7 +189,7 @@ export default { ...@@ -185,7 +189,7 @@ export default {
}; };
return obj; return obj;
}); });
const code = Cookie.get("index-identity"); const 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(fileList) JSON.stringify(fileList)
......
...@@ -18,11 +18,12 @@ export default { ...@@ -18,11 +18,12 @@ export default {
name: "loginIndex", name: "loginIndex",
data() { data() {
return { return {
bigImg: window.localStorage.getItem("bk_pic"), bigImg: window.localStorage.getItem("bk_pic"+this.$store.state.indexIdentity),
}; };
}, },
created() { created() {
let bk_pic = window.localStorage.getItem("bk_pic"); let code = this.$store.state.indexIdentity;
let bk_pic = window.localStorage.getItem("bk_pic"+code);
if (bk_pic) { if (bk_pic) {
this.bigImg = bk_pic; this.bigImg = bk_pic;
} }
...@@ -31,7 +32,7 @@ export default { ...@@ -31,7 +32,7 @@ export default {
}, },
methods: { methods: {
toHome() { toHome() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/"+code); this.$router.push("/"+code);
} }
}, },
......
...@@ -132,13 +132,13 @@ export default { ...@@ -132,13 +132,13 @@ export default {
methods: { methods: {
// 忘记账号/密码 // 忘记账号/密码
forgetPwd() { forgetPwd() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/reset?code=" + code); this.$router.push("/reset?code=" + code);
}, },
// 去注册 // 去注册
register() { register() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/register?code=" + code); this.$router.push("/register?code=" + code);
}, },
// 改变密码显示状态 // 改变密码显示状态
...@@ -159,15 +159,15 @@ export default { ...@@ -159,15 +159,15 @@ export default {
} }
// this.$message.success("登录成功"); // this.$message.success("登录成功");
// 跳转到报名 // 跳转到报名
const code = Cookie.get("index-identity"); const 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.loginForm.phone); window.localStorage.setItem("phone" + code, this.loginForm.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", "system_color"+code,
res.data.cam.system_color res.data.cam.system_color
); );
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
// 请求接口 // 请求接口
import Cookie from "js-cookie" import Cookie from "js-cookie";
import { registerCode, setAccountInfo } from "r/index/register"; import { registerCode, setAccountInfo } from "r/index/register";
import { mobileCheck, checkStrong } from "@/common/utils.js"; import { mobileCheck, checkStrong } from "@/common/utils.js";
import { validatePassword } from "@/common/validator"; import { validatePassword } from "@/common/validator";
...@@ -189,8 +189,8 @@ export default { ...@@ -189,8 +189,8 @@ export default {
methods: { methods: {
// 去注册 // 去注册
toLogin() { toLogin() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/login?code="+code); this.$router.push("/login?code=" + code);
}, },
// 改变密码显示状态 // 改变密码显示状态
changePwdStatus() { changePwdStatus() {
...@@ -206,7 +206,6 @@ export default { ...@@ -206,7 +206,6 @@ export default {
this.show = false; this.show = false;
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.count > 0 && this.count <= timeLag) { if (this.count > 0 && this.count <= timeLag) {
this.count--; this.count--;
} else { } else {
this.show = true; this.show = true;
...@@ -260,20 +259,19 @@ export default { ...@@ -260,20 +259,19 @@ export default {
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
// 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", res.data.cam.name);
//获取主题色 //获取主题色
window.localStorage.setItem( window.localStorage.setItem(
"system_color", "system_color"+ code,
res.data.cam.system_color res.data.cam.system_color
); );
// 跳转到报名 // 跳转到报名
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/signUp/examInfo?code="+code); this.$router.push("/signUp/examInfo?code=" + code);
}); });
}); });
}, },
...@@ -282,7 +280,6 @@ export default { ...@@ -282,7 +280,6 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
// 注册输入 // 注册输入
.container { .container {
background: #ffffff; background: #ffffff;
......
...@@ -190,7 +190,7 @@ export default { ...@@ -190,7 +190,7 @@ export default {
methods: { methods: {
// 去注册 // 去注册
toLogin() { toLogin() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/login?code="+code); this.$router.push("/login?code="+code);
}, },
// 改变密码显示状态 // 改变密码显示状态
...@@ -260,8 +260,8 @@ export default { ...@@ -260,8 +260,8 @@ export default {
} }
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
// token存储 // token存储
let code = this.$store.state.indexIdentity;
window.localStorage.setItem("index-token"+code, res.token); window.localStorage.setItem("index-token"+code, res.token);
let code = Cookie.get("index-identity");
this.$router.push("/login?code="+code); this.$router.push("/login?code="+code);
}); });
}); });
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</el-header> </el-header>
<div class="com-container content"> <div class="com-container content">
<div class="title">{{ info.name }}</div> <div class="title">{{ info.name }}</div>
<div class="time">发布时间:{{ info.update_time }}</div> <!-- <div class="time">发布时间:{{ info.update_time }}</div> -->
<div v-html="info.student_recruitment_brochure"></div> <div v-html="info.student_recruitment_brochure"></div>
<!-- <div class="part"> <!-- <div class="part">
<span>第一部分</span> <span>第一部分</span>
...@@ -59,17 +59,16 @@ export default { ...@@ -59,17 +59,16 @@ export default {
}, },
created() { created() {
this.info = this.$store.state.info; this.info = this.$store.state.info;
//
// let url = location.href; //把当前页面的地址赋给变量 url
// // console.log(url)
// var times = url.split("?"); //分切变量 url 分隔符号为 "?"
// console.log
}, },
methods: { methods: {
toLogin() { toLogin() {
let code = Cookie.get("index-identity"); let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code); // console.log(window.localStorage.getItem("index-token"+code),'1111')
if (!window.localStorage.getItem("index-token" + code)) {
this.$router.push("/login?code=" + code);
} else {
this.$router.push("/signUp/examInfo?code=" + code);
}
}, },
}, },
components: { components: {
......
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