|
@@ -44,6 +44,7 @@ import com.tourism.webadmin.back.service.TourUserService;
|
|
|
import com.tourism.webadmin.back.service.impl.TourBookInfoServiceImpl;
|
|
|
import com.tourism.webadmin.back.util.SMSUtils;
|
|
|
import com.tourism.common.additional.config.ApplicationConfig;
|
|
|
+import com.tourism.webadmin.config.SmsSwitch;
|
|
|
import com.tourism.webadmin.upms.model.SysUser;
|
|
|
import io.jsonwebtoken.lang.Collections;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -106,14 +107,15 @@ public class LoginToWebsiteController {
|
|
|
private UpDownloaderFactory upDownloaderFactory;
|
|
|
@Autowired
|
|
|
private WxMaService wxMaService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private TourCountryCodeService tourCountryCodeService;
|
|
|
+ @Autowired
|
|
|
+ private TourBookInfoServiceImpl tourBookInfoService;
|
|
|
+ @Autowired
|
|
|
+ private SmsSwitch smsSwitch;
|
|
|
|
|
|
private static final String SHOW_NAME_FIELD = "showName";
|
|
|
private static final String HEAD_IMAGE_URL_FIELD = "headImageUrl";
|
|
|
- @Autowired
|
|
|
- private TourBookInfoServiceImpl tourBookInfoService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -279,15 +281,17 @@ public class LoginToWebsiteController {
|
|
|
@MyRequestBody String smsCode,
|
|
|
@MyRequestBody String countryCode) throws UnsupportedEncodingException
|
|
|
{
|
|
|
- // 校验短信验证码
|
|
|
-// String smsCodeKey = CacheConstants.getSmsCodeKey(loginMoblie);
|
|
|
-// RBucket<String> bucket = redissonClient.getBucket(smsCodeKey);
|
|
|
-// String redisCode = bucket.get();
|
|
|
-// if(StringUtils.isBlank(redisCode) || !redisCode.equals(smsCode)){
|
|
|
-// return ResponseResult.error(ErrorCodeEnum.SMS_CODE_ERR);
|
|
|
-// }
|
|
|
-// // 短信验证码校验成功,清除验证码
|
|
|
-// bucket.delete();
|
|
|
+ if(smsSwitch.isEnable()) {
|
|
|
+ // 校验短信验证码
|
|
|
+ String smsCodeKey = CacheConstants.getSmsCodeKey(loginMoblie);
|
|
|
+ RBucket<String> bucket = redissonClient.getBucket(smsCodeKey);
|
|
|
+ String redisCode = bucket.get();
|
|
|
+ if(StringUtils.isBlank(redisCode) || !redisCode.equals(smsCode)){
|
|
|
+ return ResponseResult.error(ErrorCodeEnum.SMS_CODE_ERR);
|
|
|
+ }
|
|
|
+ // 短信验证码校验成功,清除验证码
|
|
|
+ bucket.delete();
|
|
|
+ }
|
|
|
// 查询用户信息
|
|
|
TourUser tourUser = tourUserService.getOne(Wrappers.<TourUser>lambdaQuery().eq(TourUser::getMobile, loginMoblie));
|
|
|
// 如果用户信息不存在,则新建
|