fix
Helius
2022-07-04 312dc55b139d16a73e58cd6899865e11e86c6fdc
src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminCommonController.java
@@ -1,7 +1,6 @@
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;
@@ -18,6 +17,8 @@
import java.io.File;
import java.io.IOException;
import java.util.Map;
@RestController
@RequestMapping(value = "/api/common")
@@ -32,6 +33,12 @@
    @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();
    }
    /**
@@ -105,12 +112,15 @@
    @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;
        // 检查目录