import { useLoginUserStore } from '@/stores/loginUser' const loginUserStore = useLoginUserStore() export function useLoginSuccess() { /** * 登录成功后的操作 */ const loginSuccess = (user) => { 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 }; }