| | |
| | | package com.xcong.farmer.cms.modules.system.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.farmer.cms.common.contants.AppContants; |
| | | import com.xcong.farmer.cms.common.response.Result; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminLoginDto; |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | |
| | | import java.util.Map; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/api/common") |
| | |
| | | @PostMapping("/login") |
| | | public Result login(@RequestBody @Valid AdminLoginDto adminLoginDto) { |
| | | return iCommonService.login(adminLoginDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取验证码", notes = "获取验证码") |
| | | @GetMapping("/captcha") |
| | | public Result captcha() throws IOException { |
| | | return iCommonService.captchaCreator(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Value("${static.resource.url}") |
| | | private String resourceUrl; |
| | | |
| | | @Value("${static.resource.path}") |
| | | private String resourcePath; |
| | | |
| | | @ApiOperation(value = "文件上传", notes = "文件上传") |
| | | @PostMapping("/uploadFile") |
| | | public Result uploadFile(@RequestParam("file") MultipartFile file) throws Exception { |
| | | |
| | | // 文件保存目录路径 |
| | | String savePath = AppContants.PICTURE_PATH; |
| | | String savePath = resourcePath; |
| | | // 文件保存目录URL |
| | | String saveUrl = resourceUrl; |
| | | // 检查目录 |