邀请成员接口登录过去清除缓存的登录信息

This commit is contained in:
付民康
2025-03-28 10:11:47 +08:00
parent 20595faacf
commit c36bb00e3a

View File

@@ -145,6 +145,7 @@ import {
import {getUserInfo} from "@/api/user"; import {getUserInfo} from "@/api/user";
import dayjs from "dayjs"; import dayjs from "dayjs";
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import { useAccount } from '@/utils/hooks/useAccount';
const userInfo = shallowRef<UserInfoType>({ const userInfo = shallowRef<UserInfoType>({
username: '', username: '',
@@ -207,6 +208,9 @@ const memberRoleMap = {
[OrganizationMemberRoleEnum.MEMBER]: '成员' [OrganizationMemberRoleEnum.MEMBER]: '成员'
}; };
const { accountInfo, RemoveInfo } = useAccount();
init(); init();
function init() { function init() {
queryUserInfo(); queryUserInfo();
@@ -246,6 +250,7 @@ function confirmCreateOrganizationBtnClick() {
} }
async function createOrganization() { async function createOrganization() {
debugger
const params = { const params = {
groupName: createFormData.organizationName, groupName: createFormData.organizationName,
groupDesc: createFormData.organizationProfile groupDesc: createFormData.organizationProfile
@@ -254,6 +259,9 @@ async function createOrganization() {
try { try {
const res = await createOrganizationApi(params); const res = await createOrganizationApi(params);
if (res.data?.code !== 200) { if (res.data?.code !== 200) {
if(res.data?.msg === '未登录') {
RemoveInfo()
}
Message.error(res.data?.msg || '创建失败'); Message.error(res.data?.msg || '创建失败');
} else { } else {
closeOrganizationModal(); closeOrganizationModal();