Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
6b40267e
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b40267e
编写于
8月 12, 2022
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增移动端应用页面图片替换
上级
1ce7cc36
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
168 addition
and
0 deletion
+168
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/AppStyle.java
...rc/main/java/com/x/base/core/project/config/AppStyle.java
+18
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/ActionImageApplicationTop.java
...gram/center/jaxrs/appstyle/ActionImageApplicationTop.java
+63
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/ActionImageApplicationTopErase.java
...center/jaxrs/appstyle/ActionImageApplicationTopErase.java
+39
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/AppStyleAction.java
...a/com/x/program/center/jaxrs/appstyle/AppStyleAction.java
+37
-0
o2web/source/o2_core/o2/xAction/services/x_program_center.json
.../source/o2_core/o2/xAction/services/x_program_center.json
+3
-0
o2web/source/x_component_Setting/Document.js
o2web/source/x_component_Setting/Document.js
+6
-0
o2web/source/x_component_Setting/lp/en.js
o2web/source/x_component_Setting/lp/en.js
+1
-0
o2web/source/x_component_Setting/lp/zh-cn.js
o2web/source/x_component_Setting/lp/zh-cn.js
+1
-0
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/AppStyle.java
浏览文件 @
6b40267e
此差异已折叠。
点击以展开。
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/ActionImageApplicationTop.java
0 → 100644
浏览文件 @
6b40267e
package
com.x.program.center.jaxrs.appstyle
;
import
com.x.base.core.project.config.AppStyle.Image
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.StringUtils
;
import
org.glassfish.jersey.media.multipart.FormDataContentDisposition
;
import
org.imgscalr.Scalr
;
import
org.imgscalr.Scalr.Method
;
import
javax.imageio.ImageIO
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
/**
* 应用页面顶部图片替换
* 730 * 390
*/
class
ActionImageApplicationTop
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
byte
[]
bytes
,
FormDataContentDisposition
disposition
)
throws
Exception
{
try
(
ByteArrayInputStream
bais
=
new
ByteArrayInputStream
(
bytes
);
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
if
(!
effectivePerson
.
isManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
.
getName
());
}
BufferedImage
image
=
ImageIO
.
read
(
bais
);
BufferedImage
scalrImage
=
Scalr
.
resize
(
image
,
Method
.
QUALITY
,
730
,
390
);
ImageIO
.
write
(
scalrImage
,
"png"
,
baos
);
String
value
=
Base64
.
encodeBase64String
(
baos
.
toByteArray
());
Image
o
=
Image
.
application_top
();
o
.
setValue
(
value
);
// 由于getImages设置了检查,所以只能对images进行处理
Set
<
Image
>
images
=
Config
.
appStyle
().
getImages
();
images
=
images
.
stream
().
filter
(
img
->
(!
StringUtils
.
equals
(
img
.
getName
(),
Image
.
name_application_top
)))
.
collect
(
Collectors
.
toSet
());
images
.
add
(
o
);
Config
.
appStyle
().
setImages
(
new
TreeSet
<>(
images
));
Config
.
appStyle
().
save
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
Config
.
flush
();
return
result
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/ActionImageApplicationTopErase.java
0 → 100644
浏览文件 @
6b40267e
package
com.x.program.center.jaxrs.appstyle
;
import
com.x.base.core.project.config.AppStyle.Image
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
class
ActionImageApplicationTopErase
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
if
(!
effectivePerson
.
isManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
.
getName
());
}
// 由于getImages设置了检查,所以只能对images进行处理
Set
<
Image
>
images
=
Config
.
appStyle
().
getImages
();
images
=
images
.
stream
().
filter
(
img
->
(!
StringUtils
.
equals
(
img
.
getName
(),
Image
.
name_application_top
)))
.
collect
(
Collectors
.
toSet
());
Config
.
appStyle
().
setImages
(
new
TreeSet
<
>(
images
));
Config
.
appStyle
().
save
();
Config
.
flush
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/appstyle/AppStyleAction.java
浏览文件 @
6b40267e
...
...
@@ -196,6 +196,25 @@ public class AppStyleAction extends BaseAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"设置图片:应用页面顶部图片,730x390."
,
action
=
ActionImageApplicationTop
.
class
)
@PUT
@Path
(
"image/application/top"
)
@Consumes
(
MediaType
.
MULTIPART_FORM_DATA
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
public
void
imageApplicationTop
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@FormDataParam
(
FILE_FIELD
)
final
byte
[]
bytes
,
@JaxrsParameterDescribe
(
"图片文件"
)
@FormDataParam
(
FILE_FIELD
)
final
FormDataContentDisposition
disposition
)
{
ActionResult
<
ActionImageApplicationTop
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionImageApplicationTop
().
execute
(
effectivePerson
,
bytes
,
disposition
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"删除图片:首页底部菜单中间主页的按钮(不选中)."
,
action
=
ActionImageMenuLogoBlurErase
.
class
)
@GET
@Path
(
"image/menu/logo/blur/erase"
)
...
...
@@ -304,4 +323,22 @@ public class AppStyleAction extends BaseAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"设置图片:应用页面顶部图片,730x390"
,
action
=
ActionImageApplicationTopErase
.
class
)
@GET
@Path
(
"image/application/top/erase"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
imageApplicationTopErase
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
ActionImageApplicationTopErase
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionImageApplicationTopErase
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
o2web/source/o2_core/o2/xAction/services/x_program_center.json
浏览文件 @
6b40267e
...
...
@@ -70,6 +70,9 @@
"imageSetupAboutLogo"
:
{
"uri"
:
"/jaxrs/appstyle/image/setup/about/logo"
,
"method"
:
"PUT"
,
"enctype"
:
"formData"
},
"imageSetupAboutLogoErase"
:
{
"uri"
:
"/jaxrs/appstyle/image/setup/about/logo/erase"
},
"imageApplicationTop"
:
{
"uri"
:
"/jaxrs/appstyle/image/application/top"
,
"method"
:
"PUT"
,
"enctype"
:
"formData"
},
"imageApplicationTopErase"
:
{
"uri"
:
"/jaxrs/appstyle/image/application/top/erase"
},
"setAppStyle"
:
{
"uri"
:
"/jaxrs/appstyle"
,
"method"
:
"PUT"
},
"listAgent"
:
{
"uri"
:
"/jaxrs/agent"
},
...
...
o2web/source/x_component_Setting/Document.js
浏览文件 @
6b40267e
...
...
@@ -444,6 +444,9 @@ MWF.xApplication.Setting.Document.Image = new Class({
case
"
setup_about_logo
"
:
method
=
"
imageSetupAboutLogo
"
;
break
;
case
"
application_top
"
:
method
=
"
imageApplicationTop
"
;
break
;
}
MWF
.
require
(
"
MWF.widget.Upload
"
,
function
(){
...
...
@@ -500,6 +503,9 @@ MWF.xApplication.Setting.Document.Image = new Class({
case
"
setup_about_logo
"
:
method
=
"
imageSetupAboutLogoErase
"
;
break
;
case
"
application_top
"
:
method
=
"
imageApplicationTopErase
"
;
break
;
}
this
.
actions
[
method
](
function
(){
this
.
actions
.
mobile_currentStyle
(
function
(
json
){
...
...
o2web/source/x_component_Setting/lp/en.js
浏览文件 @
6b40267e
...
...
@@ -189,6 +189,7 @@ MWF.xApplication.Setting.LP = {
"
mobile_style_imgs
"
:
{
"
launch_logo
"
:
"
Start logo
"
,
"
login_avatar
"
:
"
Default avatar for login page
"
,
"
application_top
"
:
"
Image at the Application page
"
,
"
index_bottom_menu_logo_blur
"
:
"
Home navigation icon (unchecked)
"
,
"
index_bottom_menu_logo_focus
"
:
"
Home navigation icon (selected)
"
,
"
people_avatar_default
"
:
"
User default avatar
"
,
...
...
o2web/source/x_component_Setting/lp/zh-cn.js
浏览文件 @
6b40267e
...
...
@@ -188,6 +188,7 @@ MWF.xApplication.Setting.LP = {
"
mobile_style_imgs
"
:
{
"
launch_logo
"
:
"
启动Logo
"
,
"
login_avatar
"
:
"
登录界面默认头像
"
,
"
application_top
"
:
"
应用页面顶部
"
,
"
index_bottom_menu_logo_blur
"
:
"
主页导航图标(未选中)
"
,
"
index_bottom_menu_logo_focus
"
:
"
主页导航图标(选中)
"
,
"
people_avatar_default
"
:
"
用户默认头像
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录