1234567891011121314151617181920212223242526 |
- import { useLoginUserStore } from '@/stores/loginUser'
- const loginUserStore = useLoginUserStore()
- export function useLoginSuccess() {
- /**
- * 登录成功后的操作
- */
- const loginSuccess = (user) => {
- loginUserStore.setLoginHospital(user.infoPermission.hospitals);
- loginUserStore.setLoginUser(user.user);
- loginUserStore.setLoginUserMenu(user.menu);
- // 判断用户标识是否为处理人
- if (user.user.engineer === 1) {
- uni.reLaunch({
- url: '/pages/incidentList/incidentList'
- })
- } else {
- uni.reLaunch({
- url: '/pages/repairEntrance/repairEntrance'
- })
- }
- }
- return {
- loginSuccess
- };
- }
|