Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
46bebfa1
Commit
46bebfa1
authored
Sep 29, 2019
by
铭飞
Committed by
Gitee
Sep 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
!186 自定义文件夹
Merge pull request !186 from 灰色DT/4.7.2
parents
398d5d05
b5ba1bf1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
6 deletions
+22
-6
ArticleAction.java
src/main/java/net/mingsoft/cms/action/ArticleAction.java
+1
-0
ColumnAction.java
src/main/java/net/mingsoft/cms/action/ColumnAction.java
+3
-0
WebConfig.java
src/main/java/net/mingsoft/config/WebConfig.java
+17
-1
application.yml
src/main/resources/application.yml
+0
-4
article_form.ftl
src/main/webapp/WEB-INF/manager/cms/article/article_form.ftl
+1
-1
No files found.
src/main/java/net/mingsoft/cms/action/ArticleAction.java
View file @
46bebfa1
...
@@ -535,6 +535,7 @@ public class ArticleAction extends BaseAction {
...
@@ -535,6 +535,7 @@ public class ArticleAction extends BaseAction {
}
}
model
.
addAttribute
(
"columnType"
,
columnType
);
model
.
addAttribute
(
"columnType"
,
columnType
);
model
.
addAttribute
(
"categoryId"
,
column
.
getCategoryId
());
// 编辑封面
model
.
addAttribute
(
"categoryId"
,
column
.
getCategoryId
());
// 编辑封面
model
.
addAttribute
(
"websiteId"
,
BasicUtil
.
getAppId
());
return
"/cms/article/article_form"
;
return
"/cms/article/article_form"
;
}
else
{
// 非法
}
else
{
// 非法
// return "/cms/article/article_form");
// 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{
...
@@ -93,6 +93,8 @@ public class ColumnAction extends BaseAction{
model
.
addAttribute
(
"column"
,
new
ColumnEntity
());
model
.
addAttribute
(
"column"
,
new
ColumnEntity
());
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"websiteId"
,
appId
);
return
"/basic/column/form"
;
return
"/basic/column/form"
;
}
}
...
@@ -216,6 +218,7 @@ public class ColumnAction extends BaseAction{
...
@@ -216,6 +218,7 @@ public class ColumnAction extends BaseAction{
model
.
addAttribute
(
"columnSuper"
,
columnSuper
);
model
.
addAttribute
(
"columnSuper"
,
columnSuper
);
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"listColumn"
,
JSONArray
.
toJSONString
(
list
));
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"websiteId"
,
appId
);
return
"/basic/column/form"
;
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;
...
@@ -32,6 +32,16 @@ import net.mingsoft.basic.util.BasicUtil;
@Configuration
@Configuration
public
class
WebConfig
implements
WebMvcConfigurer
{
public
class
WebConfig
implements
WebMvcConfigurer
{
/**
* 上传路径
*/
@Value
(
"${ms.upload.path}"
)
private
String
uploadFloderPath
;
/**
* 上传路径映射
*/
@Value
(
"${ms.upload.mapping}"
)
private
String
uploadMapping
;
@Bean
@Bean
public
ActionInterceptor
actionInterceptor
()
{
public
ActionInterceptor
actionInterceptor
()
{
return
new
ActionInterceptor
();
return
new
ActionInterceptor
();
...
@@ -62,7 +72,13 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -62,7 +72,13 @@ public class WebConfig implements WebMvcConfigurer {
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
,
"/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
);
registry
.
addResourceHandler
(
"/static/**"
,
"/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"/api/"
,
"file:api/"
,
"classpath:/api/"
);
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注册
* druidServlet注册
...
...
src/main/resources/application.yml
View file @
46bebfa1
...
@@ -15,12 +15,8 @@ ms:
...
@@ -15,12 +15,8 @@ ms:
path
:
/upload
path
:
/upload
mapping
:
/upload/**
mapping
:
/upload/**
denied
:
.exe,.jsp
denied
:
.exe,.jsp
allowed
:
jpg
max-size
:
1
memory-size
:
4096
spring
:
spring
:
http.multipart.enabled
:
false
profiles
:
profiles
:
active
:
dev
active
:
dev
mvc
:
mvc
:
...
...
src/main/webapp/WEB-INF/manager/cms/article/article_form.ftl
View file @
46bebfa1
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
listKey="id" listValue="value" label="是否显示" help="选择否后前端将不显示,需要重新生成才有效果"
listKey="id" listValue="value" label="是否显示" help="选择否后前端将不显示,需要重新生成才有效果"
/>
/>
<@ms.formRow colSm="2" label="文章缩略图" width="400" >
<@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.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="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个字符以内!"} />
<@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
Markdown
is supported
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