Commit 97921c6ac431330d60341259d80c97906e4a42e1

Authored by fengtao
1 parent e8d5527c

perf(src/packages): 优化3D编辑器,服务端抛错,页面没有任何提示信息

@@ -178,7 +178,7 @@ function MenubarFile(editor) { @@ -178,7 +178,7 @@ function MenubarFile(editor) {
178 }) 178 })
179 success('保存成功') 179 success('保存成功')
180 } catch (e) { 180 } catch (e) {
181 - error(e?.response?.data?.message) 181 + error(e?.message || e?.msg || '网络错误')
182 } finally { 182 } finally {
183 stop() 183 stop()
184 } 184 }
@@ -14,6 +14,9 @@ export function saveOrUpdateThreeJsModel(params) { @@ -14,6 +14,9 @@ export function saveOrUpdateThreeJsModel(params) {
14 data: params['data'], 14 data: params['data'],
15 timeout: 30 * 1000 15 timeout: 30 * 1000
16 }, 16 },
  17 + {
  18 + errorMessageMode: ''
  19 + }
17 ) 20 )
18 } 21 }
19 22
@@ -21,17 +24,27 @@ export function saveOrUpdateThreeJsModel(params) { @@ -21,17 +24,27 @@ export function saveOrUpdateThreeJsModel(params) {
21 * @description: 3D模型 获取 api 24 * @description: 3D模型 获取 api
22 */ 25 */
23 export function getThreeJsModel(id) { 26 export function getThreeJsModel(id) {
24 - return defHttp.get({  
25 - url: API['URL'] + '/' + id  
26 - }) 27 + return defHttp.get(
  28 + {
  29 + url: API['URL'] + '/' + id
  30 + },
  31 + {
  32 + errorMessageMode: ''
  33 + }
  34 + )
27 } 35 }
28 36
29 /** 37 /**
30 - * @description: 3D模型 获取json数据 api 38 + * @description: 3D模型 获取json数据 api
31 */ 39 */
32 export function getThreeJsModelByJson(id) { 40 export function getThreeJsModelByJson(id) {
33 - return defHttp.get({  
34 - url: API['URL'] + '/json' +'/'+id + '/root.json',  
35 - timeout: 30 * 1000  
36 - })  
37 -}  
  41 + return defHttp.get(
  42 + {
  43 + url: API['URL'] + '/json' + '/' + id + '/root.json',
  44 + timeout: 30 * 1000
  45 + },
  46 + {
  47 + errorMessageMode: ''
  48 + }
  49 + )
  50 +}
@@ -61,7 +61,7 @@ editor.storage.init(async function () { @@ -61,7 +61,7 @@ editor.storage.init(async function () {
61 if (!fileData) return 61 if (!fileData) return
62 await editor.fromJSON(fileData) 62 await editor.fromJSON(fileData)
63 } catch (e) { 63 } catch (e) {
64 - error(e?.response?.data?.message) 64 + error(e?.message || e?.msg || '网络错误')
65 } finally { 65 } finally {
66 stop() 66 stop()
67 } 67 }