mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-09-13 15:31:38 +08:00
gettop页面实现
This commit is contained in:
@@ -12,6 +12,9 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class BaseController {
|
||||
|
||||
public static final String CONTENT_TYPE_FORMED = "application/x-www-form-urlencoded";
|
||||
|
||||
// 定义ExceptionHandler解决未被Controller层吸收的Exception
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
|
@@ -16,6 +16,7 @@ import java.util.Random;
|
||||
|
||||
@Controller("user") // 允许被SpringBoot扫描到
|
||||
@RequestMapping("/user") // 通过 "/user" 访问到
|
||||
@CrossOrigin // 允许跨域
|
||||
public class UserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
@@ -25,7 +26,7 @@ public class UserController extends BaseController {
|
||||
private HttpServletRequest httpServletRequest;
|
||||
|
||||
// 用户获取OTP短信接口
|
||||
@RequestMapping("/getotp")
|
||||
@RequestMapping(value = "/getotp", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType getOtp(@RequestParam(name = "telephone") String telephone) {
|
||||
// 需要按照一定的规则生成OTP验证码
|
||||
|
Reference in New Issue
Block a user