From 45001648074d601e0872f76a931189dbd5c5e3ea Mon Sep 17 00:00:00 2001 From: zegezy <1098696801@qq.com> Date: Mon, 9 May 2022 21:50:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=A8=A1=E5=BC=8F=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E9=AA=8C=E8=AF=81=E7=A0=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/系统管理/安全/登录.ms | 25 +++++++++++-------- .../src/main/resources/application-dev.yml | 4 ++- .../src/main/resources/application-online.yml | 4 ++- magic-boot/src/main/resources/application.yml | 3 +++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/data/magic-api/api/系统管理/安全/登录.ms b/data/magic-api/api/系统管理/安全/登录.ms index d7a5173..a60a20f 100644 --- a/data/magic-api/api/系统管理/安全/登录.ms +++ b/data/magic-api/api/系统管理/安全/登录.ms @@ -5,7 +5,7 @@ "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "登录", "createTime" : null, - "updateTime" : 1649256868582, + "updateTime" : 1651934194042, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -64,10 +64,10 @@ "requestBody" : "{\r\n \"username\": \"admin\",\r\n \"password\": \"123456\"\r\n}", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": \"8dbc9feb-410a-4c7f-8805-0013e5ae1363\",\n \"timestamp\": 1648818573075,\n \"executeTime\": 347\n}", + "responseBody" : "{\n \"code\": 0,\n \"message\": \"请输入验证码\",\n \"data\": null,\n \"timestamp\": 1651934108567,\n \"executeTime\": 5\n}", "description" : null, "requestBodyDefinition" : { - "name" : "", + "name" : "root", "value" : "", "description" : "", "required" : false, @@ -116,7 +116,7 @@ "expression" : "", "children" : [ { "name" : "code", - "value" : "200", + "value" : "0", "description" : "", "required" : false, "dataType" : "Integer", @@ -128,7 +128,7 @@ "children" : [ ] }, { "name" : "message", - "value" : "success", + "value" : "请输入验证码", "description" : "", "required" : false, "dataType" : "String", @@ -140,7 +140,7 @@ "children" : [ ] }, { "name" : "data", - "value" : "8dbc9feb-410a-4c7f-8805-0013e5ae1363", + "value" : "null", "description" : "", "required" : false, "dataType" : "Object", @@ -152,7 +152,7 @@ "children" : [ ] }, { "name" : "timestamp", - "value" : "1648818573075", + "value" : "1651934108567", "description" : "", "required" : false, "dataType" : "Long", @@ -164,7 +164,7 @@ "children" : [ ] }, { "name" : "executeTime", - "value" : "347", + "value" : "5", "description" : "", "required" : false, "dataType" : "Integer", @@ -189,9 +189,12 @@ import cn.hutool.http.useragent.UserAgentUtil import cn.hutool.http.useragent.UserAgent UserAgent ua = UserAgentUtil.parse(request.getHeaders("User-Agent")[0]) - -if(body.code != CodeCacheMap.get(body.uuid)){ - exit 0, '验证码错误' +if(env.get('verification-code.enable') == 'true'){ + if(!body.code){ + exit 0, '请输入验证码' + }else if(body.code != CodeCacheMap.get(body.uuid)){ + exit 0, '验证码错误' + } } var user diff --git a/magic-boot/src/main/resources/application-dev.yml b/magic-boot/src/main/resources/application-dev.yml index dcf3815..690030b 100644 --- a/magic-boot/src/main/resources/application-dev.yml +++ b/magic-boot/src/main/resources/application-dev.yml @@ -1 +1,3 @@ -super-password: 1xx \ No newline at end of file +super-password: 1xx +verification-code: + enable: false diff --git a/magic-boot/src/main/resources/application-online.yml b/magic-boot/src/main/resources/application-online.yml index 96aebb4..37bbe8c 100644 --- a/magic-boot/src/main/resources/application-online.yml +++ b/magic-boot/src/main/resources/application-online.yml @@ -1 +1,3 @@ -super-password: 123456 \ No newline at end of file +super-password: dangerous +magic-api: + web: diff --git a/magic-boot/src/main/resources/application.yml b/magic-boot/src/main/resources/application.yml index 823bc13..9f9cded 100644 --- a/magic-boot/src/main/resources/application.yml +++ b/magic-boot/src/main/resources/application.yml @@ -74,6 +74,9 @@ upload: # https,http transport-protocol: +verification-code: + enable: true + magic-api: web: /magic/web show-sql: true #配置打印SQL