From a3c0587a38069f28139442d37e4811e5b061a4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 10 Aug 2023 09:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E8=BD=AC=E4=B9=89=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PC/InterFace.Dash/src/store/modules/definition.js | 5 +++-- PC/UI.WinIn.FasterZ.Store/src/store/modules/definition.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PC/InterFace.Dash/src/store/modules/definition.js b/PC/InterFace.Dash/src/store/modules/definition.js index 74365e6..f8a6563 100644 --- a/PC/InterFace.Dash/src/store/modules/definition.js +++ b/PC/InterFace.Dash/src/store/modules/definition.js @@ -52,8 +52,9 @@ export function initDtoTypesAndEnums(res,typeName,apiName) { if(d.type.indexOf('Enums') >= 0){ d.apiBaseType = 'enums' d.isEnums = true - // -1 是去掉最后的'?'(todo:是否每个Enums类型都有?) - let enums_type = d.type.substring(0,d.type.length - 1) + // 有?的话去掉? + let _lastLength = d.type.lastIndexOf('?') >= 0 ? 1 : 0 + let enums_type = d.type.substring(0,d.type.length - _lastLength) // 通过type包含Enums的全字段-'?'匹配res.types中的值 let enums_list = res.types[enums_type] if(enums_list){ diff --git a/PC/UI.WinIn.FasterZ.Store/src/store/modules/definition.js b/PC/UI.WinIn.FasterZ.Store/src/store/modules/definition.js index 74365e6..f8a6563 100644 --- a/PC/UI.WinIn.FasterZ.Store/src/store/modules/definition.js +++ b/PC/UI.WinIn.FasterZ.Store/src/store/modules/definition.js @@ -52,8 +52,9 @@ export function initDtoTypesAndEnums(res,typeName,apiName) { if(d.type.indexOf('Enums') >= 0){ d.apiBaseType = 'enums' d.isEnums = true - // -1 是去掉最后的'?'(todo:是否每个Enums类型都有?) - let enums_type = d.type.substring(0,d.type.length - 1) + // 有?的话去掉? + let _lastLength = d.type.lastIndexOf('?') >= 0 ? 1 : 0 + let enums_type = d.type.substring(0,d.type.length - _lastLength) // 通过type包含Enums的全字段-'?'匹配res.types中的值 let enums_list = res.types[enums_type] if(enums_list){