|
|
@@ -3,6 +3,7 @@ package com.uas.sso.controller;
|
|
|
import com.uas.sso.entity.*;
|
|
|
import com.uas.sso.exception.VisibleError;
|
|
|
import com.uas.sso.service.*;
|
|
|
+import com.uas.sso.support.SystemSession;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -31,7 +32,7 @@ public class AppealController extends BaseController {
|
|
|
private AppealService appealService;
|
|
|
|
|
|
/**
|
|
|
- * 获取手机号验证码
|
|
|
+ * 更换管理员获取手机号验证码(可以未登录,并使用已注册账号)
|
|
|
*
|
|
|
* @author wangmh
|
|
|
* @date 2018/1/16 10:37
|
|
|
@@ -53,6 +54,31 @@ public class AppealController extends BaseController {
|
|
|
return success(data);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 账号申述获取手机号验证码(需登录,并使用未注册账号)
|
|
|
+ * @param mobile
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/check/mobile", params = "_operate=account", method = RequestMethod.GET)
|
|
|
+ public ModelMap checkMobile2(String mobile) {
|
|
|
+ if (StringUtils.isEmpty(SystemSession.getUserAccount())) {
|
|
|
+ return error("用户未登录");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(mobile)) {
|
|
|
+ return error("手机号不能为空");
|
|
|
+ }
|
|
|
+ User oldUser = userService.findByMobile(mobile);
|
|
|
+ if (!mobile.equals(SystemSession.getUserAccount().getMobile())) {
|
|
|
+ if (oldUser != null) {
|
|
|
+ return error("该手机号已被占用,请重新输入");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String token = getMobileToken(mobile);
|
|
|
+ ModelMap data = new ModelMap("token", token);
|
|
|
+ data.put("code", request.getSession().getAttribute("code"));
|
|
|
+ return success(data);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 校验验证码
|
|
|
*
|