|
|
@@ -111,7 +111,7 @@ import I18nIcon from '@/layout/components/i18n-icon.vue';
|
|
|
import { getToken } from '@/utils/token-util';
|
|
|
import { login, getCaptcha, sub } from '@/api/login';
|
|
|
import { SYSTEM_NAME } from '@/config/setting';
|
|
|
-
|
|
|
+import { setCurrentUser } from '@/utils/token-util';
|
|
|
export default {
|
|
|
// eslint-disable-next-line vue/multi-word-component-names
|
|
|
name: 'Login',
|
|
|
@@ -178,12 +178,15 @@ export default {
|
|
|
localStorage.setItem(`userId-${SYSTEM_NAME}`, res.data.userId);
|
|
|
// 用户信息
|
|
|
if (res.data?.loginChangeGroupVOList.length > 0) {
|
|
|
- sessionStorage['currentUser'] = JSON.stringify({
|
|
|
- currentGroupId: res.data.loginChangeGroupVOList[0].groupId,
|
|
|
- currentRoleId:
|
|
|
- res.data.loginChangeGroupVOList[0].loginChangeRoleVOList[0]
|
|
|
- .roleId
|
|
|
- });
|
|
|
+ setCurrentUser(
|
|
|
+ {
|
|
|
+ currentGroupId: res.data.loginChangeGroupVOList[0].groupId,
|
|
|
+ currentRoleId:
|
|
|
+ res.data.loginChangeGroupVOList[0]
|
|
|
+ .loginChangeRoleVOList[0].roleId
|
|
|
+ },
|
|
|
+ this.form.remember
|
|
|
+ );
|
|
|
}
|
|
|
this.$store.commit('user/setUserInfo', res.data);
|
|
|
this.loading = false;
|