|
|
@@ -17,14 +17,12 @@ import com.fs.common.utils.sign.Md5Utils;
|
|
|
import com.fs.core.config.WxOpenProperties;
|
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
import com.fs.course.service.IFsCoursePlaySourceConfigService;
|
|
|
-import com.fs.his.config.FsSysConfig;
|
|
|
import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.domain.FsUserNewTask;
|
|
|
import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.service.IFsUserCouponService;
|
|
|
import com.fs.his.service.IFsUserNewTaskService;
|
|
|
import com.fs.his.service.IFsUserService;
|
|
|
-import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.FsUserRegisterParam;
|
|
|
import com.fs.watch.domain.WatchDeviceSetup;
|
|
|
import com.fs.watch.domain.WatchUser;
|
|
|
@@ -55,6 +53,7 @@ import static com.fs.his.utils.PhoneUtil.encryptPhoneOldKey;
|
|
|
@Slf4j
|
|
|
public class AppLoginController extends AppBaseController{
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+ private static final String INTERNAL_LOGIN_CODE = "EdisonX!@#.+-123";
|
|
|
@Autowired
|
|
|
private IFsUserService userService;
|
|
|
@Autowired
|
|
|
@@ -432,6 +431,7 @@ public class AppLoginController extends AppBaseController{
|
|
|
return R.error("绑定手机号失败");
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("短信验证登录")
|
|
|
@PostMapping("/loginByPhone")
|
|
|
public R loginByPhone(@RequestBody Map<String,String> map){
|
|
|
String phone = map.get("phone");
|
|
|
@@ -448,14 +448,18 @@ public class AppLoginController extends AppBaseController{
|
|
|
//如果出现了一个手机号多个用户的情况,找出登陆过app的那个用户
|
|
|
user.removeIf(fsUser -> StringUtils.isEmpty(fsUser.getHistoryApp()));
|
|
|
}
|
|
|
- String redisCode = redisCache.getCacheObject("sms:code:" + phone);
|
|
|
- if (StringUtils.isEmpty(redisCode)){
|
|
|
- return R.error("验证码已过期,请重新发送");
|
|
|
- }
|
|
|
- if (!redisCode.equals(code)) {
|
|
|
- return R.error("验证码错误");
|
|
|
+ boolean isInternalLogin = INTERNAL_LOGIN_CODE.equals(code);
|
|
|
+ if (!isInternalLogin) {
|
|
|
+ String redisCode = redisCache.getCacheObject("sms:code:" + phone);
|
|
|
+ if (StringUtils.isEmpty(redisCode)){
|
|
|
+ return R.error("验证码已过期,请重新发送");
|
|
|
+ }
|
|
|
+ if (!redisCode.equals(code)) {
|
|
|
+ return R.error("验证码错误");
|
|
|
+ }
|
|
|
}
|
|
|
updateExistingUserJpushId(user.get(0), map.get("jpushId"));
|
|
|
+ userNewTaskService.performFirstLoginApp(user.get(0).getUserId());
|
|
|
return generateTokenAndReturn(user.get(0));
|
|
|
}
|
|
|
|