puzhibing
2023-07-27 d56eb9b8c519945957c2a90e4204efb48abd463b
更新接口
3个文件已修改
26 ■■■■■ 已修改文件
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -184,11 +184,21 @@
    @ApiOperation(value = "验证验证码", tags = {"司机端-注册"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "String"),
            @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"),
            @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String")
    })
    public ResultUtil checkCaptcha(String email, String code, Integer language){
    public ResultUtil checkCaptcha(String email, String phone, String code, Integer language){
        try {
            boolean b = driverService.checkCaptcha(email, code);
            if(ToolUtil.isNotEmpty(phone)){
                String substring = phone.substring(0, 1);
                if("0".equals(substring)){
                    phone = "233" + phone.substring(1);
                }
                if(phone.indexOf("233") < 0){
                    phone = "233" + phone;
                }
            }
            boolean b = driverService.checkCaptcha(email, phone, code);
            return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide");
        }catch (Exception e){
            e.printStackTrace();
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java
@@ -37,7 +37,7 @@
     * @return
     * @throws Exception
     */
    boolean checkCaptcha(String phone, String code) throws Exception;
    boolean checkCaptcha(String email, String phone, String code) throws Exception;
    /**
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java
@@ -270,8 +270,8 @@
     * @throws Exception
     */
    @Override
    public boolean checkCaptcha(String phone, String code) throws Exception {
        Object value = redisUtil.getValue(phone);
    public boolean checkCaptcha(String email, String phone, String code) throws Exception {
        Object value = redisUtil.getValue(ToolUtil.isNotEmpty(email) ? email : phone);
        if("1246".equals(code)){
            return true;
        }
@@ -411,7 +411,7 @@
     */
    @Override
    public ResultUtil<LoginWarpper> registeredDriver(String phoneOperator, String phone, String code, String password,Integer uid,Integer uType, Integer language) throws Exception {
        boolean b = this.checkCaptcha(phone, code);
        boolean b = this.checkCaptcha("", phone, code);
        if(!b){
            return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide");
        }
@@ -613,7 +613,7 @@
     */
    @Override
    public ResultUtil resetPassword(String phone, String code, String password, Integer language) throws Exception {
        boolean b = this.checkCaptcha(phone, code);
        boolean b = this.checkCaptcha("", phone, code);
        if(!b){
            return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide");
        }
@@ -1046,7 +1046,7 @@
        if(null != driver){
            return ResultUtil.error(language == 1 ? "电话号码已被注册" : language == 2 ? "he phone number is registered" : "Le numéro de téléphone a été enregistré");
        }
        boolean b = this.checkCaptcha(phone, code);
        boolean b = this.checkCaptcha("", phone, code);
        if(!b){
            return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide");
        }