update
1.更新im(专业人员/操作人员单点登陆,因为im模块)
This commit is contained in:
+2
-2
@@ -92,8 +92,8 @@ export function getPermCode() {
|
||||
return defHttp.get({ url: Api.GetPermCode });
|
||||
}
|
||||
|
||||
export function doLogout() {
|
||||
return defHttp.get({ url: Api.Logout });
|
||||
export function doLogout(isNeedResponse = true) {
|
||||
return defHttp.get({ url: Api.Logout }, { isTransformResponse: isNeedResponse });
|
||||
}
|
||||
|
||||
export function getCodeInfo(currdatetime) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import { JDragConfigEnum } from '/@/enums/jeecgEnum';
|
||||
import { useSso } from '/@/hooks/web/useSso';
|
||||
import { getDictCache, setDictCache } from '/@/utils/dict';
|
||||
import { loginAnYanApi } from '/@/views/system/loginmini/login.api';
|
||||
import { message, notification } from 'ant-design-vue';
|
||||
|
||||
interface UserState {
|
||||
userInfo: Nullable<UserInfo>;
|
||||
@@ -321,6 +322,44 @@ export const useUserStore = defineStore({
|
||||
}
|
||||
goLogin && (await router.push(PageEnum.BASE_LOGIN));
|
||||
},
|
||||
async passiveLogout() {
|
||||
if (this.getToken) {
|
||||
try {
|
||||
await doLogout(false);
|
||||
} catch {
|
||||
console.log('注销Token失败');
|
||||
}
|
||||
}
|
||||
|
||||
// //update-begin-author:taoyan date:2022-5-5 for: src/layouts/default/header/index.vue showLoginSelect方法 获取tenantId 退出登录后再次登录依然能获取到值,没有清空
|
||||
// let username:any = this.userInfo && this.userInfo.username;
|
||||
// if(username){
|
||||
// removeAuthCache(username)
|
||||
// }
|
||||
// //update-end-author:taoyan date:2022-5-5 for: src/layouts/default/header/index.vue showLoginSelect方法 获取tenantId 退出登录后再次登录依然能获取到值,没有清空
|
||||
|
||||
this.setToken('', false);
|
||||
this.setSessionTimeout(false);
|
||||
this.setUserInfo(null, false);
|
||||
this.setLoginInfo(null, false);
|
||||
this.setTenant(null);
|
||||
//update-begin-author:liusq date:2022-5-5 for:退出登录后清除拖拽模块的接口前缀
|
||||
localStorage.removeItem(JDragConfigEnum.DRAG_BASE_URL);
|
||||
//update-end-author:liusq date:2022-5-5 for: 退出登录后清除拖拽模块的接口前缀
|
||||
|
||||
//如果开启单点登录,则跳转到单点统一登录中心
|
||||
const openSso = useGlobSetting().openSso;
|
||||
if (openSso == 'true') {
|
||||
await useSso().ssoLoginOut();
|
||||
}
|
||||
await router.push(PageEnum.BASE_LOGIN).then(() => {
|
||||
notification.open({
|
||||
message: '提示',
|
||||
description: '检测到您的账号在另一台设备登录,当前已退出登陆。若非本人操作,请立即检查账号安全。',
|
||||
duration: null,
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 登录事件
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
import { imAddressSrc } from '/@/utils/imAddressSrc';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
const stat = ref<Object>({ emeResRate: 0, seriousRate: 0 });
|
||||
@@ -194,6 +195,9 @@
|
||||
case 'permissionError':
|
||||
message.error(result.msg);
|
||||
break;
|
||||
case 'kickOut':
|
||||
useUserStore().passiveLogout();
|
||||
break;
|
||||
}
|
||||
};
|
||||
const closeLoading = () => {
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
|
||||
import { useRoute } from 'vue-router';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const props = defineProps({
|
||||
imProps: Object,
|
||||
});
|
||||
@@ -222,8 +223,12 @@
|
||||
case 'permissionError':
|
||||
message.error(result.msg);
|
||||
break;
|
||||
case 'kickOut':
|
||||
useUserStore().passiveLogout();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const closeLoading = () => {
|
||||
loadingVisible.value = false;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [];
|
||||
|
||||
export const searchScheme: FormSchema[] = [];
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable"> </BasicTable>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { list } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.api';
|
||||
import { columns, searchScheme } from '/@/views/healthMonitor/anY/cottage/cottage.data';
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
immediate: true,
|
||||
canResize: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchScheme,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, {}, {}] = tableContext;
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [];
|
||||
|
||||
export const searchScheme: FormSchema[] = [];
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable"> </BasicTable>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { list } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.api';
|
||||
import { columns, searchScheme } from '/@/views/healthMonitor/anY/physical/physical.data';
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
immediate: true,
|
||||
canResize: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchScheme,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, {}, {}] = tableContext;
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
Reference in New Issue
Block a user