Commit 241121f8 authored by 赵啸非's avatar 赵啸非

添加门户license验证

parent cf3ad0e9
......@@ -2,34 +2,31 @@ package com.mortals.xhx.module.cipher.web;
import cn.hutool.core.date.DateUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.base.framework.config.LicenseHandler;
import com.mortals.xhx.common.utils.CipherUtil;
import com.mortals.xhx.common.utils.DecodeUtil;
import com.mortals.xhx.common.utils.LicenseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: LiHuaZhi
* @Description:
**/
* 授权文件上传与检测
* @author: zxfei
* @date: 2024/7/10 9:54
*/
@RestController
@RequestMapping("/cipher")
@Slf4j
public class CipherController {
@Value("${sys.license.key}")
private String keyPath;
......@@ -75,4 +72,33 @@ public class CipherController {
}
@RequestMapping(value = "upload")
@UnAuth
public String doFileUpload(MultipartFile file) {
/* Map<String, Object> model = new HashMap<>();
String jsonStr = "";
try {
// String filePath = uploadService.saveFileUpload(file, prePath, getCurUser());
model.put("url", filePath);
model.put("fileName", file.getOriginalFilename());
model.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonStr = JSONObject.toJSONString(model);
} catch (AppException e) {
log.error("上传异常",e);
model.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
model.put(KEY_RESULT_MSG, e.getMessage());
jsonStr = JSONObject.toJSONString(model);
} catch (Exception e) {
// doException(request, "上传文件", new HashMap<>(3), e);
// model.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
// model.put(KEY_RESULT_MSG, "文件上传失败");
jsonStr = JSONObject.toJSONString(model);
}
log.info("uploadResp==>{}",jsonStr);
return jsonStr;*/
return "";
}
}
......@@ -48,5 +48,5 @@ sys:
pub: /home/license/license.pub
log: /home/license
license:
enable: true
enable: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment