pull/510/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent be998bbb74
commit 6b85fc2b7f

@ -6,18 +6,33 @@ import { deflate, GetCurrentViewPreViewImage } from '../Common/SerializeMaterial
import { FileServer } from '../DatabaseServices/FileServer';
import { Command } from '../Editor/CommandMachine';
import { RightPanelStore } from '../UI/Store/RightPanelStore/RightPanelStore';
import { appCache } from "../Common/AppCache";
export class Save implements Command
{
async exec()
{
let logo = await uploadLogo(GetCurrentViewPreViewImage());
if (!logo) return;
let fileServer = FileServer.GetInstance() as FileServer;
let fileData = app.FileOut().Data;
let file = deflate(JSON.stringify(fileData));
let file = JSON.stringify(fileData);
if (fileServer.m_CurFileId)
{
let finfo = appCache.get("f" + fileServer.m_CurFileId);
if (finfo && finfo.file)
{
if (finfo.file === file)
{
app.Editor.Prompt("文件已保存!");
return;
}
}
}
file = deflate(file);
let logo = await uploadLogo(GetCurrentViewPreViewImage());
if (!logo) return;
if (fileServer.m_CurFileId)
{
await fileServer.UpdateFile({ file_id: fileServer.m_CurFileId, file, logo });

@ -64,10 +64,10 @@ export class TopPanel extends React.Component<{ store?: TopPanelStore }, {}>
}
handleLoginOut = async () =>
{
this.props.store.isLogin = false;
let data = await Post(SignUrl.loginOut);
if (data.err_code === RequestStatus.Ok)
{
this.props.store.isLogin = false;
localStorage.removeItem(StoreageKeys.IsLogin);
}
}

Loading…
Cancel
Save