123
This commit is contained in:
@@ -6,6 +6,7 @@ import com.bashi.common.core.domain.AjaxResult;
|
||||
import com.bashi.common.core.domain.entity.Customer;
|
||||
import com.bashi.common.core.redis.RedisCache;
|
||||
import com.bashi.common.exception.CustomException;
|
||||
import com.bashi.common.utils.MessageUtils;
|
||||
import com.bashi.dk.dto.app.req.CustomerRegisterReq;
|
||||
import com.bashi.dk.dto.app.req.UpdatePwdOpenReq;
|
||||
import com.bashi.dk.service.CustomerService;
|
||||
@@ -41,7 +42,7 @@ public class AppCustomerOpenController {
|
||||
@ApiOperation("用户注册")
|
||||
public AjaxResult<Void> customerRegister(@RequestBody CustomerRegisterReq register) {
|
||||
if(!codeService.check(register.getPhoneNumber(), CodeType.CUSTOMER_REGISTER,register.getCode())){
|
||||
throw new CustomException("验证码错误");
|
||||
throw new CustomException(MessageUtils.message("dk.code.error"));
|
||||
}
|
||||
customerService.register(register);
|
||||
return AjaxResult.success();
|
||||
@@ -61,7 +62,7 @@ public class AppCustomerOpenController {
|
||||
@ApiOperation("忘记密码-验证码-校验")
|
||||
public AjaxResult<String> customerForgetPasswordCheck(String phoneNumber,String code) {
|
||||
if(!codeService.check(phoneNumber, CodeType.CUSTOMER_REGISTER,code)){
|
||||
throw new CustomException("验证码错误");
|
||||
throw new CustomException(MessageUtils.message("dk.code.error"));
|
||||
}
|
||||
Customer customer = customerService.getCustomerByName(phoneNumber);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
@@ -76,10 +77,10 @@ public class AppCustomerOpenController {
|
||||
public AjaxResult<String> customerForgetPasswordCheck(@RequestBody UpdatePwdOpenReq updatePwdOpenReq) {
|
||||
Customer customer = redisCache.getCacheObject(updatePwdOpenReq.getCheckCode());
|
||||
if(customer == null){
|
||||
throw new CustomException("密码修改失败,请重新获取验证码操作");
|
||||
throw new CustomException(MessageUtils.message("dk.password.update.error"));
|
||||
}
|
||||
if(!updatePwdOpenReq.getPassword().equals(updatePwdOpenReq.getConfirmPassword())){
|
||||
throw new CustomException("密码不一致");
|
||||
throw new CustomException(MessageUtils.message("dk.password.check.error"));
|
||||
}
|
||||
customerService.updatePwd(customer.getId(),updatePwdOpenReq.getPassword());
|
||||
AjaxResult<String> success = AjaxResult.success();
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.aliyuncs.exceptions.ClientException;
|
||||
import com.aliyuncs.exceptions.ServerException;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
import com.bashi.common.core.domain.AjaxResult;
|
||||
import com.bashi.common.utils.MessageUtils;
|
||||
import com.bashi.dk.manager.FileUploadManager;
|
||||
import com.bashi.dk.manager.FileUploadRes;
|
||||
import com.bashi.dk.oss.ali.StsOssKit;
|
||||
@@ -46,7 +47,7 @@ public class V2CommonController {
|
||||
public AjaxResult getSts(){
|
||||
StsResult stsToken = stsOssKit.getStsToken();
|
||||
if(stsToken == null){
|
||||
return AjaxResult.error(400,"文件上传初始化失败");
|
||||
return AjaxResult.error(400, MessageUtils.message("dk.file.upload.init.error"));
|
||||
}
|
||||
return AjaxResult.success(stsToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user