Commit 5ddadbdd authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-修改请求-disCode

parent 75e45e50
/* eslint-disable */
import {request} from '../network'
import {request} from '../network';
import store from '@/store';
// 登录
export function login(data) {
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/auth/login',
......
......@@ -6,6 +6,7 @@ import store from '@/store';
// 添加地址
export function setAddress(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/download/setAddress ',
......@@ -15,6 +16,7 @@ export function setAddress(data) {
// 获取地址
export function getAddress(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/download/getAddress ',
......
......@@ -57,6 +57,7 @@ export function getStudentWork(data) {
// 提交营地作业
export function subStudentWork(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/download/subStudentWork',
......
......@@ -6,6 +6,7 @@ import store from '@/store';
// 获取资料(个人信息)
export function getAccountInfo(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/getAccountInfo',
......@@ -16,6 +17,7 @@ export function getAccountInfo(data) {
// 保存个人资料
export function setAccountInfo(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/setAccountInfo',
......
......@@ -32,6 +32,7 @@ export function getCamInfo(code) {
// 登录
export function login(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/auth/login',
......
......@@ -6,6 +6,7 @@ import store from '@/store';
// 报名初始化
export function getWxConfig(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'get',
url: '/web/pay/getWxPreselectionConfig',
......
......@@ -5,6 +5,7 @@ import store from '@/store';
// 报名初始化
export function signUpInit(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/signUpInit',
......@@ -15,6 +16,7 @@ export function signUpInit(data) {
// 状态回退
export function signBack(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/signBack',
......@@ -25,6 +27,7 @@ export function signBack(data) {
// 确认报名须知
export function setSignShould(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/setSignShould',
......@@ -35,6 +38,7 @@ export function setSignShould(data) {
// 绑定邀请码
export function setInviteCode(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/setInviteCode',
......@@ -45,6 +49,7 @@ export function setInviteCode(data) {
// 页面个人获取
export function getAccount(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/getAccount',
......@@ -95,6 +100,7 @@ export function delPayingPic(data) {
// 页面个人信息保存
export function setAccount(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/signUp/setAccount',
......@@ -126,6 +132,7 @@ export function getSchool(data) {
//埋点
export function setLog(data) {
data['identity'] = store.state.indexIdentity;
data['disCode'] = store.state.disCode;
return request({
method: 'post',
url: '/web/auth/setLog',
......
......@@ -203,6 +203,10 @@ router.beforeEach((to, from, next) => {
from.fullPath != '/baseReset') {
store.commit('setPreviousPath', from.fullPath);
}
if (to.query && to.query.disCode) {
store.commit('setDisCode', to.query.disCode);
}
let toLogin = "/login",
toRegister = "/register",
toReset = "/reset",
......@@ -223,7 +227,7 @@ router.beforeEach((to, from, next) => {
let token = window.localStorage.getItem("index-token-all");
//检查登陆情况
if (token) {
next("/" + code);
return next("/" + code);
} else {
return next();
}
......
......@@ -13,6 +13,7 @@ let state = {
// 数据
data: [],
indexIdentity: localStorage.getItem("index-identity") || "",
disCode: localStorage.getItem("index-disCode") || "",
human: 0,//清华人文学院
baseSchool: 0,//基地
configJson: {}, //分营地填写资料字段
......
......@@ -24,6 +24,10 @@ export default {
state.indexIdentity = code;
window.localStorage.setItem('index-identity', code);
},
setDisCode(state, code) {
state.disCode = code;
window.localStorage.setItem('index-disCode', code);
},
setActiveIndex(state, path) {
let key = path.split('/')[1] == 'active' ? '/' + path.split('/')[1] : path;
state.activeIndex = key;
......
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