Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
fcc37e05
Unverified
Commit
fcc37e05
authored
Apr 22, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12768
parent
1fbcedd4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
50 deletions
+9
-50
src/main/java/org/b3log/solo/service/PageMgmtService.java
src/main/java/org/b3log/solo/service/PageMgmtService.java
+2
-31
src/main/webapp/js/admin/admin.js
src/main/webapp/js/admin/admin.js
+2
-13
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+2
-2
src/main/webapp/js/admin/pageList.js
src/main/webapp/js/admin/pageList.js
+3
-4
No files found.
src/main/java/org/b3log/solo/service/PageMgmtService.java
View file @
fcc37e05
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.PageRepository
;
import
org.b3log.solo.repository.PageRepository
;
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
oldPermalink
=
oldPage
.
getString
(
Page
.
PAGE_PERMALINK
);
if
(!
oldPermalink
.
equals
(
permalink
))
{
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(!
oldPermalink
.
equals
(
permalink
)
&&
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"duplicatedPermalinkLabel"
));
}
}
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
transaction
.
rollback
();
...
...
src/main/webapp/js/admin/admin.js
View file @
fcc37e05
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
* @description index for admin
* @description index for admin
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.0, Mar 30, 2019
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.0.0, Apr 22, 2019
*/
*/
Util
.
htmlDecode
=
function
(
code
)
{
Util
.
htmlDecode
=
function
(
code
)
{
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
return
div
.
innerText
return
div
.
innerText
}
}
/**
* @description URL 没有协议头,则自动加上 http://
* @param {String} url URL 地址
* @returns {String} 添加后的URL
*/
Util
.
proessURL
=
function
(
url
)
{
if
(
!
/^
\w
+:
\/\/
/
.
test
(
url
))
{
url
=
'
http://
'
+
url
}
return
url
}
var
Admin
=
function
()
{
var
Admin
=
function
()
{
this
.
register
=
{}
this
.
register
=
{}
// 工具栏下的工具
// 工具栏下的工具
...
...
src/main/webapp/js/admin/admin.min.js
View file @
fcc37e05
This diff is collapsed.
Click to expand it.
src/main/webapp/js/admin/pageList.js
View file @
fcc37e05
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.
0, Feb 6
, 2019
* @version 1.3.0.
1, Apr 22
, 2019
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
...
@@ -202,7 +202,7 @@ admin.pageList = {
...
@@ -202,7 +202,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
)
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
...
@@ -255,8 +255,7 @@ admin.pageList = {
...
@@ -255,8 +255,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
));
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
...
...
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