Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
46bebfa1
Commit
46bebfa1
authored
Sep 29, 2019
by
铭飞
Committed by
Gitee
Sep 29, 2019
Browse files
!186 自定义文件夹
Merge pull request !186 from 灰色DT/4.7.2
parents
398d5d05
b5ba1bf1
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/ArticleAction.java
View file @
46bebfa1
...
...
@@ -535,6 +535,7 @@ public class ArticleAction extends BaseAction {
}
model
.
addAttribute
(
"columnType"
,
columnType
);
model
.
addAttribute
(
"categoryId"
,
column
.
getCategoryId
());
// 编辑封面
model
.
addAttribute
(
"websiteId"
,
BasicUtil
.
getAppId
());
return
"/cms/article/article_form"
;
}
else
{
// 非法
// return "/cms/article/article_form");
...
...
src/main/java/net/mingsoft/cms/action/ColumnAction.java
View file @
46bebfa1
...
...
@@ -93,6 +93,8 @@ public class ColumnAction extends BaseAction{
model
.
addAttribute
(
"column"
,
new
ColumnEntity
());
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"websiteId"
,
appId
);
return
"/basic/column/form"
;
}
...
...
@@ -216,6 +218,7 @@ public class ColumnAction extends BaseAction{
model
.
addAttribute
(
"columnSuper"
,
columnSuper
);
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"websiteId"
,
appId
);
return
"/basic/column/form"
;
}
...
...
src/main/java/net/mingsoft/config/WebConfig.java
View file @
46bebfa1
...
...
@@ -32,6 +32,16 @@ import net.mingsoft.basic.util.BasicUtil;
@Configuration
public
class
WebConfig
implements
WebMvcConfigurer
{
/**
* 上传路径
*/
@Value
(
"${ms.upload.path}"
)
private
String
uploadFloderPath
;
/**
* 上传路径映射
*/
@Value
(
"${ms.upload.mapping}"
)
private
String
uploadMapping
;
@Bean
public
ActionInterceptor
actionInterceptor
()
{
return
new
ActionInterceptor
();
...
...
@@ -62,7 +72,13 @@ public class WebConfig implements WebMvcConfigurer {
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
,
"/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"/api/"
,
"file:api/"
,
"classpath:/api/"
);
if
(
new
File
(
uploadFloderPath
).
isAbsolute
()){
//如果指定了绝对路径,上传的文件都映射到uploadMapping下
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
"file:"
+
uploadFloderPath
+
File
.
separator
//映射其他路径文件
//,file:F://images
);
}
}
/**
* druidServlet注册
...
...
src/main/resources/application.yml
View file @
46bebfa1
...
...
@@ -15,12 +15,8 @@ ms:
path
:
/upload
mapping
:
/upload/**
denied
:
.exe,.jsp
allowed
:
jpg
max-size
:
1
memory-size
:
4096
spring
:
http.multipart.enabled
:
false
profiles
:
active
:
dev
mvc
:
...
...
src/main/webapp/WEB-INF/manager/cms/article/article_form.ftl
View file @
46bebfa1
...
...
@@ -18,7 +18,7 @@
listKey="id" listValue="value" label="是否显示" help="选择否后前端将不显示,需要重新生成才有效果"
/>
<@ms.formRow colSm="2" label="文章缩略图" width="400" >
<@ms.uploadImg path="
article" uploadFloderPath="$
{
articleImagesUrl
?
default
(
''
)}
" inputName="basicThumbnails" size="1" msg="提示:文章缩略图,支持jpg格式" imgs="$
{
article
.basicThumbnails
?
default
(
''
)}
" />
<@ms.uploadImg path="
$
{
websiteId
}
/article
" inputName="basicThumbnails" size="1" msg="提示:文章缩略图,支持jpg格式" imgs="$
{
article
.basicThumbnails
?
default
(
''
)}
" />
</@ms.formRow>
<@ms.text name="articleSource" colSm="2" width="200" label="文章来源" title="文章来源" size="5" placeholder="请输入文章来源" value="$
{
article
.articleSource
?
default
(
''
)}
" validation=
{
"maxlength"
:
"300"
,
"data-bv-stringlength-message"
:
"文章来源在300个字符以内!"
}
/>
<@ms.text name="articleAuthor" colSm="2" width="200" label="文章作者" title="文章作者" size="5" placeholder="请输入文章作者" value="$
{
article
.articleAuthor
?
default
(
''
)}
" validation=
{
"maxlength"
:
"12"
,
"data-bv-stringlength-message"
:
"文章作者在12个字符以内!"
}
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment