|
@@ -29,7 +29,14 @@
|
|
|
data() {
|
|
|
return {
|
|
|
username: '', // 用户名
|
|
|
- password: '' // 密码
|
|
|
+ password: '', // 密码
|
|
|
+ rolList: [
|
|
|
+ {permission: 1, name: '管理员', pagePath: 'pages/creatingSituations/creatingSituations'}, // targetIndexs:targetList种对应的下标
|
|
|
+ {permission: 2, name: '查核组长',pagePath: 'pages/creatingSituations/creatingSituations'},
|
|
|
+ {permission: 3, name: '查核组员', pagePath: 'pages/creatingSituations/creatingSituations'},
|
|
|
+ {permission: 4, name: '单位负责人', pagePath: 'pages/creatingSituations/creatingSituations'},
|
|
|
+ {permission: 5, name: '改善者', pagePath: 'pages/mission/mission'}
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -46,12 +53,25 @@
|
|
|
}
|
|
|
}).then((data) => {
|
|
|
if (data) {
|
|
|
- uni.setStorageSync('token', data.hiId);
|
|
|
- uni.setStorageSync('token', data.permissions);
|
|
|
+ uni.setStorageSync('hiId', data.hiId);
|
|
|
+ uni.setStorageSync('permissions', data.permissions);
|
|
|
uni.setStorageSync('token', data.token);
|
|
|
- uni.setStorageSync('token', data.nowPermission);
|
|
|
+ uni.setStorageSync('nowPermission', data.nowPermission);
|
|
|
+ this.rolToTarget(data.nowPermission)
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ //角色和对应的跳转页面
|
|
|
+ rolToTarget(nowPermission) {
|
|
|
+ if(nowPermission != 0){
|
|
|
+ let current = this.rolList.find(item => item.permission == nowPermission);
|
|
|
+ if(current){
|
|
|
+ // 页面跳转
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/${current.pagePath}`
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed:{
|