| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.BigDecimalCodec; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.google.code.kaptcha.Constants; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | return ResultUtil.error(language == 1 ? "图形验证码错误" : language == 2 ? "The graphic verification code is incorrect" : "Code de vérification graphique incorrect"); |
| | | } |
| | | return userInfoService.queryCaptcha(phone, type); |
| | | return userInfoService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "场景类型(1=身份验证,2=登录确认,3=用户注册,4=修改密码)", name = "type", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil queryCaptcha1(String phone, Integer type){ |
| | | public ResultUtil queryCaptcha1(String phone, Integer type, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.queryCaptcha(phone, type); |
| | | return userInfoService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/queryUserInfo") |
| | | @ApiOperation(value = "获取用户详情【1.0】", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "获取用户详情【1.1】", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal(code); |
| | | long max = Long.MAX_VALUE; |
| | | if(bigDecimal.compareTo(new BigDecimal(max)) >= 0){ |
| | | return ResultUtil.error(language == 1 ? "银行卡号格式错误" : language == 2 ? "The format of bank card number is incorrect" : "Format incorrect du numéro de carte bancaire"); |
| | | } |
| | | BankCard bankCard = bankCardService.selectOne(new EntityWrapper<BankCard>().eq("code", code)); |
| | | if(null != bankCard){ |
| | | return ResultUtil.error(language == 1 ? "银行卡重复" : language == 2 ? "Duplicate bank card" : "Double carte bancaire"); |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/user/addBankCard") |
| | | @PostMapping("/api/user/delBankCard") |
| | | @ApiOperation(value = "删除银行卡【1.1】", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "银行卡id", name = "id", required = true, dataType = "int"), |