| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.*; |
| | |
| | | @RestController |
| | | @RequestMapping(value = "/api/common") |
| | | public class ApiCommonAction { |
| | | @Autowired |
| | | UploadUtil uploadUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private SysUsersService sysUsersService; |
| | |
| | | EXT_LIST.add(FileType.PNG); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "表单图片上传接口", notes = "表单图片上传接口") |
| | | @PostMapping(value = "/uploadImg") |
| | | public AjaxResult uploadImg(HttpServletResponse response, MultipartHttpServletRequest request) |
| | | throws IOException, FileUploadException, NoSuchAlgorithmException { |
| | | Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, 1L); |
| | | Map<String, String> fileMap = uploadUtil.doUpload(request, EXT_LIST, folderType, 1L); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("上传成功"); |
| | | ajaxResult.putInMap("file", fileMap.get("visitPath")); |
| | | return ajaxResult; |
| | |
| | | return AjaxResult.buildFailInstance("该手机号不存在"); |
| | | } |
| | | |
| | | String codeExist = LocalCache.get(smsCodeDto.getTelphone()); |
| | | String codeExist = LocalCache.get(smsCodeDto.getTelphone(),new TypeReference<String>(){}); |
| | | if (StringUtils.isNotBlank(codeExist)) { |
| | | return AjaxResult.buildFailInstance("请勿重复发送验证码"); |
| | | } |
| | |
| | | return AjaxResult.buildFailInstance("该手机号不存在"); |
| | | } |
| | | |
| | | String code = LocalCache.get(pwdResetDto.getTelphone()); |
| | | String code = LocalCache.get(pwdResetDto.getTelphone(),new TypeReference<String>(){}); |
| | | if (StringUtils.isBlank(code)) { |
| | | return AjaxResult.buildFailInstance("验证码已失效,请重新发送"); |
| | | } |