Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
U
UEditor-OSS
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
毛洋
UEditor-OSS
Commits
dffdc97d
提交
dffdc97d
authored
2月 26, 2024
作者:
杨占军
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加日志
上级
fb99d0ad
流水线
#30150
已失败 于阶段
in 5 seconds
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
26 行删除
+30
-26
UEditorController.java
src/main/java/com/example/controller/UEditorController.java
+30
-26
没有找到文件。
src/main/java/com/example/controller/UEditorController.java
浏览文件 @
dffdc97d
...
...
@@ -6,14 +6,16 @@ import com.example.util.AliyunOSSConfigConstant;
import
com.example.util.AliyunOSSUtil
;
import
com.example.util.DataConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
org.json.JSONException
;
import
org.json.JSON
Object
;
import
org.json.JSON
String
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
sun.rmi.runtime.Log
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -23,17 +25,16 @@ import java.util.HashMap;
import
java.util.Map
;
@Controller
@Slf4j
public
class
UEditorController
{
private
Map
<
String
,
AliyunOSSConfigConstant
>
projectMap
=
new
HashMap
<
String
,
AliyunOSSConfigConstant
>();
@Autowired
private
AliyunOSSUtil
aliyunOSSUtil
;
private
Map
<
String
,
AliyunOSSConfigConstant
>
projectMap
=
new
HashMap
<
String
,
AliyunOSSConfigConstant
>();
@Autowired
private
AliyunOSSUtil
aliyunOSSUtil
;
@RequestMapping
(
"/"
)
private
String
showPage
()
{
return
"index"
;
...
...
@@ -41,36 +42,39 @@ public class UEditorController {
@RequestMapping
(
value
=
"/config"
)
public
void
config
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
env
=
request
.
getParameter
(
"env"
);
AliyunOSSConfigConstant
aliyunOSSConfigConstant
=
aliyunOSSUtil
.
getOssConfig
(
env
);
//OSSConfigConstant oSSConfigConstant=ev.getProperty("projectMap.woyou", OSSConfigConstant.class);
String
env
=
request
.
getParameter
(
"env"
);
log
.
info
(
"env:{}"
,
env
);
AliyunOSSConfigConstant
aliyunOSSConfigConstant
=
aliyunOSSUtil
.
getOssConfig
(
env
);
log
.
info
(
"aliyunOSSConfigConstant.host:{}"
,
aliyunOSSConfigConstant
.
host
);
log
.
info
(
"aliyunOSSConfigConstant.keyId:{}"
,
aliyunOSSConfigConstant
.
keyId
);
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"
);
String
rootPath
=
request
.
getSession
().
getServletContext
().
getRealPath
(
"/"
);
try
{
ConfigManager
configManger
=
ConfigManager
.
getInstance
(
rootPath
,
request
.
getContextPath
(),
request
.
getRequestURI
());
String
imageUrlPrefix
=
(
String
)
configManger
.
getAllConfig
().
get
(
"imageUrlPrefix"
);
// ConfigManager configManger =
ConfigManager.getInstance(rootPath, request.getContextPath(), request.getRequestURI());
// String imageUrlPrefix =
(String) configManger.getAllConfig().get("imageUrlPrefix");
String
exec
=
new
ActionEnter
(
request
,
rootPath
).
exec
();
//exec=exec.replace("\"imageUrlPrefix\":\"https://imgb.mofangx.com/\"","'imageUrlPrefix':'"+imageUrlPrefix+"'");
exec
=
exec
.
replace
(
"{imgUrl}"
,
aliyunOSSConfigConstant
.
getHost
()+
"/"
);
exec
=
exec
.
replace
(
"{basePath}"
,
aliyunOSSConfigConstant
.
getFolder
());
exec
=
exec
.
replace
(
"{imgUrl}"
,
aliyunOSSConfigConstant
.
getHost
()
+
"/"
);
exec
=
exec
.
replace
(
"{basePath}"
,
aliyunOSSConfigConstant
.
getFolder
());
//exec=exec.replace("'basePath':'erp/'","'basePath':'"+ossPath+"'");
System
.
out
.
println
(
"exec:"
+
exec
);
System
.
out
.
println
(
"exec:"
+
exec
);
/*if(!exec.contains("videoMaxSize")) {
JSONObject jsonConfig =new JSONObject(exec);
jsonConfig.put("url", imageUrl+jsonConfig.getString("url"));
System.out.println(jsonConfig);
exec=jsonConfig.toString();
}*/
PrintWriter
writer
=
response
.
getWriter
();
writer
.
write
(
exec
);
writer
.
flush
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论