|
@@ -13,6 +13,7 @@ const state = () => ({});
|
|
|
const mutations = {};
|
|
|
|
|
|
const actions = {
|
|
|
+ // 展会列表
|
|
|
async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
|
|
|
const res = await this.$axios.$get(api.trainliveInfo, {
|
|
|
skip,
|
|
@@ -21,24 +22,29 @@ const actions = {
|
|
|
});
|
|
|
return res;
|
|
|
},
|
|
|
+ // 展会创建
|
|
|
async create({ commit }, payload) {
|
|
|
const res = await this.$axios.$post(`${api.trainliveInfo}`, payload);
|
|
|
return res;
|
|
|
},
|
|
|
+ // 展会详情
|
|
|
async fetch({ commit }, payload) {
|
|
|
const res = await this.$axios.$get(`${api.trainliveInfo}/${payload}`);
|
|
|
return res;
|
|
|
},
|
|
|
+ // 展会修改
|
|
|
async update({ commit }, { id, ...info } = {}) {
|
|
|
const res = await this.$axios.$post(`${api.trainliveInfo}/update/${id}`, {
|
|
|
...info,
|
|
|
});
|
|
|
return res;
|
|
|
},
|
|
|
+ // 展会删除
|
|
|
async delete({ commit }, payload) {
|
|
|
const res = await this.$axios.$delete(`${api.trainliveInfo}/${payload}`);
|
|
|
return res;
|
|
|
},
|
|
|
+ // 展会用户登录
|
|
|
async login({ commit, dispatch }, { user, router, path = '/', needReturn = false, typeCheck = false, isWx = false, needNotice = true }) {
|
|
|
let res = await this.$axios.$post(`${api.logininfo}`, user);
|
|
|
if (res.errcode == '0') {
|
|
@@ -59,6 +65,15 @@ const actions = {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ // 用户列表
|
|
|
+ async userQuery({ commit }, { skip = 0, limit = undefined, id, ...info } = {}) {
|
|
|
+ const res = await this.$axios.$get(`${api.userloginInfo}/${id}`, {
|
|
|
+ skip,
|
|
|
+ limit,
|
|
|
+ ...info,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ },
|
|
|
// 参加用户
|
|
|
async userCreate({ commit }, { id, ...info } = {}) {
|
|
|
const res = await this.$axios.$post(`${api.trainliveInfo}/user/${id}`, {
|
|
@@ -66,18 +81,21 @@ const actions = {
|
|
|
});
|
|
|
return res;
|
|
|
},
|
|
|
+ // 用户删除
|
|
|
async userDelete({ commit }, { id, ...info } = {}) {
|
|
|
const res = await this.$axios.$delete(`${api.trainliveInfo}/user/${id}`, {
|
|
|
...info,
|
|
|
});
|
|
|
return res;
|
|
|
},
|
|
|
+ // 用户修改
|
|
|
async userUpdate({ commit }, { id, ...info } = {}) {
|
|
|
const res = await this.$axios.$post(`${api.trainliveInfo}/user/update/${id}`, {
|
|
|
...info,
|
|
|
});
|
|
|
return res;
|
|
|
},
|
|
|
+ // 用户登录
|
|
|
async userLogin({ commit }, { id, ...info } = {}) {
|
|
|
const res = await this.$axios.$post(`${api.userloginInfo}/login/${id}`, {
|
|
|
...info,
|
|
@@ -98,12 +116,23 @@ const actions = {
|
|
|
message: `失败原因:${res.errmsg || '登陆失败'}`,
|
|
|
type: 'error',
|
|
|
});
|
|
|
+ return res;
|
|
|
}
|
|
|
},
|
|
|
+ // 用户退出
|
|
|
async userLogout({ commit }, { id } = {}) {
|
|
|
window.localStorage.removeItem('user');
|
|
|
- const res = await this.$axios.$post(`${api.userloginInfo}/logout/${id}`);
|
|
|
commit('deleteUser');
|
|
|
+ const res = await this.$axios.$post(`${api.userloginInfo}/logout/${id}`);
|
|
|
+ },
|
|
|
+ // 用户定时请求
|
|
|
+ async userLonger({ commit }, { skip = 0, limit = undefined, id, ...info } = {}) {
|
|
|
+ const res = await this.$axios.$get(`${api.userloginInfo}/longer/${id}`, {
|
|
|
+ skip,
|
|
|
+ limit,
|
|
|
+ ...info,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
},
|
|
|
};
|
|
|
|