This commit is contained in:
王创世 2024-05-17 16:49:23 +08:00
parent 21b949a86a
commit 3e3a19ca65
3 changed files with 23 additions and 11 deletions

View File

@ -75,7 +75,8 @@
></t-pagination>
</div>
</div>
<t-dialog header="报名详情" :confirmBtn="null" :visible="infoMode" :onClose="onCloseMy" width="55%" top="50px">
<t-dialog header="报名详情" :confirmBtn="null" :visible="infoMode" :onClose="onCloseMy" width="65%" top="50px">
<div style="height: 600px;overflow-y: scroll;">
<t-table
rowKey="index"
:data="info_list"
@ -99,6 +100,7 @@
:showPageSize="false"
></t-pagination>
</div>
</div>
</t-dialog>
<t-dialog header="问卷统计" :confirmBtn="null" :visible="QuestionnaireMode" :onClose="onCloseMy" width="65%" top="50px">
<div style="height: 600px;overflow-y: scroll;">

View File

@ -4,7 +4,7 @@ const InitUserInfo = {
// 定义的state初始值
const state = {
token: localStorage.getItem('associationToken') || 'main_token', // 默认token不走权限
token: localStorage.getItem('associationToken') || '', // 默认token不走权限
userInfo: InitUserInfo,
association:localStorage.getItem('associationInfo') || '',
//apiUrl:'http://192.168.3.130',
@ -43,7 +43,7 @@ const actions = {
const mockLogin = async (userInfo) => {
// 登录请求流程
console.log(userInfo);
commit('setAssociation',userInfo[0]);
commit('setAssociation',userInfo);
return{
code: 200,
}
@ -51,23 +51,28 @@ const actions = {
const res = await mockLogin(userInfo);
if (res.code === 200) {
commit('setToken', 'main_token');
console.log('token',userInfo.token);
commit('setToken',userInfo.token);
} else {
return res;
}
},
async getUserInfo({ commit, state }) {
const mockRemoteUserInfo = async (token) => {
if (token === 'main_token') {
return {
name: 'td_main',
roles: ['ALL_ROUTERS'],
};
}
return {
name: 'td_dev',
roles: ['UserIndex', 'DashboardBase', 'login'],
};
// if (token === 'main_token') {
// return {
// name: 'td_main',
// roles: ['ALL_ROUTERS'],
// };
// }
// return {
// name: 'td_dev',
// roles: ['UserIndex', 'DashboardBase', 'login'],
// };
};
const res = await mockRemoteUserInfo(state.token);

View File

@ -28,7 +28,12 @@ instance.interceptors.request.use((config) => {
}else{
var association=JSON.parse(store.state.user.association);
}
config.data = { ...config.data, association_id: association.id };
const token = store.state.user.token;
if (token) {
// 添加token请求头
config.headers.token = token;
}
config.data = { ...config.data, association_id: association.id};
}
console.log(config.data);