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
4fe9d288
Unverified
Commit
4fe9d288
authored
Mar 28, 2019
by
Van
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/3.5.0-dev' into 3.5.0-dev
parents
d6354ff1
910824c9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
62 additions
and
27 deletions
+62
-27
README.md
README.md
+8
-7
pom.xml
pom.xml
+1
-1
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+1
-1
src/main/java/org/b3log/solo/event/B3ArticleSender.java
src/main/java/org/b3log/solo/event/B3ArticleSender.java
+2
-2
src/main/java/org/b3log/solo/event/B3CommentSender.java
src/main/java/org/b3log/solo/event/B3CommentSender.java
+2
-1
src/main/java/org/b3log/solo/processor/B3Receiver.java
src/main/java/org/b3log/solo/processor/B3Receiver.java
+24
-8
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
+11
-1
src/main/java/org/b3log/solo/service/ExportService.java
src/main/java/org/b3log/solo/service/ExportService.java
+3
-2
src/main/java/org/b3log/solo/service/UserMgmtService.java
src/main/java/org/b3log/solo/service/UserMgmtService.java
+8
-2
src/main/webapp/common-template/start.ftl
src/main/webapp/common-template/start.ftl
+2
-2
No files found.
README.md
View file @
4fe9d288
...
@@ -56,23 +56,23 @@
...
@@ -56,23 +56,23 @@
### 开始使用
### 开始使用


### 后台首页
### 后台首页


### 编辑文章
### 编辑文章


### 选择皮肤
### 选择皮肤


### 前台界面
### 前台界面


