Commit c04e12f0 authored by Liang Ding's avatar Liang Ding

Merge branch '2.9.1-dev'

parents 2e3b0b34 9d19b353
...@@ -74,7 +74,7 @@ import java.util.*; ...@@ -74,7 +74,7 @@ import java.util.*;
* Admin console render processing. * Admin console render processing.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.7.0.2, Apr 5, 2018 * @version 1.7.0.3, Jun 21, 2018
* @since 0.4.1 * @since 0.4.1
*/ */
@RequestProcessor @RequestProcessor
...@@ -171,28 +171,6 @@ public class AdminConsole { ...@@ -171,28 +171,6 @@ public class AdminConsole {
} }
try { try {
final JSONObject qiniu = optionQueryService.getOptions(Option.CATEGORY_C_QINIU);
dataModel.put(Option.ID_C_QINIU_DOMAIN, "");
dataModel.put("qiniuUploadToken", "");
if (null != qiniu && StringUtils.isNotBlank(qiniu.optString(Option.ID_C_QINIU_ACCESS_KEY))
&& StringUtils.isNotBlank(qiniu.optString(Option.ID_C_QINIU_SECRET_KEY))
&& StringUtils.isNotBlank(qiniu.optString(Option.ID_C_QINIU_BUCKET))
&& StringUtils.isNotBlank(qiniu.optString(Option.ID_C_QINIU_DOMAIN))) {
try {
final Auth auth = Auth.create(qiniu.optString(Option.ID_C_QINIU_ACCESS_KEY),
qiniu.optString(Option.ID_C_QINIU_SECRET_KEY));
final String uploadToken = auth.uploadToken(qiniu.optString(Option.ID_C_QINIU_BUCKET),
null, 3600 * 6, null);
dataModel.put("qiniuUploadToken", uploadToken);
dataModel.put(Option.ID_C_QINIU_DOMAIN, qiniu.optString(Option.ID_C_QINIU_DOMAIN));
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Qiniu settings error", e);
}
}
final JSONObject preference = preferenceQueryService.getPreference(); final JSONObject preference = preferenceQueryService.getPreference();
dataModel.put(Option.ID_C_LOCALE_STRING, preference.getString(Option.ID_C_LOCALE_STRING)); dataModel.put(Option.ID_C_LOCALE_STRING, preference.getString(Option.ID_C_LOCALE_STRING));
......
...@@ -24,11 +24,6 @@ ...@@ -24,11 +24,6 @@
"isLoggedIn": "true" "isLoggedIn": "true"
}; };
var qiniu = {
"qiniuUploadToken": "${qiniuUploadToken}",
"qiniuDomain": "${qiniuDomain}"
};
var Label = { var Label = {
"skinDirName": "${skinDirName}", "skinDirName": "${skinDirName}",
"editorType": "${editorType}", "editorType": "${editorType}",
......
...@@ -251,10 +251,8 @@ admin.editors.CodeMirror = { ...@@ -251,10 +251,8 @@ admin.editors.CodeMirror = {
Util.initUploadFile({ Util.initUploadFile({
"id": conf.id + 'fileUpload', "id": conf.id + 'fileUpload',
"pasteZone": $('#' + conf.id).next().next(), "pasteZone": $('#' + conf.id).next().next(),
"qiniuUploadToken": qiniu.qiniuUploadToken,
"editor": commentEditor.codemirror, "editor": commentEditor.codemirror,
"uploadingLabel": '', "uploadingLabel": ''
"qiniuDomain": '//' + qiniu.qiniuDomain
}); });
this[conf.id] = commentEditor.codemirror; this[conf.id] = commentEditor.codemirror;
......
...@@ -861,10 +861,8 @@ admin.editors.CodeMirror = { ...@@ -861,10 +861,8 @@ admin.editors.CodeMirror = {
Util.initUploadFile({ Util.initUploadFile({
"id": conf.id + 'fileUpload', "id": conf.id + 'fileUpload',
"pasteZone": $('#' + conf.id).next().next(), "pasteZone": $('#' + conf.id).next().next(),
"qiniuUploadToken": qiniu.qiniuUploadToken,
"editor": commentEditor.codemirror, "editor": commentEditor.codemirror,
"uploadingLabel": '', "uploadingLabel": ''
"qiniuDomain": '//' + qiniu.qiniuDomain
}); });
this[conf.id] = commentEditor.codemirror; this[conf.id] = commentEditor.codemirror;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -23,11 +23,6 @@ ...@@ -23,11 +23,6 @@
"servePath": "${servePath}" "servePath": "${servePath}"
}; };
var qiniu = {
"qiniuUploadToken": "${qiniuUploadToken}",
"qiniuDomain": "${qiniuDomain}"
};
var Label = { var Label = {
"skinDirName": "${skinDirName}", "skinDirName": "${skinDirName}",
"editorType": "${editorType}", "editorType": "${editorType}",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment