feat:
1. prod
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package org.springblade.modules.app.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-common")
|
||||
@Tag(name = "APP基础接口", description = "APP基础接口")
|
||||
public class APPCommonController {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
|
||||
/**
|
||||
* 最新版本
|
||||
*/
|
||||
@GetMapping("/latest-version")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "最新版本")
|
||||
public R<Boolean> hasChangedPassword() {
|
||||
return R.data(userService.hasChangedPassword());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.springblade.modules.app.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Hidden
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/app-mall")
|
||||
@Tag(name = "APP用户接口", description = "APP用户接口")
|
||||
public class APPMallController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springblade.modules.auth.endpoint;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -21,10 +22,13 @@ import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.resource.builder.SmsBuilder;
|
||||
import org.springblade.modules.resource.utils.AliyunDynpsService;
|
||||
import org.springblade.modules.resource.utils.SmsUtil;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.sql.Wrapper;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -60,6 +64,8 @@ public class Oauth2SmsEndpoint {
|
||||
|
||||
private final AliyunDynpsService dynpsService;
|
||||
|
||||
private final IUserService service;
|
||||
|
||||
/**
|
||||
* 短信验证码发送
|
||||
*
|
||||
@@ -100,10 +106,8 @@ public class Oauth2SmsEndpoint {
|
||||
Boolean registerOpen = Func.toBoolean(ParamCache.getValue(REGISTER_USER_VALUE), false);
|
||||
|
||||
// 校验手机是否已注册,防止恶意发送验证码
|
||||
OAuth2Request request = OAuth2Request.create();
|
||||
request.setTenantId(tenantId);
|
||||
OAuth2User oAuth2User = userService.loadByPhone(decryptedPhone, request);
|
||||
if (oAuth2User != null) {
|
||||
long count = service.count(Wrappers.<User>lambdaQuery().eq(User::getAccount, decryptedPhone));
|
||||
if (count > 0) {
|
||||
return R.fail("该用户已注册");
|
||||
}
|
||||
if (simpleSMSOpen && registerOpen) {
|
||||
|
||||
Reference in New Issue
Block a user