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
ce5846fb
Unverified
Commit
ce5846fb
authored
Dec 24, 2018
by
Van
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/2.9.8-dev' into 2.9.8-dev
parents
58a5199d
6b11e52c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
...a/org/b3log/solo/processor/console/PreferenceConsole.java
+14
-16
No files found.
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
View file @
ce5846fb
...
@@ -49,7 +49,7 @@ import static org.b3log.solo.model.Option.*;
...
@@ -49,7 +49,7 @@ import static org.b3log.solo.model.Option.*;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://github.com/hzchendou">hzchendou</a>
* @author <a href="https://github.com/hzchendou">hzchendou</a>
* @version 1.2.0.1
8, Dec 23
, 2018
* @version 1.2.0.1
9, Dec 24
, 2018
* @since 0.4.0
* @since 0.4.0
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -398,12 +398,14 @@ public class PreferenceConsole {
...
@@ -398,12 +398,14 @@ public class PreferenceConsole {
public
void
getOssPreference
(
final
RequestContext
context
)
{
public
void
getOssPreference
(
final
RequestContext
context
)
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
try
{
try
{
String
ossServerVal
=
CATEGORY_C_QINIU
;
String
ossServerVal
=
CATEGORY_C_QINIU
;
// 前端服务商切换 ossServer
// 前端服务商切换 ossServer
String
ossServerTemp
=
context
.
param
(
ID_C_CLOUD_STORAGE_KEY
);
String
ossServerTemp
=
context
.
param
(
ID_C_CLOUD_STORAGE_KEY
);
if
(
ossServerTemp
!=
null
&&
ossServerTemp
.
length
()
>
0
)
{
if
(
StringUtils
.
isNotBlank
(
ossServerTemp
)
)
{
ossServerVal
=
ossServerTemp
;
ossServerVal
=
ossServerTemp
;
}
else
{
}
else
{
final
JSONObject
ossServer
=
optionQueryService
.
getOptions
(
CATEGORY_C_CLOU_STORAGE
);
final
JSONObject
ossServer
=
optionQueryService
.
getOptions
(
CATEGORY_C_CLOU_STORAGE
);
...
@@ -412,15 +414,11 @@ public class PreferenceConsole {
...
@@ -412,15 +414,11 @@ public class PreferenceConsole {
}
}
}
}
final
JSONObject
oss
=
optionQueryService
.
getOptions
(
ossServerVal
);
JSONObject
oss
=
optionQueryService
.
getOptions
(
ossServerVal
);
if
(
null
==
oss
)
{
if
(
null
==
oss
)
{
renderer
.
setJSONObject
(
new
JSONObject
().
put
(
Keys
.
STATUS_CODE
,
false
));
oss
=
new
JSONObject
();
return
;
}
}
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
ret
.
put
(
"oss"
,
convertOssOpts
(
ossServerVal
,
oss
));
ret
.
put
(
"oss"
,
convertOssOpts
(
ossServerVal
,
oss
));
ret
.
put
(
Keys
.
STATUS_CODE
,
true
);
ret
.
put
(
Keys
.
STATUS_CODE
,
true
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
...
@@ -652,15 +650,15 @@ public class PreferenceConsole {
...
@@ -652,15 +650,15 @@ public class PreferenceConsole {
boolean
isAliyunServer
=
StringUtils
.
endsWithIgnoreCase
(
ossServer
,
CATEGORY_C_ALIYUN
);
boolean
isAliyunServer
=
StringUtils
.
endsWithIgnoreCase
(
ossServer
,
CATEGORY_C_ALIYUN
);
boolean
isQiniuServer
=
StringUtils
.
endsWithIgnoreCase
(
ossServer
,
CATEGORY_C_QINIU
);
boolean
isQiniuServer
=
StringUtils
.
endsWithIgnoreCase
(
ossServer
,
CATEGORY_C_QINIU
);
if
(
isAliyunServer
)
{
if
(
isAliyunServer
)
{
ret
.
put
(
"ossAccessKey"
,
oss
.
ge
tString
(
ID_C_ALIYUN_ACCESS_KEY
));
ret
.
put
(
"ossAccessKey"
,
oss
.
op
tString
(
ID_C_ALIYUN_ACCESS_KEY
));
ret
.
put
(
"ossSecretKey"
,
oss
.
ge
tString
(
ID_C_ALIYUN_SECRET_KEY
));
ret
.
put
(
"ossSecretKey"
,
oss
.
op
tString
(
ID_C_ALIYUN_SECRET_KEY
));
ret
.
put
(
"ossDomain"
,
oss
.
ge
tString
(
ID_C_ALIYUN_DOMAIN
));
ret
.
put
(
"ossDomain"
,
oss
.
op
tString
(
ID_C_ALIYUN_DOMAIN
));
ret
.
put
(
"ossBucket"
,
oss
.
ge
tString
(
ID_C_ALIYUN_BUCKET
));
ret
.
put
(
"ossBucket"
,
oss
.
op
tString
(
ID_C_ALIYUN_BUCKET
));
}
else
if
(
isQiniuServer
)
{
}
else
if
(
isQiniuServer
)
{
ret
.
put
(
"ossAccessKey"
,
oss
.
ge
tString
(
ID_C_QINIU_ACCESS_KEY
));
ret
.
put
(
"ossAccessKey"
,
oss
.
op
tString
(
ID_C_QINIU_ACCESS_KEY
));
ret
.
put
(
"ossSecretKey"
,
oss
.
ge
tString
(
ID_C_QINIU_SECRET_KEY
));
ret
.
put
(
"ossSecretKey"
,
oss
.
op
tString
(
ID_C_QINIU_SECRET_KEY
));
ret
.
put
(
"ossDomain"
,
oss
.
ge
tString
(
ID_C_QINIU_DOMAIN
));
ret
.
put
(
"ossDomain"
,
oss
.
op
tString
(
ID_C_QINIU_DOMAIN
));
ret
.
put
(
"ossBucket"
,
oss
.
ge
tString
(
ID_C_QINIU_BUCKET
));
ret
.
put
(
"ossBucket"
,
oss
.
op
tString
(
ID_C_QINIU_BUCKET
));
}
else
{
}
else
{
final
String
msg
=
"Unknown OSS server ["
+
ossServer
+
"]"
;
final
String
msg
=
"Unknown OSS server ["
+
ossServer
+
"]"
;
LOGGER
.
log
(
Level
.
ERROR
,
msg
);
LOGGER
.
log
(
Level
.
ERROR
,
msg
);
...
...
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