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
667e4352
Commit
667e4352
authored
Aug 09, 2019
by
铭飞
Committed by
Gitee
Aug 09, 2019
Browse files
!174 搜索模板
Merge pull request !174 from 灰色DT/4.7.1
parents
10deda68
e8f2f849
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
667e4352
...
...
@@ -30,6 +30,8 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -194,8 +196,17 @@ public class GeneraterAction extends BaseAction {
CmsParserUtil
.
generateList
(
column
,
articleIdList
.
size
());
break
;
case
ColumnEntity
.
COLUMN_TYPE_COVER
:
// 单页
if
(
articleIdList
.
size
()==
0
){
ColumnArticleIdBean
columnArticleIdBean
=
new
ColumnArticleIdBean
();
CopyOptions
copyOptions
=
CopyOptions
.
create
();
copyOptions
.
setIgnoreError
(
true
);
BeanUtil
.
copyProperties
(
column
,
columnArticleIdBean
,
copyOptions
);
articleIdList
.
add
(
columnArticleIdBean
);
}
CmsParserUtil
.
generateBasic
(
articleIdList
);
break
;
default
:
throw
new
IllegalStateException
(
"Unexpected value: "
+
column
.
getColumnType
());
}
}
}
catch
(
IOException
e
)
{
...
...
src/main/java/net/mingsoft/config/WebConfig.java
View file @
667e4352
...
...
@@ -53,19 +53,13 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
//jar包方式映射处理
String
classPath
=
BasicUtil
.
getClassPath
(
""
);
if
(
classPath
.
startsWith
(
"file"
))
{
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"upload"
)
+
File
.
separator
);
registry
.
addResourceHandler
(
"/html/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"html"
)
+
File
.
separator
);
registry
.
addResourceHandler
(
"/templets/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"templets"
)
+
File
.
separator
);
}
else
{
//必须做判断,不然jar运行的html路径会被覆盖掉
registry
.
addResourceHandler
(
"/html/**"
).
addResourceLocations
(
"/html/"
);
}
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"classpath:/static/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"classpath:/api/"
);
registry
.
addResourceHandler
(
"/upload/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"upload"
)
+
File
.
separator
);
registry
.
addResourceHandler
(
"/html/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"html"
)
+
File
.
separator
);
registry
.
addResourceHandler
(
"/templets/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"templets"
)
+
File
.
separator
);
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"app"
)
+
File
.
separator
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"static"
)
+
File
.
separator
,
"classpath:/static/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"file:"
+
BasicUtil
.
getRealPath
(
"api"
)
+
File
.
separator
,
"classpath:/api/"
);
}
/**
...
...
src/main/webapp/templets/1/default/search.htm
View file @
667e4352
...
...
@@ -27,10 +27,10 @@
</ul>
</div>
<div
class=
"ms-content-main-page"
>
<a
class=
"ms-content-main-page-first"
href=
"{ms:
global.url/}{ms:
page.index/}"
>
首页
</a>
<a
class=
"ms-content-main-page-upper"
href=
"{ms:
global.url/}{ms:
page.pre/}"
>
上一页
</a>
<a
class=
"ms-content-main-page-next"
href=
"{ms:
global.url/}{ms:
page.next/}"
>
下一页
</a>
<a
class=
"ms-content-main-page-last"
href=
"{ms:
global.url/}{ms:
page.last/}"
>
末页
</a>
<a
class=
"ms-content-main-page-first"
href=
"{ms:page.index/}"
>
首页
</a>
<a
class=
"ms-content-main-page-upper"
href=
"{ms:page.pre/}"
>
上一页
</a>
<a
class=
"ms-content-main-page-next"
href=
"{ms:page.next/}"
>
下一页
</a>
<a
class=
"ms-content-main-page-last"
href=
"{ms:page.last/}"
>
末页
</a>
</div>
</div>
</div>
...
...
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