!1092 优化:共享材质ui,踢下线清理缓存

pull/1092/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent a1f11fe6c7
commit ba753fb63c

@ -3,7 +3,7 @@ import { ShowLinesToaster } from "../UI/Components/Toaster";
import { TopPanelStore } from "../UI/Store/TopPanelStore";
import { ChangeZoneUrls, BuyCadUrl, ImgsUrl } from "./HostUrl";
import { ReportError } from "./ErrorMonitoring";
import { StoreageKeys } from "./StoreageKeys";
import { userConfigStore } from "../UI/Store/UserConfigStore";
export enum DirectoryId
{
@ -68,10 +68,10 @@ export async function Post(url: string, body?: BodyInit, isShowErrMsg = true): P
timeout: 8888
}, "44444");
case RequestStatus.NoLogin:
localStorage.setItem(StoreageKeys.IsLogin, "");
store.isLogin = false;
store.m_FileManageOpen = false;
store.openMain = true;
userConfigStore.ClearUserData();
break;
case RequestStatus.NoBuy:
case RequestStatus.NoBuy1:

@ -202,10 +202,6 @@
&>div {
min-height: unset;
height: 100%;
&>div {
height: 100%;
}
}
}
}

@ -4,7 +4,6 @@ import * as React from 'react';
import { app } from '../../ApplicationServices/Application';
import { SignUrl } from '../../Common/HostUrl';
import { Post, RequestStatus } from '../../Common/Request';
import { StoreageKeys } from "../../Common/StoreageKeys";
import { FileServer } from '../../DatabaseServices/FileServer';
import { commandMachine } from '../../Editor/CommandMachine';
import { CommandState } from '../../Editor/CommandState';
@ -14,10 +13,8 @@ import { TopPanelStore } from '../Store/TopPanelStore';
import { SettingPanel } from './SettingPanel/SettingPanel';
import SoucePanel from './SourceManage/SoucePanel';
import { AppToaster } from './Toaster';
import { RemoveCustonCommand } from '../../Editor/CommandRegister';
import { CommandNames } from '../../Common/CommandNames';
import { appCache } from '../../Common/AppCache';
import { templateTagCommand } from '../../Add-on/Template/TemplateTagCommand';
import { userConfigStore } from '../Store/UserConfigStore';
interface TopPanelState
{
@ -77,11 +74,7 @@ export class TopPanel extends React.Component<{ store?: TopPanelStore; }, {}>
let data = await Post(SignUrl.loginOut);
if (data.err_code === RequestStatus.Ok)
{
RemoveCustonCommand();
localStorage.removeItem(StoreageKeys.IsLogin);
templateTagCommand.ClearTagList();
appCache.clear();
app.WebSocket.Close();
userConfigStore.ClearUserData();
}
};
render()

@ -26,7 +26,7 @@ import { FileServer } from "../../DatabaseServices/FileServer";
import { CommandServer } from "../../DatabaseServices/CommandServer";
import { TemplateTagCommand, templateTagCommand } from "../../Add-on/Template/TemplateTagCommand";
import { GetIndexDBID } from "../../Common/Utils";
import { RegistCustomCommand } from "../../Editor/CommandRegister";
import { RegistCustomCommand, RemoveCustonCommand } from "../../Editor/CommandRegister";
import { updateBoardInfoStore } from "./UpdateBoardInfoStore";
type BehindConfigType = { option: BehindBoardOption, processData: BoardProcessOption, grooveData: IGrooveOption; };
@ -479,6 +479,15 @@ export class UserConfigStore extends Singleton
});
}
}
ClearUserData()
{
RemoveCustonCommand();
localStorage.removeItem(StoreageKeys.IsLogin);
templateTagCommand.ClearTagList();
appCache.clear();
app.Editor.ModalManage.DestoryAll();
app.WebSocket.Close();
}
}
export const userConfigStore = UserConfigStore.GetInstance() as UserConfigStore;

Loading…
Cancel
Save