提交 dffdc97d authored 作者: 杨占军's avatar 杨占军

增加日志

上级 fb99d0ad
流水线 #30150 已失败 于阶段
in 5 seconds
...@@ -6,14 +6,16 @@ import com.example.util.AliyunOSSConfigConstant; ...@@ -6,14 +6,16 @@ import com.example.util.AliyunOSSConfigConstant;
import com.example.util.AliyunOSSUtil; import com.example.util.AliyunOSSUtil;
import com.example.util.DataConfig; import com.example.util.DataConfig;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONString;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import sun.rmi.runtime.Log;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -23,17 +25,16 @@ import java.util.HashMap; ...@@ -23,17 +25,16 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Controller @Controller
@Slf4j
public class UEditorController { public class UEditorController {
private Map<String, AliyunOSSConfigConstant> projectMap = new HashMap<String, AliyunOSSConfigConstant>(); private Map<String, AliyunOSSConfigConstant> projectMap = new HashMap<String, AliyunOSSConfigConstant>();
@Autowired @Autowired
private AliyunOSSUtil aliyunOSSUtil; private AliyunOSSUtil aliyunOSSUtil;
@RequestMapping("/") @RequestMapping("/")
private String showPage() { private String showPage() {
return "index"; return "index";
...@@ -41,36 +42,39 @@ public class UEditorController { ...@@ -41,36 +42,39 @@ public class UEditorController {
@RequestMapping(value = "/config") @RequestMapping(value = "/config")
public void config(HttpServletRequest request, HttpServletResponse response) { public void config(HttpServletRequest request, HttpServletResponse response) {
String env=request.getParameter("env"); String env = request.getParameter("env");
log.info("env:{}", env);
AliyunOSSConfigConstant aliyunOSSConfigConstant = aliyunOSSUtil.getOssConfig(env);
AliyunOSSConfigConstant aliyunOSSConfigConstant=aliyunOSSUtil.getOssConfig(env); log.info("aliyunOSSConfigConstant.host:{}", aliyunOSSConfigConstant.host);
log.info("aliyunOSSConfigConstant.keyId:{}", aliyunOSSConfigConstant.keyId);
//OSSConfigConstant oSSConfigConstant=ev.getProperty("projectMap.woyou", OSSConfigConstant.class); log.info("aliyunOSSConfigConstant.keySecret:{}", aliyunOSSConfigConstant.keySecret);
log.info("aliyunOSSConfigConstant.bucketName:{}", aliyunOSSConfigConstant.bucketName);
log.info("aliyunOSSConfigConstant.folder:{}", aliyunOSSConfigConstant.folder);
//OSSConfigConstant oSSConfigConstant=ev.getProperty("projectMap.woyou", OSSConfigConstant.class);
response.setContentType("application/json"); response.setContentType("application/json");
String rootPath = request.getSession().getServletContext().getRealPath("/"); String rootPath = request.getSession().getServletContext().getRealPath("/");
try { try {
ConfigManager configManger=ConfigManager.getInstance(rootPath, request.getContextPath(), request.getRequestURI()); // ConfigManager configManger = ConfigManager.getInstance(rootPath, request.getContextPath(), request.getRequestURI());
String imageUrlPrefix=(String) configManger.getAllConfig().get("imageUrlPrefix"); // String imageUrlPrefix = (String) configManger.getAllConfig().get("imageUrlPrefix");
String exec = new ActionEnter(request, rootPath).exec(); String exec = new ActionEnter(request, rootPath).exec();
//exec=exec.replace("\"imageUrlPrefix\":\"https://imgb.mofangx.com/\"","'imageUrlPrefix':'"+imageUrlPrefix+"'"); //exec=exec.replace("\"imageUrlPrefix\":\"https://imgb.mofangx.com/\"","'imageUrlPrefix':'"+imageUrlPrefix+"'");
exec=exec.replace("{imgUrl}",aliyunOSSConfigConstant.getHost()+"/"); exec = exec.replace("{imgUrl}", aliyunOSSConfigConstant.getHost() + "/");
exec=exec.replace("{basePath}",aliyunOSSConfigConstant.getFolder()); exec = exec.replace("{basePath}", aliyunOSSConfigConstant.getFolder());
//exec=exec.replace("'basePath':'erp/'","'basePath':'"+ossPath+"'"); //exec=exec.replace("'basePath':'erp/'","'basePath':'"+ossPath+"'");
System.out.println("exec:"+exec); System.out.println("exec:" + exec);
/*if(!exec.contains("videoMaxSize")) { /*if(!exec.contains("videoMaxSize")) {
JSONObject jsonConfig =new JSONObject(exec); JSONObject jsonConfig =new JSONObject(exec);
jsonConfig.put("url", imageUrl+jsonConfig.getString("url")); jsonConfig.put("url", imageUrl+jsonConfig.getString("url"));
System.out.println(jsonConfig); System.out.println(jsonConfig);
exec=jsonConfig.toString(); exec=jsonConfig.toString();
}*/ }*/
PrintWriter writer = response.getWriter(); PrintWriter writer = response.getWriter();
writer.write(exec); writer.write(exec);
writer.flush(); writer.flush();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论