Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MCMS
Commits
1a7f4e9e
Commit
1a7f4e9e
authored
7 years ago
by
铭飞
Browse files
Options
Download
Plain Diff
!68 修改预览主页
Merge pull request !68 from TanWH/4.6.3
parents
97dd8460
28cd1630
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/mingsoft/cms/action/GeneraterAction.java
+5
-21
src/main/java/com/mingsoft/cms/action/GeneraterAction.java
src/main/webapp/WEB-INF/manager/cms/generate/index.ftl
+1
-13
src/main/webapp/WEB-INF/manager/cms/generate/index.ftl
with
6 additions
and
34 deletions
+6
-34
src/main/java/com/mingsoft/cms/action/GeneraterAction.java
+
5
-
21
View file @
1a7f4e9e
...
...
@@ -772,28 +772,12 @@ public class GeneraterAction extends BaseAction {
* @return
*/
@RequestMapping
(
"/{position}/viewIndex"
)
public
void
viewIndex
(
HttpServletRequest
request
,
@PathVariable
String
position
,
HttpServletResponse
response
)
{
//获取应用实体信息
AppEntity
app
=
this
.
getApp
(
request
);
public
String
viewIndex
(
HttpServletRequest
request
,
@PathVariable
String
position
,
HttpServletResponse
response
)
{
AppEntity
app
=
BasicUtil
.
getApp
();
//组织主页预览地址
String
indexPosition
=
app
.
getAppHostUrl
()
+
"/"
+
IParserRegexConstant
.
HTML_SAVE_PATH
+
"/"
+
app
.
getAppId
()
+
"/"
+
position
;
//请求更新后的主页,如果返回200就是是更新成功,可以访问,返回404,就是 更新不成功或者是没有更新主页,返回false
URL
url
;
HttpURLConnection
huc
;
try
{
url
=
new
URL
(
indexPosition
);
huc
=
(
HttpURLConnection
)
url
.
openConnection
();
System
.
out
.
println
(
huc
.
getResponseCode
());
huc
.
connect
();
if
(
huc
.
getResponseCode
()!=
200
){
this
.
outJson
(
response
,
false
);
}
}
catch
(
MalformedURLException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
this
.
outJson
(
response
,
true
,
indexPosition
);
String
indexPosition
=
app
.
getAppHostUrl
()
+
File
.
separator
+
IParserRegexConstant
.
HTML_SAVE_PATH
+
File
.
separator
+
app
.
getAppId
()
+
File
.
separator
+
position
;
return
"redirect:"
+
indexPosition
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/manager/cms/generate/index.ftl
+
1
-
13
View file @
1a7f4e9e
...
...
@@ -106,19 +106,7 @@
//点击预览时,进行预览
$("#viewIndex").click(function()
{
var
position
=$
(
"input[name='position']"
)
.val
()
;
var
urlStr
=
'$
{
managerPath
}
/
cms
/
generate
/'+
position
+'/
viewIndex
.do
';
$
.ajax
({
type
:
"get"
,
url
:
urlStr
,
success
:
function
(
msg
)
{
//返回数据根据结果进行相应的处理
if
(
msg
.result
){
var
url
=
msg
.resultMsg
;
window
.open
(
url
,
"_blank"
)
;
}
else
{
<@
ms
.notify
msg
=
"请先生成主页,再次访问"
type
=
"warning"
/>
}
}
})
window
.open
(
"${managerPath}/cms/generate/"
+
position
+
"/viewIndex.do"
)
;
}
);
</
script
>
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help