From 6ca1166e59cbabcdc169e7c13eb60e8d511423dd Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 7 Aug 2019 10:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=95=E8=8E=B7=E5=9B=BE=E7=BA=B8=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=A4=B1=E8=B4=A5=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/FileServer.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/DatabaseServices/FileServer.ts b/src/DatabaseServices/FileServer.ts index 0c535d3b0..9859e9b2a 100644 --- a/src/DatabaseServices/FileServer.ts +++ b/src/DatabaseServices/FileServer.ts @@ -68,12 +68,19 @@ export class FileServer extends Singleton { if (this.m_CurFileId !== fid) { - let info = await this.GetFileInfo(fid); - app.OpenFile(new CADFiler(JSON.parse(info.file))); - this.m_CurFileId = fid; - this.SaveCurrentFileInfo({ file_id: fid, name: info.name }); - appUi.setDocumentName(info.name); - RightPanelStore.GetInstance().lightStore.InitScene(); + try + { + let info = await this.GetFileInfo(fid); + app.OpenFile(new CADFiler(JSON.parse(info.file))); + this.m_CurFileId = fid; + this.SaveCurrentFileInfo({ file_id: fid, name: info.name }); + appUi.setDocumentName(info.name); + RightPanelStore.GetInstance().lightStore.InitScene(); + } + catch (error) + { + app.Editor.Prompt("打开图纸失败,可能图纸是由更新的版本创建."); + } } } //读取文件列表