修改接口
authorqiaowei <jov123@163.com>
Mon, 15 Jul 2019 05:41:30 +0000 (13:41 +0800)
committerqiaowei <jov123@163.com>
Mon, 15 Jul 2019 05:41:37 +0000 (13:41 +0800)
payapi/src/main/kotlin/com/supwisdom/dlpay/mobile/MobileApi.kt

index cf71a6d..fb20554 100644 (file)
@@ -25,6 +25,9 @@ import org.springframework.web.bind.annotation.RestController
 import org.springframework.web.bind.annotation.RequestParam
 import java.time.Duration
 import java.util.Calendar
+import org.bouncycastle.cms.RecipientId.password
+
+
 
 
 @RestController
@@ -145,6 +148,9 @@ class ApiInit {
         if (pwd.isEmpty() || repwd.isEmpty() || pwd.length < 6) {
             return JsonResult.error("请重新设置密码,密码不能小于6位字符")
         }
+        if (!pwd.matches(Regex("^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$"))) {
+            return JsonResult.error("密码必须包含数字和字符,长度6~32位")
+        }
         if (pwd != repwd) {
             return JsonResult.error("两次密码不一致")
         }