k94314517
2024-07-25 a75b18a4157ab486e0b51c438ac165ab3a08e3e0
代码提交
已修改2个文件
10 ■■■■ 文件已修改
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
@@ -862,7 +862,7 @@
        //TODO 调起 中台接口
        usersMapper.update(new UpdateWrapper<Users>()
                .lambda()
                .set(Users::getCardImg,"-") //重置名片为 -
                .set(Users::getCardImg,null) //重置名片为 -
                .set(StringUtils.isNotBlank(editUsersRequest.getImgurl()),Users::getImgurl,editUsersRequest.getImgurl())
                .set(StringUtils.isNotBlank(editUsersRequest.getName()),Users::getName,editUsersRequest.getName())
                .set(StringUtils.isNotBlank(editUsersRequest.getPhone()),Users::getPhone,editUsersRequest.getPhone())
server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
@@ -8,6 +8,7 @@
import com.doumee.biz.zbom.ZbomZhongTaiService;
import com.doumee.config.annotation.LoginRequired;
import com.doumee.config.annotation.UserLoginRequired;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
@@ -127,11 +128,12 @@
        return  ApiResponse.success(zbomCRMService.getCrmGoUrl(this.getLoginUserInfo().getIamUsername(),type));
    }
    @PreventRepeat(lockTime = 2000)
    @ApiOperation(value = "生成小程序码", notes = "PAD端")
    @PostMapping("/getQrCode")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "sign", value = "签名(使用timestamp+appkey进行md5加密)", required = true),
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "timestamp", value = "时间戳(当前时间毫秒,2小时内有效)", required = true),
            @ApiImplicitParam(paramType = "header", dataType = "Long", name = "timestamp", value = "时间戳(当前时间毫秒,2小时内有效)", required = true),
    })
    public void getQrCode(@RequestParam(value = "sign")String sign,
                          @RequestParam(value = "timestamp")Long timestamp,
@@ -140,6 +142,10 @@
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        String interfaceKey = systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_PAD_INTERFACE_KEY).getCode();
        //判断时间戳是否超过两小时
        if(System.currentTimeMillis()-timestamp > 2 * 60 * 3600 * 1000){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"token已失效!");
        }
        String token = DigestUtils.md5Hex(timestamp+interfaceKey);
        if(!token.equals(sign)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"token已失效!");