## 安装
## 安装
...
@@ -98,7 +98,8 @@ docker pull b3log/solo
...
@@ -98,7 +98,8 @@ docker pull b3log/solo
*
使用 MySQL
*
使用 MySQL
先手动建库(字符集使用
`utf8mb4`
,排序规则
`utf8mb4_general_ci`
),然后启动容器:
先手动建库(库名
`solo`
,字符集使用
`utf8mb4`
,排序规则
`utf8mb4_general_ci`
),然后启动容器:
```
shell
```
shell
docker run
--detach
--name
solo
--network
=
host
\
docker run
--detach
--name
solo
--network
=
host
\
--env
RUNTIME_DB
=
"MYSQL"
\
--env
RUNTIME_DB
=
"MYSQL"
\
...
@@ -110,7 +111,7 @@ docker pull b3log/solo
...
@@ -110,7 +111,7 @@ docker pull b3log/solo
```
```
为了简单,使用了主机网络模式来连接主机上的 MySQL。
为了简单,使用了主机网络模式来连接主机上的 MySQL。
*
使用 H2 Databse
*
使用 H2 Datab
a
se
```
shell
```
shell
docker run
--detach
--name
solo
--volume
~/solo_h2/:/opt/solo/h2/
--publish
8080:8080
\
docker run
--detach
--name
solo
--volume
~/solo_h2/:/opt/solo/h2/
--publish
8080:8080
\
...
...
pom.xml
View file @
4fe9d288
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
</scm>
</scm>
<properties>
<properties>
<org.b3log.latke.version>
2.4.4
7
</org.b3log.latke.version>
<org.b3log.latke.version>
2.4.4
8
</org.b3log.latke.version>
<slf4j.version>
1.7.5
</slf4j.version>
<slf4j.version>
1.7.5
</slf4j.version>
<jsoup.version>
1.9.1
</jsoup.version>
<jsoup.version>
1.9.1
</jsoup.version>
...
...
src/main/java/org/b3log/solo/Starter.java
View file @
4fe9d288
...
@@ -107,7 +107,7 @@ public final class Starter {
...
@@ -107,7 +107,7 @@ public final class Starter {
final
boolean
isWindows
=
System
.
getProperty
(
"os.name"
).
toLowerCase
().
contains
(
"windows"
);
final
boolean
isWindows
=
System
.
getProperty
(
"os.name"
).
toLowerCase
().
contains
(
"windows"
);
final
String
cmdSyntax
=
isWindows
?
"java -cp \"WEB-INF/lib/*;WEB-INF/classes\" org.b3log.solo.Starter"
final
String
cmdSyntax
=
isWindows
?
"java -cp \"WEB-INF/lib/*;WEB-INF/classes\" org.b3log.solo.Starter"
:
"java -cp \"WEB-INF/lib/*:WEB-INF/classes\" org.b3log.solo.Starter"
;
:
"java -cp \"WEB-INF/lib/*:WEB-INF/classes\" org.b3log.solo.Starter"
;
final
String
header
=
"\nSolo 是一款小而美的
Java 博客系统
。\n\n"
;
final
String
header
=
"\nSolo 是一款小而美的
博客系统,专为程序员设计
。\n\n"
;
final
String
footer
=
"\n提需求或报告缺陷请到项目网站: https://github.com/b3log/solo\n\n"
;
final
String
footer
=
"\n提需求或报告缺陷请到项目网站: https://github.com/b3log/solo\n\n"
;
try
{
try
{
commandLine
=
commandLineParser
.
parse
(
options
,
args
);
commandLine
=
commandLineParser
.
parse
(
options
,
args
);
...
...
src/main/java/org/b3log/solo/event/B3ArticleSender.java
View file @
4fe9d288
...
@@ -48,7 +48,7 @@ import org.json.JSONObject;
...
@@ -48,7 +48,7 @@ import org.json.JSONObject;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://hacpai.com/member/armstrong">ArmstrongCN</a>
* @author <a href="https://hacpai.com/member/armstrong">ArmstrongCN</a>
* @version 1.0.2.1
8, Feb 21
, 2019
* @version 1.0.2.1
9, Mar 27
, 2019
* @since 0.3.1
* @since 0.3.1
*/
*/
@Singleton
@Singleton
...
@@ -124,7 +124,7 @@ public class B3ArticleSender extends AbstractEventListener<JSONObject> {
...
@@ -124,7 +124,7 @@ public class B3ArticleSender extends AbstractEventListener<JSONObject> {
put
(
"article"
,
article
).
put
(
"article"
,
article
).
put
(
"client"
,
client
);
put
(
"client"
,
client
);
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://rhythm.b3log.org/api/article"
).
bodyText
(
requestJSONObject
.
toString
()).
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://rhythm.b3log.org/api/article"
).
bodyText
(
requestJSONObject
.
toString
()).
connectionTimeout
(
3000
).
timeout
(
7000
).
connectionTimeout
(
3000
).
timeout
(
7000
).
trustAllCerts
(
true
).
contentTypeJson
().
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
send
();
contentTypeJson
().
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
send
();
LOGGER
.
log
(
Level
.
INFO
,
"Pushed an article [title={0}] to Rhy, response [{1}]"
,
title
,
response
.
toString
());
LOGGER
.
log
(
Level
.
INFO
,
"Pushed an article [title={0}] to Rhy, response [{1}]"
,
title
,
response
.
toString
());
...
...
src/main/java/org/b3log/solo/event/B3CommentSender.java
View file @
4fe9d288
...
@@ -43,7 +43,7 @@ import org.json.JSONObject;
...
@@ -43,7 +43,7 @@ import org.json.JSONObject;
* This listener is responsible for sending comment to B3log Rhythm. Sees <a href="https://hacpai.com/b3log">B3log 构思</a> for more details.
* This listener is responsible for sending comment to B3log Rhythm. Sees <a href="https://hacpai.com/b3log">B3log 构思</a> for more details.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.
5, Feb 9
, 2019
* @version 1.0.1.
6, Mar 27
, 2019
* @since 0.5.5
* @since 0.5.5
*/
*/
@Singleton
@Singleton
...
@@ -116,6 +116,7 @@ public class B3CommentSender extends AbstractEventListener<JSONObject> {
...
@@ -116,6 +116,7 @@ public class B3CommentSender extends AbstractEventListener<JSONObject> {
put
(
"client"
,
client
);
put
(
"client"
,
client
);
HttpRequest
.
post
(
"https://rhythm.b3log.org/api/comment"
).
bodyText
(
requestJSONObject
.
toString
()).
HttpRequest
.
post
(
"https://rhythm.b3log.org/api/comment"
).
bodyText
(
requestJSONObject
.
toString
()).
connectionTimeout
(
3000
).
timeout
(
7000
).
trustAllCerts
(
true
).
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
contentTypeJson
().
sendAsync
();
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
contentTypeJson
().
sendAsync
();
LOGGER
.
log
(
Level
.
DEBUG
,
"Pushed a comment to Sym"
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Pushed a comment to Sym"
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
...
...
src/main/java/org/b3log/solo/processor/B3Receiver.java
View file @
4fe9d288
...
@@ -47,7 +47,7 @@ import java.util.Date;
...
@@ -47,7 +47,7 @@ import java.util.Date;
* Receiving articles and comments from B3log community. Visits <a href="https://hacpai.com/b3log">B3log 构思</a> for more details.
* Receiving articles and comments from B3log community. Visits <a href="https://hacpai.com/b3log">B3log 构思</a> for more details.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.0.1.
0, Feb 18
, 2019
* @version 2.0.1.
1, Mar 26
, 2019
* @since 0.5.5
* @since 0.5.5
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -153,7 +153,9 @@ public class B3Receiver {
...
@@ -153,7 +153,9 @@ public class B3Receiver {
final
JSONObject
articleAuthor
=
userRepository
.
getByUserName
(
articleAuthorName
);
final
JSONObject
articleAuthor
=
userRepository
.
getByUserName
(
articleAuthorName
);
if
(
null
==
articleAuthor
)
{
if
(
null
==
articleAuthor
)
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Not found user ["
+
articleAuthorName
+
"]"
);
final
String
msg
=
"Not found user ["
+
articleAuthorName
+
"]"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
...
@@ -162,18 +164,21 @@ public class B3Receiver {
...
@@ -162,18 +164,21 @@ public class B3Receiver {
final
String
key
=
articleAuthor
.
optString
(
UserExt
.
USER_B3_KEY
);
final
String
key
=
articleAuthor
.
optString
(
UserExt
.
USER_B3_KEY
);
if
(!
StringUtils
.
equals
(
key
,
b3Key
))
{
if
(!
StringUtils
.
equals
(
key
,
b3Key
))
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Wrong key"
);
final
String
msg
=
"Wrong key"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
final
JSONObject
symArticle
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
final
JSONObject
symArticle
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
final
String
title
=
symArticle
.
optString
(
"title"
);
final
String
articleId
=
symArticle
.
optString
(
"id"
);
final
String
articleId
=
symArticle
.
optString
(
"id"
);
final
JSONObject
oldArticle
=
articleQueryService
.
getArticleById
(
articleId
);
final
JSONObject
oldArticle
=
articleQueryService
.
getArticleById
(
articleId
);
if
(
null
==
oldArticle
)
{
if
(
null
==
oldArticle
)
{
final
JSONObject
article
=
new
JSONObject
().
final
JSONObject
article
=
new
JSONObject
().
put
(
Keys
.
OBJECT_ID
,
symArticle
.
optString
(
"id"
)).
put
(
Keys
.
OBJECT_ID
,
symArticle
.
optString
(
"id"
)).
put
(
Article
.
ARTICLE_TITLE
,
symArticle
.
optString
(
"title"
)
).
put
(
Article
.
ARTICLE_TITLE
,
title
).
put
(
Article
.
ARTICLE_CONTENT
,
symArticle
.
optString
(
"content"
)).
put
(
Article
.
ARTICLE_CONTENT
,
symArticle
.
optString
(
"content"
)).
put
(
Article
.
ARTICLE_TAGS_REF
,
symArticle
.
optString
(
"tags"
));
put
(
Article
.
ARTICLE_TAGS_REF
,
symArticle
.
optString
(
"tags"
));
article
.
put
(
Article
.
ARTICLE_AUTHOR_ID
,
articleAuthor
.
getString
(
Keys
.
OBJECT_ID
));
article
.
put
(
Article
.
ARTICLE_AUTHOR_ID
,
articleAuthor
.
getString
(
Keys
.
OBJECT_ID
));
...
@@ -187,6 +192,7 @@ public class B3Receiver {
...
@@ -187,6 +192,7 @@ public class B3Receiver {
article
.
put
(
Article
.
ARTICLE_CONTENT
,
content
);
article
.
put
(
Article
.
ARTICLE_CONTENT
,
content
);
final
JSONObject
addRequest
=
new
JSONObject
().
put
(
Article
.
ARTICLE
,
article
);
final
JSONObject
addRequest
=
new
JSONObject
().
put
(
Article
.
ARTICLE
,
article
);
articleMgmtService
.
addArticle
(
addRequest
);
articleMgmtService
.
addArticle
(
addRequest
);
LOGGER
.
log
(
Level
.
INFO
,
"Added an article ["
+
title
+
"] via Sym"
);
return
;
return
;
}
}
...
@@ -199,6 +205,7 @@ public class B3Receiver {
...
@@ -199,6 +205,7 @@ public class B3Receiver {
oldArticle
.
put
(
Common
.
POST_TO_COMMUNITY
,
false
);
// Do not send to rhythm
oldArticle
.
put
(
Common
.
POST_TO_COMMUNITY
,
false
);
// Do not send to rhythm
final
JSONObject
updateRequest
=
new
JSONObject
().
put
(
Article
.
ARTICLE
,
oldArticle
);
final
JSONObject
updateRequest
=
new
JSONObject
().
put
(
Article
.
ARTICLE
,
oldArticle
);
articleMgmtService
.
updateArticle
(
updateRequest
);
articleMgmtService
.
updateArticle
(
updateRequest
);
LOGGER
.
log
(
Level
.
INFO
,
"Updated an article ["
+
title
+
"] via Sym"
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
ret
.
put
(
Keys
.
CODE
,
1
).
put
(
Keys
.
MSG
,
e
.
getMessage
());
ret
.
put
(
Keys
.
CODE
,
1
).
put
(
Keys
.
MSG
,
e
.
getMessage
());
...
@@ -257,7 +264,9 @@ public class B3Receiver {
...
@@ -257,7 +264,9 @@ public class B3Receiver {
final
JSONObject
articleAuthor
=
userRepository
.
getByUserName
(
articleAuthorName
);
final
JSONObject
articleAuthor
=
userRepository
.
getByUserName
(
articleAuthorName
);
if
(
null
==
articleAuthor
)
{
if
(
null
==
articleAuthor
)
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Not found user ["
+
articleAuthorName
+
"]"
);
final
String
msg
=
"Not found user ["
+
articleAuthorName
+
"]"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
...
@@ -266,7 +275,9 @@ public class B3Receiver {
...
@@ -266,7 +275,9 @@ public class B3Receiver {
final
String
key
=
articleAuthor
.
optString
(
UserExt
.
USER_B3_KEY
);
final
String
key
=
articleAuthor
.
optString
(
UserExt
.
USER_B3_KEY
);
if
(!
StringUtils
.
equals
(
key
,
b3Key
))
{
if
(!
StringUtils
.
equals
(
key
,
b3Key
))
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Wrong key"
);
final
String
msg
=
"Wrong key"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
...
@@ -275,7 +286,9 @@ public class B3Receiver {
...
@@ -275,7 +286,9 @@ public class B3Receiver {
final
JSONObject
article
=
articleRepository
.
get
(
articleId
);
final
JSONObject
article
=
articleRepository
.
get
(
articleId
);
if
(
null
==
article
)
{
if
(
null
==
article
)
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Not found the specified article [id="
+
articleId
+
"]"
);
final
String
msg
=
"Not found the specified article [id="
+
articleId
+
"]"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
...
@@ -298,6 +311,7 @@ public class B3Receiver {
...
@@ -298,6 +311,7 @@ public class B3Receiver {
addUserReq
.
put
(
UserExt
.
USER_B3_KEY
,
""
);
addUserReq
.
put
(
UserExt
.
USER_B3_KEY
,
""
);
try
{
try
{
userMgmtService
.
addUser
(
addUserReq
);
userMgmtService
.
addUser
(
addUserReq
);
LOGGER
.
log
(
Level
.
INFO
,
"Created a user [role="
+
Role
.
VISITOR_ROLE
+
"] via Sym comment"
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Adds a user ["
+
commentName
+
"] failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Adds a user ["
+
commentName
+
"] failed"
,
e
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
...
@@ -309,7 +323,9 @@ public class B3Receiver {
...
@@ -309,7 +323,9 @@ public class B3Receiver {
if
(!
optionQueryService
.
allowComment
()
||
!
article
.
optBoolean
(
Article
.
ARTICLE_COMMENTABLE
))
{
if
(!
optionQueryService
.
allowComment
()
||
!
article
.
optBoolean
(
Article
.
ARTICLE_COMMENTABLE
))
{
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
CODE
,
1
);
ret
.
put
(
Keys
.
MSG
,
"Not allow comment"
);
final
String
msg
=
"Not allow comment"
;
ret
.
put
(
Keys
.
MSG
,
msg
);
LOGGER
.
log
(
Level
.
WARN
,
msg
);
return
;
return
;
}
}
...
...
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
View file @
4fe9d288
...
@@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
...
@@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
* </ul>
* </ul>
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
7, Mar 4
, 2019
* @version 1.0.0.
8, Mar 27
, 2019
* @since 2.9.5
* @since 2.9.5
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -202,6 +202,16 @@ public class OAuthProcessor {
...
@@ -202,6 +202,16 @@ public class OAuthProcessor {
LOGGER
.
log
(
Level
.
ERROR
,
"Register via oauth failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Register via oauth failed"
,
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
return
;
}
}
else
{
user
.
put
(
UserExt
.
USER_GITHUB_ID
,
openId
);
try
{
userMgmtService
.
updateUser
(
user
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Update user GitHub id failed"
,
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
return
;
return
;
}
}
}
}
...
...
src/main/java/org/b3log/solo/service/ExportService.java
View file @
4fe9d288
...
@@ -53,7 +53,7 @@ import java.util.stream.Collectors;
...
@@ -53,7 +53,7 @@ import java.util.stream.Collectors;
* Export service.
* Export service.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.
3, Mar 19
, 2019
* @version 1.1.0.
4, Mar 27
, 2019
* @since 2.5.0
* @since 2.5.0
*/
*/
@Service
@Service
...
@@ -240,7 +240,8 @@ public class ExportService {
...
@@ -240,7 +240,8 @@ public class ExportService {
bodyBuilder
.
append
(
"### 热议\n"
).
append
(
mostCmtBuilder
);
bodyBuilder
.
append
(
"### 热议\n"
).
append
(
mostCmtBuilder
);
}
}
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://hacpai.com/github/repos"
).
connectionTimeout
(
7000
).
timeout
(
60000
).
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://hacpai.com/github/repos"
).
connectionTimeout
(
7000
).
timeout
(
60000
).
trustAllCerts
(
true
).
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
form
(
"userName"
,
userName
,
form
(
"userName"
,
userName
,
"userB3Key"
,
userB3Ke
,
"userB3Key"
,
userB3Ke
,
"clientName"
,
"Solo"
,
"clientName"
,
"Solo"
,
...
...
src/main/java/org/b3log/solo/service/UserMgmtService.java
View file @
4fe9d288
...
@@ -48,7 +48,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -48,7 +48,7 @@ import javax.servlet.http.HttpServletResponse;
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://hacpai.com/member/DASHU">DASHU</a>
* @author <a href="https://hacpai.com/member/DASHU">DASHU</a>
* @author <a href="https://github.com/nanolikeyou">nanolikeyou</a>
* @author <a href="https://github.com/nanolikeyou">nanolikeyou</a>
* @version 1.1.0.1
7, Mar 20
, 2019
* @version 1.1.0.1
8, Mar 27
, 2019
* @since 0.4.0
* @since 0.4.0
*/
*/
@Service
@Service
...
@@ -156,7 +156,8 @@ public class UserMgmtService {
...
@@ -156,7 +156,8 @@ public class UserMgmtService {
* "userName": "",
* "userName": "",
* "userRole": "",
* "userRole": "",
* "userURL": "",
* "userURL": "",
* "userB3Key": ""
* "userB3Key": "",
* "userGitHubId": "" // optional
* @throws ServiceException service exception
* @throws ServiceException service exception
*/
*/
public
void
updateUser
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
public
void
updateUser
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
...
@@ -192,6 +193,11 @@ public class UserMgmtService {
...
@@ -192,6 +193,11 @@ public class UserMgmtService {
final
String
userB3Key
=
requestJSONObject
.
optString
(
UserExt
.
USER_B3_KEY
);
final
String
userB3Key
=
requestJSONObject
.
optString
(
UserExt
.
USER_B3_KEY
);
oldUser
.
put
(
UserExt
.
USER_B3_KEY
,
userB3Key
);
oldUser
.
put
(
UserExt
.
USER_B3_KEY
,
userB3Key
);
final
String
userGitHubId
=
requestJSONObject
.
optString
(
UserExt
.
USER_GITHUB_ID
);
if
(
StringUtils
.
isNotBlank
(
userGitHubId
))
{
oldUser
.
put
(
UserExt
.
USER_GITHUB_ID
,
userGitHubId
);
}
userRepository
.
update
(
oldUserId
,
oldUser
);
userRepository
.
update
(
oldUserId
,
oldUser
);
transaction
.
commit
();
transaction
.
commit
();
}
catch
(
final
RepositoryException
e
)
{
}
catch
(
final
RepositoryException
e
)
{
...
...
src/main/webapp/common-template/start.ftl
View file @
4fe9d288
...
@@ -36,9 +36,9 @@
...
@@ -36,9 +36,9 @@
<a class="github__link" href="javascript:$('ul').slideToggle()">查看 GitHub 数据使用说明</a>
<a class="github__link" href="javascript:$('ul').slideToggle()">查看 GitHub 数据使用说明</a>
<div class="github__text">
<div class="github__text">
<ul>
<ul>
<li>获取用户名、
昵称、头像用于账号
初始化</li>
<li>获取用户名、
头像等用于
初始化</li>
<li>获取公开仓库信息用于展示</li>
<li>获取公开仓库信息用于展示</li>
<li>不会对你的
数据进行任何写入操作
</li>
<li>不会对你的
已有数据进行写入
</li>
</ul>
</ul>
</div>
</div>
<label class="github__check">
<label class="github__check">
...
...
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