diff --git a/public/static/css/main.css b/public/static/css/main.css index 1b508443..9067665f 100644 --- a/public/static/css/main.css +++ b/public/static/css/main.css @@ -2688,7 +2688,7 @@ button:focus { .defultImage-mid { width: 136px; height: 136px; - background: url("/static/img/fileType/default.svg") no-repeat; + background: url("/static/img/fileType/default.svg") no-repeat center; background-size:80% 76%; } .folder { @@ -2731,7 +2731,7 @@ button:focus { .xls-mid, .xlsx-mid, .excel-mid { - background: url("/static/img/fileType/excel.svg") no-repeat; + background: url("/static/img/fileType/excel.svg") no-repeat center; background-size:80% 76%; } @@ -2741,7 +2741,7 @@ button:focus { } .ppt-mid, .pptx-mid { - background: url("/static/img/fileType/PPT.svg") no-repeat; + background: url("/static/img/fileType/PPT.svg") no-repeat center; background-size:80% 76%; } @@ -2749,7 +2749,7 @@ button:focus { background: url("/static/img/bgtupian.png") no-repeat -900px 0 } .pdf-mid { - background: url("/static/img/fileType/pdf.svg") no-repeat; + background: url("/static/img/fileType/pdf.svg") no-repeat center; background-size:80% 76%; } diff --git a/src/services/system.js b/src/services/system.js index 67064dd9..7db8c7b1 100644 --- a/src/services/system.js +++ b/src/services/system.js @@ -174,9 +174,9 @@ const system = { /** * 通知系统进入当前的工作空间 */ - entryProject: safeCall((projName, accountName, fileChangeHandler, initHandler, errorHandler = identity) => { - requestBySocket(io('init'), [accountName, projName].join('|')) - .then(response => initHandler(response.data)); + entryProject: safeCall(async (projName, accountName, fileChangeHandler, initHandler, errorHandler = identity) => { + const response = await requestBySocket(io('init'), [accountName, projName].join('|')); + initHandler(response.data); const watchSocket = io('subscriptionFileChange'); watchSocket.on('open', () => { watchSocket.send(projName); diff --git a/src/views/main_web/workspace/workspace.new.vue b/src/views/main_web/workspace/workspace.new.vue index a08541ca..e6797d9a 100644 --- a/src/views/main_web/workspace/workspace.new.vue +++ b/src/views/main_web/workspace/workspace.new.vue @@ -721,7 +721,7 @@ export default { this.fetchFoldersByProjId(); this.getNestNode(sessionStorage.templateID); - this.socketIns = system.entryProject( + system.entryProject( sessionStorage.projName, sessionStorage.accountName, this.onSocketFileChangeDetected.bind(this), (localWorkspacePrefix) => { this.localWorkspacePrefix = localWorkspacePrefix;}, @@ -732,7 +732,7 @@ export default { type:'error' }) } - ); + ).then(socketIns => { this.socketIns = socketIns; }); this.timerIns = setTimeout(() => { this.intervalTask(); }, 3000); }, destroyed: function () {