|
@@ -29,23 +29,17 @@
|
|
|
|
|
|
<script>
|
|
|
import encryption from "../../utils/crypto.js";
|
|
|
+ import {loginAfterHandle} from '../../utils/loginHandle.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
index:0,
|
|
|
- appHospSign:'tYAoFaa20yCAgaiy',//app端更新hospSign
|
|
|
+ appHospSign:'IGlcn5nc4xBWc08C',//app端更新hospSign
|
|
|
showInputModal:false,
|
|
|
hospSign: '', // 医院标识
|
|
|
username: '', // 用户名
|
|
|
password: '', // 密码
|
|
|
version:'',
|
|
|
- rolList: [
|
|
|
- {permission: 1, name: '管理员', pagePath: 'pages/situationsCenter/situationsCenter'}, // targetIndexs:targetList种对应的下标
|
|
|
- {permission: 2, name: '查核组长',pagePath: 'pages/situationsCenter/situationsCenter'},
|
|
|
- {permission: 3, name: '查核组员', pagePath: 'pages/situationsCenter/situationsCenter'},
|
|
|
- {permission: 4, name: '单位负责人', pagePath: 'pages/mission/mission'},
|
|
|
- {permission: 5, name: '改善者', pagePath: 'pages/mission/mission'}
|
|
|
- ],
|
|
|
deviceInfo:{}
|
|
|
}
|
|
|
},
|
|
@@ -120,39 +114,14 @@
|
|
|
password: encryption(this.password),
|
|
|
hospSign:hospSign,
|
|
|
nowPermission:nowPermission
|
|
|
- // hospSign:'tYAoFaa20yCAgaiy'
|
|
|
}
|
|
|
}
|
|
|
}).then((data) => {
|
|
|
- console.log('loginResData',data);
|
|
|
if (data) {
|
|
|
- uni.setStorageSync('hiId', data.hiId);
|
|
|
- uni.setStorageSync('permissions', data.permissions);
|
|
|
- uni.setStorageSync('token', data.token);
|
|
|
- uni.setStorageSync('code', data.code);
|
|
|
- uni.setStorageSync('nowPermission', data.nowPermission);
|
|
|
- uni.setStorageSync('id', data.id);
|
|
|
- uni.setStorageSync('name', data.name);
|
|
|
- uni.setStorageSync('hospSign',hospSign);
|
|
|
- this.rolToTarget(data.nowPermission)
|
|
|
+ loginAfterHandle(data,hospSign);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- clickModalhandle(){
|
|
|
-
|
|
|
- },
|
|
|
- //角色和对应的跳转页面
|
|
|
- rolToTarget(nowPermission) {
|
|
|
- if(nowPermission != 0){
|
|
|
- let current = this.rolList.find(item => item.permission == nowPermission);
|
|
|
- if(current){
|
|
|
- // 页面跳转
|
|
|
- uni.redirectTo({
|
|
|
- url: `/${current.pagePath}`
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|