修改提示为英语
This commit is contained in:
@@ -133,7 +133,7 @@ public class MyUserController {
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
boolean b = userService.checkUserTelOrEmail(user);
|
||||
if(!b){
|
||||
return R.error("电话或邮箱已存在");
|
||||
return R.error("Already exists");
|
||||
}
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
@@ -148,7 +148,7 @@ public class MyUserController {
|
||||
public R updateUserPassword(@RequestBody MyUserEntity user){
|
||||
String password = user.getPassword();
|
||||
if(password.equals(null)){
|
||||
return R.error("密码不能为空");
|
||||
return R.error("Password cannot be empty");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
@@ -168,7 +168,7 @@ public class MyUserController {
|
||||
if (b){
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("鉴权失败");
|
||||
return R.error("Authentication failed");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public class MyUserController {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"短信验证码频率过高,请稍后再试!");
|
||||
return R.error(500,"The verification code frequency is too high, please try again later!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ public class MyUserController {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"验证码频率过高,请稍后再试!");
|
||||
return R.error(500,"The verification code frequency is too high, please try again later!");
|
||||
}
|
||||
}
|
||||
//生成随机六位数
|
||||
@@ -251,7 +251,7 @@ public class MyUserController {
|
||||
//redis 缓存验证码
|
||||
redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES);
|
||||
//发送
|
||||
return MailUtil.sendMail("疯子读书邮箱验证码",code,email);
|
||||
return MailUtil.sendMail("Amazing Reading APP:Email verification code",code,email);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,11 +265,11 @@ public class MyUserController {
|
||||
Integer id = Integer.valueOf(map.get("id").toString());
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
return R.error("The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("短信验证码不符!");
|
||||
return R.error("The verification code does not match!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setTel(phone);
|
||||
@@ -293,18 +293,18 @@ public class MyUserController {
|
||||
if (userEntity == null) {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+email);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
return R.error("The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("短信验证码不符!");
|
||||
return R.error("Verification code does not match!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setEmail(email);
|
||||
userService.updateById(userInfo);
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("邮箱已被绑定!");
|
||||
return R.error("Email has been bound!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,18 +316,18 @@ public class MyUserController {
|
||||
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
return R.error(500,"The verification code has expired, please try again");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
return R.error(500,"The verification code does not match!");
|
||||
}
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel));
|
||||
if(!ObjectUtil.isEmpty(user)){
|
||||
return R.error(500,"该手机号已经注册!");
|
||||
return R.error(500,"This phone number has already been registered!");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
MyUserEntity myUserEntity = new MyUserEntity();
|
||||
@@ -347,11 +347,11 @@ public class MyUserController {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
System.out.println(redisCode);
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
return R.error(500,"The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"验证码不符!");
|
||||
return R.error(500,"The verification code does not match!");
|
||||
}
|
||||
//校验邀请码
|
||||
MyUserEntity inviteUser = null;
|
||||
@@ -359,7 +359,7 @@ public class MyUserController {
|
||||
inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>()
|
||||
.eq(MyUserEntity::getInviteCode, inviteCode));
|
||||
if (inviteUser == null) {
|
||||
return R.error("邀请码有误");
|
||||
return R.error("The invitation code is incorrect!");
|
||||
}
|
||||
}
|
||||
//查询是否存在当前用户手机号
|
||||
@@ -393,10 +393,10 @@ public class MyUserController {
|
||||
inviteRegisterService.checkInviteRegisterCount(inviteUser.getId());
|
||||
}
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
return R.ok("successfully registered").put("userInfo",myUserEntity).put("token",r);
|
||||
}else {
|
||||
R r = sysUserTokenService.createToken(userList.get(0).getId());
|
||||
return R.ok("登录成功!").put("userInfo",userList.get(0)).put("token",r);
|
||||
return R.ok("Login succeeded").put("userInfo",userList.get(0)).put("token",r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ public class MyUserController {
|
||||
//防止多账号报错
|
||||
List<MyUserEntity> userList = userService.getBaseMapper().selectList(wrapper);
|
||||
if (userList == null || userList.size() == 0) {
|
||||
return R.error(500,"用户不存在!");
|
||||
return R.error(500,"The user does not exist!");
|
||||
}else {
|
||||
int flag = 0;
|
||||
for (MyUserEntity user : userList) {
|
||||
@@ -426,13 +426,13 @@ public class MyUserController {
|
||||
}
|
||||
if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
return R.ok("登陆成功!").put("userInfo",user).put("token",r);
|
||||
return R.ok("Login successful!").put("userInfo",user).put("token",r);
|
||||
}
|
||||
}
|
||||
if (flag>0){
|
||||
return R.error(500,"当前未设置密码,请使用验证码登录!");
|
||||
return R.error(500,"Currently, no password has been set. Please use the verification code to log in!");
|
||||
}
|
||||
return R.error(500,"密码不正确,请重试!");
|
||||
return R.error(500,"The password is incorrect, please try again!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,11 +446,11 @@ public class MyUserController {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
System.out.println(redisCode);
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
return R.error(500,"The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"验证码不符!");
|
||||
return R.error(500,"Verification code does not match!");
|
||||
}
|
||||
//查询是否存在当前用户手机号
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -461,12 +461,12 @@ public class MyUserController {
|
||||
}
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(wrapper);
|
||||
if (userEntity == null) {
|
||||
return R.error(500,"当前用户不存在!");
|
||||
return R.error(500,"The current user does not exist!");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
userEntity.setPassword(saltMD5);
|
||||
userService.updateById(userEntity);
|
||||
return R.ok("成功");
|
||||
return R.ok("success");
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ public class MyUserController {
|
||||
//将结果转成json 取值
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
|
||||
if (jsonObject.getString("msg").equals("登录名或密码错误!")) {
|
||||
if (jsonObject.getString("msg").equals("Login name or password incorrect!")) {
|
||||
|
||||
return R.error(404,jsonObject.getString("msg"));
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class BookAbroadController {
|
||||
.eq(BookAbroadCommentLike::getCommentId,commentLike.getCommentId())
|
||||
.eq(BookAbroadCommentLike::getUserId,ShiroUtils.getUId()));
|
||||
if (count > 0) {
|
||||
return R.error("已点赞");
|
||||
return R.error("Already liked");
|
||||
}
|
||||
commentLike.setUserId(ShiroUtils.getUId());
|
||||
bookAbroadCommentLikeService.save(commentLike);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class OrderController {
|
||||
.eq(UserEbookBuyEntity::getUserId,ShiroUtils.getUId())
|
||||
.eq(UserEbookBuyEntity::getBookId,buyOrder.getAbroadBookId()));
|
||||
if (count>0){
|
||||
return R.error("已购买");
|
||||
return R.error("Purchased");
|
||||
}
|
||||
buyOrder.setUserId(ShiroUtils.getUId());
|
||||
buyOrder.setCome(3);//3 海外读书
|
||||
@@ -58,15 +58,15 @@ public class OrderController {
|
||||
BigDecimal totalPrice = buyOrder.getOrderMoney();
|
||||
//校验价格
|
||||
if (totalPrice.compareTo(new BigDecimal(0))<=0){
|
||||
return R.error("订单价格不能为0");
|
||||
return R.error("The order price cannot be 0");
|
||||
}
|
||||
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
||||
if (totalPrice.compareTo(bookEntity.getAbroadPrice().multiply(new BigDecimal(10)))!=0){
|
||||
return R.error("订单价格异常");
|
||||
return R.error("Abnormal order price");
|
||||
}
|
||||
}else {
|
||||
if (totalPrice.compareTo(bookEntity.getAbroadPrice())!=0){
|
||||
return R.error("订单价格异常");
|
||||
return R.error("Abnormal order price");
|
||||
}
|
||||
}
|
||||
buyOrder.setRealMoney(totalPrice);
|
||||
@@ -90,7 +90,7 @@ public class OrderController {
|
||||
//开通电子书权限
|
||||
userEbookBuyService.addBookForUser(user.getId(), Arrays.asList(buyOrder.getAbroadBookId()));
|
||||
}else {
|
||||
return R.error(500, "天医币余额不足!");
|
||||
return R.error(500, "Insufficient Balance!");
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
@@ -65,7 +65,7 @@ public class UserController {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"短信验证码频率过高,请稍后再试!");
|
||||
return R.error(500,"The verification code frequency is too high, please try again later!");
|
||||
}
|
||||
}
|
||||
//生成随机六位数
|
||||
@@ -95,7 +95,7 @@ public class UserController {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"验证码频率过高,请稍后再试!");
|
||||
return R.error(500,"The verification code frequency is too high, please try again later!");
|
||||
}
|
||||
}
|
||||
//生成随机六位数
|
||||
@@ -110,7 +110,7 @@ public class UserController {
|
||||
//redis 缓存验证码
|
||||
redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES);
|
||||
//发送
|
||||
return MailUtil.sendMail("疯子读书邮箱验证码",code,email);
|
||||
return MailUtil.sendMail("Amazing Reading APP:Email verification code",code,email);
|
||||
}
|
||||
|
||||
@RequestMapping("/getUserInfo")
|
||||
@@ -143,18 +143,18 @@ public class UserController {
|
||||
if (userEntity == null) {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
return R.error("The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("短信验证码不符!");
|
||||
return R.error("The SMS verification code does not match!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setTel(phone);
|
||||
userService.updateById(userInfo);
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("手机号已被绑定!");
|
||||
return R.error("The phone number has been bound!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,18 +174,18 @@ public class UserController {
|
||||
if (userEntity == null) {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+email);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
return R.error("The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("验证码不符!");
|
||||
return R.error("The verification code does not match!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setEmail(email);
|
||||
userService.updateById(userInfo);
|
||||
return R.ok();
|
||||
}else {
|
||||
return R.error("邮箱已被绑定!");
|
||||
return R.error("Email has been bound!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,11 +207,11 @@ public class UserController {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
System.out.println(redisCode);
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
return R.error(500,"The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"验证码不符!");
|
||||
return R.error(500,"The verification code does not match!");
|
||||
}
|
||||
//校验邀请码
|
||||
MyUserEntity inviteUser = null;
|
||||
@@ -219,7 +219,7 @@ public class UserController {
|
||||
inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>()
|
||||
.eq(MyUserEntity::getInviteCode, inviteCode));
|
||||
if (inviteUser == null) {
|
||||
return R.error("邀请码有误");
|
||||
return R.error("The invitation code is incorrect!");
|
||||
}
|
||||
}
|
||||
//查询是否存在当前用户
|
||||
@@ -250,10 +250,10 @@ public class UserController {
|
||||
inviteRegisterService.checkInviteRegisterCount(inviteUser.getId());
|
||||
}
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
return R.ok("successfully registered").put("userInfo",myUserEntity).put("token",r);
|
||||
}else {
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
return R.ok("登录成功!").put("userInfo",userEntity).put("token",r);
|
||||
return R.ok("Login succeeded").put("userInfo",userEntity).put("token",r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,16 +272,16 @@ public class UserController {
|
||||
//防止多账号报错
|
||||
MyUserEntity userEntity = userService.getOne(wrapper);
|
||||
if (userEntity == null) {
|
||||
return R.error(500,"用户不存在!");
|
||||
return R.error(500,"The user does not exist!");
|
||||
}else {
|
||||
if (userEntity.getPassword() == null|| userEntity.getPassword().equals("")) {
|
||||
return R.error(500,"当前未设置密码,请使用验证码登录!");
|
||||
return R.error(500,"Currently, no password has been set. Please use the verification code to log in!");
|
||||
}else {
|
||||
if (MD5Utils.getSaltverifyMD5(password,userEntity.getPassword())){
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
return R.ok("登陆成功!").put("userInfo",userEntity).put("token",r);
|
||||
return R.ok("Login successful!").put("userInfo",userEntity).put("token",r);
|
||||
}else {
|
||||
return R.error(500,"密码不正确,请重试!");
|
||||
return R.error(500,"The password is incorrect, please try again!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,11 +297,11 @@ public class UserController {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
System.out.println(redisCode);
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
return R.error(500,"The verification code has expired, please try again");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"验证码不符!");
|
||||
return R.error(500,"The verification code does not match!");
|
||||
}
|
||||
//查询是否存在当前用户
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -312,12 +312,12 @@ public class UserController {
|
||||
}
|
||||
MyUserEntity userEntity = userService.getOne(wrapper);
|
||||
if (userEntity == null) {
|
||||
return R.error(500,"当前用户不存在!");
|
||||
return R.error(500,"The current user does not exist!");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
userEntity.setPassword(saltMD5);
|
||||
userService.updateById(userEntity);
|
||||
return R.ok("成功");
|
||||
return R.ok("success");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -327,12 +327,12 @@ public class UserController {
|
||||
public R setPassword(@RequestParam("id") String id,@RequestParam("password") String password) {
|
||||
MyUserEntity userEntity = userService.getById(id);
|
||||
if (userEntity == null) {
|
||||
return R.error(500,"当前用户不存在!");
|
||||
return R.error(500,"The current user does not exist!");
|
||||
}
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
userEntity.setPassword(saltMD5);
|
||||
userService.updateById(userEntity);
|
||||
return R.ok("成功");
|
||||
return R.ok("success");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PaypalController {
|
||||
BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>()
|
||||
.eq(BuyOrder::getOrderSn,params.get("orderSn")));
|
||||
if ("3".equals(buyOrder.getOrderStatus())){
|
||||
return R.error("订单已完成");
|
||||
return R.error("Order completed");
|
||||
}
|
||||
if ("point".equals(buyOrder.getOrderType())){
|
||||
buyOrder.setRemark("Recharge Virtual Coin");
|
||||
@@ -74,6 +74,8 @@ public class PaypalController {
|
||||
|
||||
return R.ok().put("id",res.get("id").toString()).put("url",url);
|
||||
}
|
||||
}else {
|
||||
return R.error(res.get("message").toString());
|
||||
}
|
||||
return R.error(res.get("error").toString());
|
||||
}
|
||||
@@ -121,7 +123,7 @@ public class PaypalController {
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
return R.error("执行扣款失败");
|
||||
return R.error("failed");
|
||||
}
|
||||
|
||||
@RequestMapping("/refund")
|
||||
|
||||
Reference in New Issue
Block a user