From 4454daa9e07af7c7202c386e533ea055bb79f0df Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 18 Nov 2024 23:17:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(open):=20=E4=BC=98=E5=8C=96=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=AE=A1=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/frontend/AddModal.ftl | 8 +++---- .../handler/SaCheckPermissionHandler.java | 2 +- .../continew/admin/open/mapper/AppMapper.java | 15 +++++++++++- .../open/service/impl/AppServiceImpl.java | 23 ++++++------------- .../admin/open/util/ApiSignCheckUtils.java | 6 ++--- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/AddModal.ftl b/continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/AddModal.ftl index a5250624..83983352 100644 --- a/continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/AddModal.ftl +++ b/continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/AddModal.ftl @@ -41,6 +41,10 @@ const options: Options = { btns: { hide: true }, } +const { form, resetForm } = useForm({ + // todo 待补充 +}) + const columns: Columns = reactive([ <#list fieldConfigs as fieldConfig> <#if fieldConfig.showInForm> @@ -81,10 +85,6 @@ const columns: Columns = reactive([ ]) -const { form, resetForm } = useForm({ - // todo 待补充 -}) - // 重置 const reset = () => { formRef.value?.formRef?.resetFields() diff --git a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java index 3a311119..abe438b6 100644 --- a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java +++ b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/handler/SaCheckPermissionHandler.java @@ -41,7 +41,7 @@ public class SaCheckPermissionHandler implements SaAnnotationHandlerInterface {} \ No newline at end of file +public interface AppMapper extends BaseMapper { + + /** + * 根据 Access Key 查询 + * + * @param accessKey Access Key + * @return 应用信息 + */ + @Select("select * from sys_app where access_key = #{accessKey}") + AppDO selectByAccessKey(@FieldEncrypt @Param("accessKey") String accessKey); +} \ No newline at end of file diff --git a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java index f6f60e3f..4cd7d112 100644 --- a/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java +++ b/continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/service/impl/AppServiceImpl.java @@ -33,7 +33,7 @@ import top.continew.admin.open.service.AppService; import top.continew.starter.core.constant.StringConstants; import top.continew.starter.extension.crud.service.impl.BaseServiceImpl; -import java.time.LocalDateTime; +import java.util.Optional; /** * 应用业务实现 @@ -74,31 +74,22 @@ public class AppServiceImpl extends BaseServiceImpl paramNames = saRequest.getParamNames(); - return paramNames.stream().anyMatch(paramName -> paramName.equals("sign")); + return paramNames.stream().anyMatch(SaSignTemplate.sign::equals); } - }