Commit a3610ca0 authored by vcjmhg's avatar vcjmhg

Merge branch 'dev' of https://github.com/88250/solo into dev

parents d653f16e 425ec935
This diff is collapsed.
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"css-loader": "^3.4.2", "css-loader": "^3.4.2",
"extract-loader": "^3.1.0", "extract-loader": "^3.1.0",
"file-loader": "^5.0.2", "file-loader": "^5.0.2",
"node-sass": "^4.13.1", "node-sass": "^4.14.1",
"optimize-css-assets-webpack-plugin": "^5.0.3", "optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
"webpack-cli": "^3.3.10" "webpack-cli": "^3.3.10"
}, },
"dependencies": { "dependencies": {
"jquery": "^3.4.1", "jquery": "^3.5.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"uvstat": "^1.0.7", "uvstat": "^1.0.7",
"vcmt": "^1.1.10", "vcmt": "^1.2.1",
"vditor": "^3.1.20" "vditor": "^3.2.6"
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Description: Solo POM. Description: Solo POM.
Version: 3.18.3.92, Apr 29, 2020 Version: 3.18.3.94, May 10, 2020
Author: <a href="http://88250.b3log.org">Liang Ding</a> Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a> Author: <a href="http://www.annpeter.cn">Ann Peter</a>
Author: <a href="http://vanessa.b3log.org">Vanessa</a> Author: <a href="http://vanessa.b3log.org">Vanessa</a>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</scm> </scm>
<properties> <properties>
<org.b3log.latke.version>3.3.4</org.b3log.latke.version> <org.b3log.latke.version>3.4.0</org.b3log.latke.version>
<jsoup.version>1.12.1</jsoup.version> <jsoup.version>1.12.1</jsoup.version>
<flexmark.version>0.50.40</flexmark.version> <flexmark.version>0.50.40</flexmark.version>
......
...@@ -17,7 +17,7 @@ else ...@@ -17,7 +17,7 @@ else
docker rm solo docker rm solo
docker run --detach --name solo --network=host \ docker run --detach --name solo --network=host \
--env RUNTIME_DB="MYSQL" \ --env RUNTIME_DB="MYSQL" \
--env JDBC_USERNAME="root" \ --env JDBC_USERNAME="root" \
--env JDBC_PASSWORD="123456" \ --env JDBC_PASSWORD="123456" \
--env JDBC_DRIVER="com.mysql.cj.jdbc.Driver" \ --env JDBC_DRIVER="com.mysql.cj.jdbc.Driver" \
--env JDBC_URL="jdbc:mysql://127.0.0.1:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC" \ --env JDBC_URL="jdbc:mysql://127.0.0.1:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC" \
......
...@@ -85,7 +85,7 @@ public final class Server extends BaseServer { ...@@ -85,7 +85,7 @@ public final class Server extends BaseServer {
public static class TailStringWriter extends StringWriter { public static class TailStringWriter extends StringWriter {
private AtomicInteger count = new AtomicInteger(); private final AtomicInteger count = new AtomicInteger();
@Override @Override
public void flush() { public void flush() {
...@@ -153,13 +153,11 @@ public final class Server extends BaseServer { ...@@ -153,13 +153,11 @@ public final class Server extends BaseServer {
commandLine = commandLineParser.parse(options, args); commandLine = commandLineParser.parse(options, args);
} catch (final ParseException e) { } catch (final ParseException e) {
helpFormatter.printHelp(cmdSyntax, header, options, footer, true); helpFormatter.printHelp(cmdSyntax, header, options, footer, true);
return; return;
} }
if (commandLine.hasOption("h")) { if (commandLine.hasOption("h")) {
helpFormatter.printHelp(cmdSyntax, header, options, footer, true); helpFormatter.printHelp(cmdSyntax, header, options, footer, true);
return; return;
} }
......
...@@ -73,19 +73,16 @@ public class B3ArticleSender extends AbstractEventListener<JSONObject> { ...@@ -73,19 +73,16 @@ public class B3ArticleSender extends AbstractEventListener<JSONObject> {
final String title = originalArticle.getString(Article.ARTICLE_TITLE); final String title = originalArticle.getString(Article.ARTICLE_TITLE);
if (Article.ARTICLE_STATUS_C_PUBLISHED != originalArticle.optInt(Article.ARTICLE_STATUS)) { if (Article.ARTICLE_STATUS_C_PUBLISHED != originalArticle.optInt(Article.ARTICLE_STATUS)) {
LOGGER.log(Level.INFO, "Ignored push a draft [title={}] to Rhy", title); LOGGER.log(Level.INFO, "Ignored push a draft [title={}] to Rhy", title);
return; return;
} }
if (StringUtils.isNotBlank(originalArticle.optString(Article.ARTICLE_VIEW_PWD))) { if (StringUtils.isNotBlank(originalArticle.optString(Article.ARTICLE_VIEW_PWD))) {
LOGGER.log(Level.INFO, "Article [title={}] is a password article, ignored push to Rhy", title); LOGGER.log(Level.INFO, "Article [title={}] is a password article, ignored push to Rhy", title);
return; return;
} }
if (!originalArticle.optBoolean(Common.POST_TO_COMMUNITY)) { if (!originalArticle.optBoolean(Common.POST_TO_COMMUNITY)) {
LOGGER.log(Level.INFO, "Article [title={}] push flag [postToCommunity] is [false], ignored push to Rhy", title); LOGGER.log(Level.INFO, "Article [title={}] push flag [postToCommunity] is [false], ignored push to Rhy", title);
return; return;
} }
......
...@@ -153,7 +153,7 @@ public final class Entry { ...@@ -153,7 +153,7 @@ public final class Entry {
/** /**
* Categories. * Categories.
*/ */
private Set<Category> categories = new HashSet<Category>(); private final Set<Category> categories = new HashSet<Category>();
/** /**
* Gets the URI. * Gets the URI.
......
...@@ -157,7 +157,7 @@ public final class Feed { ...@@ -157,7 +157,7 @@ public final class Feed {
/** /**
* Entries. * Entries.
*/ */
private List<Entry> entries = new ArrayList<>(); private final List<Entry> entries = new ArrayList<>();
/** /**
* Gets the id. * Gets the id.
......
...@@ -153,7 +153,7 @@ public final class Channel { ...@@ -153,7 +153,7 @@ public final class Channel {
/** /**
* Items. * Items.
*/ */
private List<Item> items = new ArrayList<>(); private final List<Item> items = new ArrayList<>();
/** /**
* Gets the atom link. * Gets the atom link.
......
...@@ -71,7 +71,7 @@ public final class Item { ...@@ -71,7 +71,7 @@ public final class Item {
/** /**
* Categories. * Categories.
*/ */
private Set<Category> categories = new HashSet<>(); private final Set<Category> categories = new HashSet<>();
/** /**
* Start guid element. * Start guid element.
......
...@@ -49,7 +49,7 @@ public final class Sitemap { ...@@ -49,7 +49,7 @@ public final class Sitemap {
/** /**
* URLs. * URLs.
*/ */
private List<URL> urls = new ArrayList<>(); private final List<URL> urls = new ArrayList<>();
/** /**
* Adds the specified url. * Adds the specified url.
......
...@@ -41,7 +41,7 @@ import java.util.Map; ...@@ -41,7 +41,7 @@ import java.util.Map;
*/ */
public class ToCPlugin extends NotInteractivePlugin { public class ToCPlugin extends NotInteractivePlugin {
private ToCEventHandler handler = new ToCEventHandler(); private final ToCEventHandler handler = new ToCEventHandler();
@Override @Override
public void changeStatus() { public void changeStatus() {
......
...@@ -143,14 +143,12 @@ public class ArticleProcessor { ...@@ -143,14 +143,12 @@ public class ArticleProcessor {
final String markdownText = context.requestJSON().optString("markdownText"); final String markdownText = context.requestJSON().optString("markdownText");
if (StringUtils.isBlank(markdownText)) { if (StringUtils.isBlank(markdownText)) {
result.put(Common.DATA, ""); result.put(Common.DATA, "");
return; return;
} }
if (!Solos.isLoggedIn(context)) { if (!Solos.isLoggedIn(context)) {
result.put(Keys.CODE, -1); result.put(Keys.CODE, -1);
result.put(Keys.MSG, langPropsService.get("getFailLabel")); result.put(Keys.MSG, langPropsService.get("getFailLabel"));
return; return;
} }
...@@ -173,14 +171,12 @@ public class ArticleProcessor { ...@@ -173,14 +171,12 @@ public class ArticleProcessor {
final String articleId = context.param("articleId"); final String articleId = context.param("articleId");
if (StringUtils.isBlank(articleId)) { if (StringUtils.isBlank(articleId)) {
context.sendError(404); context.sendError(404);
return; return;
} }
final JSONObject article = articleQueryService.getArticleById(articleId); final JSONObject article = articleQueryService.getArticleById(articleId);
if (null == article) { if (null == article) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -238,7 +234,6 @@ public class ArticleProcessor { ...@@ -238,7 +234,6 @@ public class ArticleProcessor {
} }
context.sendRedirect(Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK)); context.sendRedirect(Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK));
return; return;
} }
...@@ -266,7 +261,6 @@ public class ArticleProcessor { ...@@ -266,7 +261,6 @@ public class ArticleProcessor {
final JsonRenderer renderer = new JsonRenderer(); final JsonRenderer renderer = new JsonRenderer();
context.setRenderer(renderer); context.setRenderer(renderer);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
return; return;
} }
...@@ -299,7 +293,6 @@ public class ArticleProcessor { ...@@ -299,7 +293,6 @@ public class ArticleProcessor {
final JsonRenderer renderer = new JsonRenderer(); final JsonRenderer renderer = new JsonRenderer();
context.setRenderer(renderer); context.setRenderer(renderer);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
return; return;
} }
...@@ -308,14 +301,12 @@ public class ArticleProcessor { ...@@ -308,14 +301,12 @@ public class ArticleProcessor {
final String articleId = context.pathVar("id"); final String articleId = context.pathVar("id");
if (StringUtils.isBlank(articleId)) { if (StringUtils.isBlank(articleId)) {
context.sendError(404); context.sendError(404);
return; return;
} }
final JSONObject article = articleQueryService.getArticleById(articleId); final JSONObject article = articleQueryService.getArticleById(articleId);
if (null == article) { if (null == article) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -524,7 +515,6 @@ public class ArticleProcessor { ...@@ -524,7 +515,6 @@ public class ArticleProcessor {
final JSONObject authorRet = userQueryService.getUser(authorId); final JSONObject authorRet = userQueryService.getUser(authorId);
if (null == authorRet) { if (null == authorRet) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -568,7 +558,6 @@ public class ArticleProcessor { ...@@ -568,7 +558,6 @@ public class ArticleProcessor {
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
if (null == preference) { if (null == preference) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -578,14 +567,12 @@ public class ArticleProcessor { ...@@ -578,14 +567,12 @@ public class ArticleProcessor {
final JSONObject result = userQueryService.getUser(authorId); final JSONObject result = userQueryService.getUser(authorId);
if (null == result) { if (null == result) {
context.sendError(404); context.sendError(404);
return; return;
} }
final JSONObject articlesResult = articleQueryService.getArticlesByAuthorId(authorId, currentPageNum, pageSize); final JSONObject articlesResult = articleQueryService.getArticlesByAuthorId(authorId, currentPageNum, pageSize);
if (null == articlesResult) { if (null == articlesResult) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -601,7 +588,7 @@ public class ArticleProcessor { ...@@ -601,7 +588,7 @@ public class ArticleProcessor {
dataModelService.fillCommon(context, dataModel, preference); dataModelService.fillCommon(context, dataModel, preference);
dataModelService.fillFaviconURL(dataModel, preference); dataModelService.fillFaviconURL(dataModel, preference);
dataModelService.fillUsite(dataModel); dataModelService.fillUsite(dataModel);
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e); LOGGER.log(Level.ERROR, e.getMessage(), e);
...@@ -626,7 +613,6 @@ public class ArticleProcessor { ...@@ -626,7 +613,6 @@ public class ArticleProcessor {
if (null == result) { if (null == result) {
LOGGER.log(Level.DEBUG, "Can not find articles for the specified archive date[string={}]", archiveDateString); LOGGER.log(Level.DEBUG, "Can not find articles for the specified archive date[string={}]", archiveDateString);
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -642,14 +628,13 @@ public class ArticleProcessor { ...@@ -642,14 +628,13 @@ public class ArticleProcessor {
final List<JSONObject> articles = articleQueryService.getArticlesByArchiveDate(archiveDateId, currentPageNum, pageSize); final List<JSONObject> articles = articleQueryService.getArticlesByArchiveDate(archiveDateId, currentPageNum, pageSize);
if (articles.isEmpty()) { if (articles.isEmpty()) {
context.sendError(404); context.sendError(404);
return; return;
} }
dataModelService.setArticlesExProperties(context, articles, preference); dataModelService.setArticlesExProperties(context, articles, preference);
final Map<String, Object> dataModel = renderer.getDataModel(); final Map<String, Object> dataModel = renderer.getDataModel();
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
prepareShowArchiveArticles(preference, dataModel, articles, currentPageNum, pageCount, archiveDateString, archiveDate); prepareShowArchiveArticles(preference, dataModel, articles, currentPageNum, pageCount, archiveDateString, archiveDate);
final Response response = context.getResponse(); final Response response = context.getResponse();
dataModelService.fillCommon(context, dataModel, preference); dataModelService.fillCommon(context, dataModel, preference);
...@@ -671,7 +656,6 @@ public class ArticleProcessor { ...@@ -671,7 +656,6 @@ public class ArticleProcessor {
final JSONObject article = (JSONObject) context.attr(Article.ARTICLE); final JSONObject article = (JSONObject) context.attr(Article.ARTICLE);
if (null == article) { if (null == article) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -713,7 +697,7 @@ public class ArticleProcessor { ...@@ -713,7 +697,7 @@ public class ArticleProcessor {
dataModelService.fillCommon(context, dataModel, preference); dataModelService.fillCommon(context, dataModel, preference);
dataModelService.fillFaviconURL(dataModel, preference); dataModelService.fillFaviconURL(dataModel, preference);
dataModelService.fillUsite(dataModel); dataModelService.fillUsite(dataModel);
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
// Fire [Before Render Article] event // Fire [Before Render Article] event
final JSONObject eventData = new JSONObject(); final JSONObject eventData = new JSONObject();
......
...@@ -139,7 +139,6 @@ public class B3Receiver { ...@@ -139,7 +139,6 @@ public class B3Receiver {
final String msg = "Not found client"; final String msg = "Not found client";
ret.put(Keys.MSG, msg); ret.put(Keys.MSG, msg);
LOGGER.log(Level.WARN, msg); LOGGER.log(Level.WARN, msg);
return; return;
} }
...@@ -151,7 +150,6 @@ public class B3Receiver { ...@@ -151,7 +150,6 @@ public class B3Receiver {
final String msg = "Not found user [" + articleAuthorName + "]"; final String msg = "Not found user [" + articleAuthorName + "]";
ret.put(Keys.MSG, msg); ret.put(Keys.MSG, msg);
LOGGER.log(Level.WARN, msg); LOGGER.log(Level.WARN, msg);
return; return;
} }
...@@ -162,7 +160,6 @@ public class B3Receiver { ...@@ -162,7 +160,6 @@ public class B3Receiver {
final String msg = "Wrong key"; final String msg = "Wrong key";
ret.put(Keys.MSG, msg); ret.put(Keys.MSG, msg);
LOGGER.log(Level.WARN, msg); LOGGER.log(Level.WARN, msg);
return; return;
} }
...@@ -172,7 +169,6 @@ public class B3Receiver { ...@@ -172,7 +169,6 @@ public class B3Receiver {
final String msg = "Not found article"; final String msg = "Not found article";
ret.put(Keys.MSG, msg); ret.put(Keys.MSG, msg);
LOGGER.log(Level.WARN, msg); LOGGER.log(Level.WARN, msg);
return; return;
} }
...@@ -197,7 +193,6 @@ public class B3Receiver { ...@@ -197,7 +193,6 @@ public class B3Receiver {
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"); LOGGER.log(Level.INFO, "Added an article [" + title + "] via Sym");
return; return;
} }
......
...@@ -36,7 +36,6 @@ public class BeforeRequestHandler implements Handler { ...@@ -36,7 +36,6 @@ public class BeforeRequestHandler implements Handler {
context.setHeader("Retry-After", "600"); context.setHeader("Retry-After", "600");
context.sendString("Too Many Requests"); context.sendString("Too Many Requests");
context.abort(); context.abort();
return; return;
} }
......
...@@ -106,7 +106,6 @@ public class CategoryProcessor { ...@@ -106,7 +106,6 @@ public class CategoryProcessor {
final JSONObject category = categoryQueryService.getByURI(categoryURI); final JSONObject category = categoryQueryService.getByURI(categoryURI);
if (null == category) { if (null == category) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -155,7 +154,6 @@ public class CategoryProcessor { ...@@ -155,7 +154,6 @@ public class CategoryProcessor {
final JSONObject category = categoryQueryService.getByURI(categoryURI); final JSONObject category = categoryQueryService.getByURI(categoryURI);
if (null == category) { if (null == category) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -171,11 +169,10 @@ public class CategoryProcessor { ...@@ -171,11 +169,10 @@ public class CategoryProcessor {
final int pageCount = result.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_PAGE_COUNT); final int pageCount = result.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_PAGE_COUNT);
if (0 == pageCount) { if (0 == pageCount) {
context.sendError(404); context.sendError(404);
return; return;
} }
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
dataModelService.setArticlesExProperties(context, articles, preference); dataModelService.setArticlesExProperties(context, articles, preference);
final List<Integer> pageNums = (List) result.optJSONObject(Pagination.PAGINATION).opt(Pagination.PAGINATION_PAGE_NUMS); final List<Integer> pageNums = (List) result.optJSONObject(Pagination.PAGINATION).opt(Pagination.PAGINATION_PAGE_NUMS);
......
...@@ -136,7 +136,6 @@ public class CommentProcessor { ...@@ -136,7 +136,6 @@ public class CommentProcessor {
if (!Solos.isLoggedIn(context)) { if (!Solos.isLoggedIn(context)) {
jsonObject.put(Keys.STATUS_CODE, false); jsonObject.put(Keys.STATUS_CODE, false);
jsonObject.put(Keys.MSG, "Need login"); jsonObject.put(Keys.MSG, "Need login");
return; return;
} }
...@@ -152,7 +151,7 @@ public class CommentProcessor { ...@@ -152,7 +151,7 @@ public class CommentProcessor {
// 添加评论优化 https://github.com/b3log/solo/issues/12246 // 添加评论优化 https://github.com/b3log/solo/issues/12246
try { try {
final String skinDirName = (String) context.attr(Keys.TEMAPLTE_DIR_NAME); final String skinDirName = (String) context.attr(Keys.TEMPLATE_DIR_NAME);
final Template template = Skins.getSkinTemplate(context, "common-comment.ftl"); final Template template = Skins.getSkinTemplate(context, "common-comment.ftl");
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), skinDirName, dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), skinDirName, dataModel);
......
...@@ -167,7 +167,6 @@ public class FeedProcessor { ...@@ -167,7 +167,6 @@ public class FeedProcessor {
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
if (null == preference) { if (null == preference) {
context.sendError(404); context.sendError(404);
return; return;
} }
......
...@@ -72,7 +72,6 @@ public class FetchUploadProcessor { ...@@ -72,7 +72,6 @@ public class FetchUploadProcessor {
final String msg = "Gets upload token failed"; final String msg = "Gets upload token failed";
LOGGER.log(Level.ERROR, msg); LOGGER.log(Level.ERROR, msg);
result.put(Keys.MSG, msg); result.put(Keys.MSG, msg);
return; return;
} }
...@@ -93,7 +92,6 @@ public class FetchUploadProcessor { ...@@ -93,7 +92,6 @@ public class FetchUploadProcessor {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Fetch file [url=" + originalURL + "] failed", e); LOGGER.log(Level.ERROR, "Fetch file [url=" + originalURL + "] failed", e);
result.put(Keys.MSG, "Fetch file [url=" + originalURL + "] failed"); result.put(Keys.MSG, "Fetch file [url=" + originalURL + "] failed");
return; return;
} }
...@@ -124,7 +122,6 @@ public class FetchUploadProcessor { ...@@ -124,7 +122,6 @@ public class FetchUploadProcessor {
final String msg = "Upload file to community OSS [url=" + originalURL + "] failed"; final String msg = "Upload file to community OSS [url=" + originalURL + "] failed";
LOGGER.log(Level.ERROR, msg, e); LOGGER.log(Level.ERROR, msg, e);
result.put(Keys.MSG, msg); result.put(Keys.MSG, msg);
return; return;
} }
......
...@@ -96,7 +96,7 @@ public class IndexProcessor { ...@@ -96,7 +96,7 @@ public class IndexProcessor {
final int currentPageNum = Paginator.getPage(request); final int currentPageNum = Paginator.getPage(request);
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
dataModelService.fillIndexArticles(context, dataModel, currentPageNum, preference); dataModelService.fillIndexArticles(context, dataModel, currentPageNum, preference);
dataModelService.fillCommon(context, dataModel, preference); dataModelService.fillCommon(context, dataModel, preference);
...@@ -126,7 +126,6 @@ public class IndexProcessor { ...@@ -126,7 +126,6 @@ public class IndexProcessor {
public void showStart(final RequestContext context) { public void showStart(final RequestContext context) {
if (initService.isInited() && null != Solos.getCurrentUser(context)) { if (initService.isInited() && null != Solos.getCurrentUser(context)) {
context.sendRedirect(Latkes.getServePath()); context.sendRedirect(Latkes.getServePath());
return; return;
} }
......
...@@ -50,7 +50,6 @@ public class InitCheckHandler implements Handler { ...@@ -50,7 +50,6 @@ public class InitCheckHandler implements Handler {
// 禁止直接获取 robots.txt https://github.com/b3log/solo/issues/12543 // 禁止直接获取 robots.txt https://github.com/b3log/solo/issues/12543
if (requestURI.startsWith("/robots.txt") && !isSpiderBot) { if (requestURI.startsWith("/robots.txt") && !isSpiderBot) {
context.sendError(403); context.sendError(403);
return; return;
} }
...@@ -58,14 +57,12 @@ public class InitCheckHandler implements Handler { ...@@ -58,14 +57,12 @@ public class InitCheckHandler implements Handler {
final InitService initService = beanManager.getReference(InitService.class); final InitService initService = beanManager.getReference(InitService.class);
if (initService.isInited()) { if (initService.isInited()) {
context.handle(); context.handle();
return; return;
} }
if (StringUtils.startsWith(requestURI, Latkes.getContextPath() + "/login/")) { if (StringUtils.startsWith(requestURI, Latkes.getContextPath() + "/login/")) {
// Do initialization // Do initialization
context.handle(); context.handle();
return; return;
} }
......
...@@ -124,7 +124,6 @@ public class OAuthProcessor { ...@@ -124,7 +124,6 @@ public class OAuthProcessor {
final String referer = STATES.get(state); final String referer = STATES.get(state);
if (null == referer) { if (null == referer) {
context.sendError(400); context.sendError(400);
return; return;
} }
STATES.remove(state); STATES.remove(state);
...@@ -158,7 +157,6 @@ public class OAuthProcessor { ...@@ -158,7 +157,6 @@ public class OAuthProcessor {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Registers via oauth failed", e); LOGGER.log(Level.ERROR, "Registers via oauth failed", e);
context.sendError(500); context.sendError(500);
return; return;
} }
} else { } else {
...@@ -169,7 +167,6 @@ public class OAuthProcessor { ...@@ -169,7 +167,6 @@ public class OAuthProcessor {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Updates user GitHub id failed", e); LOGGER.log(Level.ERROR, "Updates user GitHub id failed", e);
context.sendError(500); context.sendError(500);
return; return;
} }
} }
...@@ -182,7 +179,6 @@ public class OAuthProcessor { ...@@ -182,7 +179,6 @@ public class OAuthProcessor {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Updates user name failed", e); LOGGER.log(Level.ERROR, "Updates user name failed", e);
context.sendError(500); context.sendError(500);
return; return;
} }
} }
...@@ -191,7 +187,6 @@ public class OAuthProcessor { ...@@ -191,7 +187,6 @@ public class OAuthProcessor {
if (null == user) { if (null == user) {
LOGGER.log(Level.WARN, "Can't get user by name [" + userName + "]"); LOGGER.log(Level.WARN, "Can't get user by name [" + userName + "]");
context.sendError(404); context.sendError(404);
return; return;
} }
......
...@@ -59,7 +59,6 @@ public class PermalinkHandler implements Handler { ...@@ -59,7 +59,6 @@ public class PermalinkHandler implements Handler {
final InitService initService = beanManager.getReference(InitService.class); final InitService initService = beanManager.getReference(InitService.class);
if (!initService.isInited()) { if (!initService.isInited()) {
context.handle(); context.handle();
return; return;
} }
...@@ -69,7 +68,6 @@ public class PermalinkHandler implements Handler { ...@@ -69,7 +68,6 @@ public class PermalinkHandler implements Handler {
if (PermalinkQueryService.invalidPermalinkFormat(permalink)) { if (PermalinkQueryService.invalidPermalinkFormat(permalink)) {
LOGGER.log(Level.DEBUG, "Skip permalink handling request [URI={}]", permalink); LOGGER.log(Level.DEBUG, "Skip permalink handling request [URI={}]", permalink);
context.handle(); context.handle();
return; return;
} }
...@@ -78,13 +76,11 @@ public class PermalinkHandler implements Handler { ...@@ -78,13 +76,11 @@ public class PermalinkHandler implements Handler {
if (null == article) { if (null == article) {
LOGGER.log(Level.DEBUG, "Not found article with permalink [{}]", permalink); LOGGER.log(Level.DEBUG, "Not found article with permalink [{}]", permalink);
context.handle(); context.handle();
return; return;
} }
} catch (final RepositoryException e) { } catch (final RepositoryException e) {
LOGGER.log(Level.ERROR, "Processes article permalink handler failed", e); LOGGER.log(Level.ERROR, "Processes article permalink handler failed", e);
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -92,11 +88,9 @@ public class PermalinkHandler implements Handler { ...@@ -92,11 +88,9 @@ public class PermalinkHandler implements Handler {
if (Solos.needViewPwd(context, article)) { if (Solos.needViewPwd(context, article)) {
try { try {
context.sendRedirect(Latkes.getServePath() + "/console/article-pwd?articleId=" + article.optString(Keys.OBJECT_ID)); context.sendRedirect(Latkes.getServePath() + "/console/article-pwd?articleId=" + article.optString(Keys.OBJECT_ID));
return; return;
} catch (final Exception e) { } catch (final Exception e) {
context.sendError(404); context.sendError(404);
return; return;
} }
} }
...@@ -106,7 +100,6 @@ public class PermalinkHandler implements Handler { ...@@ -106,7 +100,6 @@ public class PermalinkHandler implements Handler {
final boolean allowVisitDraftViaPermalink = preference.getBoolean(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK); final boolean allowVisitDraftViaPermalink = preference.getBoolean(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK);
if (Article.ARTICLE_STATUS_C_PUBLISHED != article.optInt(Article.ARTICLE_STATUS) && !allowVisitDraftViaPermalink) { if (Article.ARTICLE_STATUS_C_PUBLISHED != article.optInt(Article.ARTICLE_STATUS) && !allowVisitDraftViaPermalink) {
context.sendError(404); context.sendError(404);
return; return;
} }
......
...@@ -86,7 +86,7 @@ public class SkinHandler implements Handler { ...@@ -86,7 +86,7 @@ public class SkinHandler implements Handler {
} }
} }
} }
request.setAttribute(Keys.TEMAPLTE_DIR_NAME, skin); request.setAttribute(Keys.TEMPLATE_DIR_NAME, skin);
} }
private static void fillBotAttrs(final Request request) { private static void fillBotAttrs(final Request request) {
......
...@@ -36,7 +36,6 @@ public class StaticMidware { ...@@ -36,7 +36,6 @@ public class StaticMidware {
final String html = Statics.get(context); final String html = Statics.get(context);
if (null == html) { if (null == html) {
context.handle(); context.handle();
return; return;
} }
......
...@@ -101,7 +101,6 @@ public class TagProcessor { ...@@ -101,7 +101,6 @@ public class TagProcessor {
final JSONObject result = tagQueryService.getTagByTitle(tagTitle); final JSONObject result = tagQueryService.getTagByTitle(tagTitle);
if (null == result) { if (null == result) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -109,14 +108,13 @@ public class TagProcessor { ...@@ -109,14 +108,13 @@ public class TagProcessor {
final String tagId = tag.getString(Keys.OBJECT_ID); final String tagId = tag.getString(Keys.OBJECT_ID);
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
final int pageSize = preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT); final int pageSize = preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT);
final int windowSize = preference.getInt(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE); final int windowSize = preference.getInt(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE);
final JSONObject tagArticleResult = articleQueryService.getArticlesByTag(tagId, currentPageNum, pageSize); final JSONObject tagArticleResult = articleQueryService.getArticlesByTag(tagId, currentPageNum, pageSize);
if (null == tagArticleResult) { if (null == tagArticleResult) {
context.sendError(404); context.sendError(404);
return; return;
} }
......
...@@ -93,7 +93,6 @@ public class UserTemplateProcessor { ...@@ -93,7 +93,6 @@ public class UserTemplateProcessor {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Renders CHANGE_LOGS failed", e); LOGGER.log(Level.ERROR, "Renders CHANGE_LOGS failed", e);
} }
return; return;
} }
...@@ -107,7 +106,6 @@ public class UserTemplateProcessor { ...@@ -107,7 +106,6 @@ public class UserTemplateProcessor {
final Template template = Skins.getSkinTemplate(context, templateName); final Template template = Skins.getSkinTemplate(context, templateName);
if (null == template) { if (null == template) {
context.sendError(404); context.sendError(404);
return; return;
} }
...@@ -119,7 +117,7 @@ public class UserTemplateProcessor { ...@@ -119,7 +117,7 @@ public class UserTemplateProcessor {
dataModelService.fillFaviconURL(dataModel, preference); dataModelService.fillFaviconURL(dataModel, preference);
dataModelService.fillUsite(dataModel); dataModelService.fillUsite(dataModel);
dataModelService.fillUserTemplate(context, template, dataModel, preference); dataModelService.fillUserTemplate(context, template, dataModel, preference);
Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMAPLTE_DIR_NAME), dataModel); Skins.fillLangs(preference.optString(Option.ID_C_LOCALE_STRING), (String) context.attr(Keys.TEMPLATE_DIR_NAME), dataModel);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e); LOGGER.log(Level.ERROR, e.getMessage(), e);
......
...@@ -230,7 +230,6 @@ public class AdminConsole { ...@@ -230,7 +230,6 @@ public class AdminConsole {
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
context.sendError(401); context.sendError(401);
return; return;
} }
...@@ -243,7 +242,6 @@ public class AdminConsole { ...@@ -243,7 +242,6 @@ public class AdminConsole {
final byte[] zipData = exportService.exportSQL(); final byte[] zipData = exportService.exportSQL();
if (null == zipData) { if (null == zipData) {
context.sendError(500); context.sendError(500);
return; return;
} }
...@@ -263,7 +261,6 @@ public class AdminConsole { ...@@ -263,7 +261,6 @@ public class AdminConsole {
final Response response = context.getResponse(); final Response response = context.getResponse();
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
context.sendError(401); context.sendError(401);
return; return;
} }
...@@ -297,7 +294,6 @@ public class AdminConsole { ...@@ -297,7 +294,6 @@ public class AdminConsole {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Export failed", e); LOGGER.log(Level.ERROR, "Export failed", e);
context.renderJSON().renderMsg("Export failed, please check log"); context.renderJSON().renderMsg("Export failed, please check log");
return; return;
} }
} }
...@@ -311,7 +307,6 @@ public class AdminConsole { ...@@ -311,7 +307,6 @@ public class AdminConsole {
final Response response = context.getResponse(); final Response response = context.getResponse();
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
context.sendError(401); context.sendError(401);
return; return;
} }
...@@ -363,7 +358,6 @@ public class AdminConsole { ...@@ -363,7 +358,6 @@ public class AdminConsole {
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Export failed", e); LOGGER.log(Level.ERROR, "Export failed", e);
context.renderJSON().renderMsg("Export failed, please check log"); context.renderJSON().renderMsg("Export failed, please check log");
return; return;
} }
} }
......
...@@ -180,7 +180,6 @@ public class ArticleConsole { ...@@ -180,7 +180,6 @@ public class ArticleConsole {
renderer.setJSONObject(ret); renderer.setJSONObject(ret);
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
return; return;
} }
...@@ -298,7 +297,6 @@ public class ArticleConsole { ...@@ -298,7 +297,6 @@ public class ArticleConsole {
if (!articleQueryService.canAccessArticle(articleId, currentUser)) { if (!articleQueryService.canAccessArticle(articleId, currentUser)) {
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
return; return;
} }
...@@ -342,7 +340,6 @@ public class ArticleConsole { ...@@ -342,7 +340,6 @@ public class ArticleConsole {
if (!articleQueryService.canAccessArticle(articleId, currentUser)) { if (!articleQueryService.canAccessArticle(articleId, currentUser)) {
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
return; return;
} }
...@@ -382,7 +379,6 @@ public class ArticleConsole { ...@@ -382,7 +379,6 @@ public class ArticleConsole {
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
return; return;
} }
...@@ -423,7 +419,6 @@ public class ArticleConsole { ...@@ -423,7 +419,6 @@ public class ArticleConsole {
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
return; return;
} }
...@@ -490,7 +485,6 @@ public class ArticleConsole { ...@@ -490,7 +485,6 @@ public class ArticleConsole {
if (!articleQueryService.canAccessArticle(articleId, currentUser)) { if (!articleQueryService.canAccessArticle(articleId, currentUser)) {
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
return; return;
} }
......
...@@ -156,7 +156,6 @@ public class CategoryConsole { ...@@ -156,7 +156,6 @@ public class CategoryConsole {
final JSONObject result = categoryQueryService.getCategory(categoryId); final JSONObject result = categoryQueryService.getCategory(categoryId);
if (null == result) { if (null == result) {
renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false)); renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false));
return; return;
} }
...@@ -273,7 +272,6 @@ public class CategoryConsole { ...@@ -273,7 +272,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, addArticleWithTagFirstLabel); jsonObject.put(Keys.MSG, addArticleWithTagFirstLabel);
return; return;
} }
...@@ -292,7 +290,6 @@ public class CategoryConsole { ...@@ -292,7 +290,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryLabel")); jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryLabel"));
return; return;
} }
...@@ -301,7 +298,6 @@ public class CategoryConsole { ...@@ -301,7 +298,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("categoryURIMustBeASCIILabel")); jsonObject.put(Keys.MSG, langPropsService.get("categoryURIMustBeASCIILabel"));
return; return;
} }
...@@ -310,14 +306,12 @@ public class CategoryConsole { ...@@ -310,14 +306,12 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryURILabel")); jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryURILabel"));
return; return;
} }
if (255 <= StringUtils.length(uri)) { if (255 <= StringUtils.length(uri)) {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("categoryURITooLongLabel")); jsonObject.put(Keys.MSG, langPropsService.get("categoryURITooLongLabel"));
return; return;
} }
...@@ -409,7 +403,6 @@ public class CategoryConsole { ...@@ -409,7 +403,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, addArticleWithTagFirstLabel); jsonObject.put(Keys.MSG, addArticleWithTagFirstLabel);
return; return;
} }
...@@ -427,7 +420,6 @@ public class CategoryConsole { ...@@ -427,7 +420,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryLabel")); jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryLabel"));
return; return;
} }
...@@ -436,7 +428,6 @@ public class CategoryConsole { ...@@ -436,7 +428,6 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("categoryURIMustBeASCIILabel")); jsonObject.put(Keys.MSG, langPropsService.get("categoryURIMustBeASCIILabel"));
return; return;
} }
mayExist = categoryQueryService.getByURI(uri); mayExist = categoryQueryService.getByURI(uri);
...@@ -444,14 +435,12 @@ public class CategoryConsole { ...@@ -444,14 +435,12 @@ public class CategoryConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryURILabel")); jsonObject.put(Keys.MSG, langPropsService.get("duplicatedCategoryURILabel"));
return; return;
} }
if (255 <= StringUtils.length(uri)) { if (255 <= StringUtils.length(uri)) {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("categoryURITooLongLabel")); jsonObject.put(Keys.MSG, langPropsService.get("categoryURITooLongLabel"));
return; return;
} }
......
...@@ -88,7 +88,6 @@ public class CommentConsole { ...@@ -88,7 +88,6 @@ public class CommentConsole {
if (!commentQueryService.canAccessComment(commentId, currentUser)) { if (!commentQueryService.canAccessComment(commentId, currentUser)) {
ret.put(Keys.STATUS_CODE, false); ret.put(Keys.STATUS_CODE, false);
ret.put(Keys.MSG, langPropsService.get("forbiddenLabel")); ret.put(Keys.MSG, langPropsService.get("forbiddenLabel"));
return; return;
} }
......
...@@ -29,7 +29,6 @@ public class ConsoleAdminAuthMidware { ...@@ -29,7 +29,6 @@ public class ConsoleAdminAuthMidware {
if (!Solos.isAdminLoggedIn(context)) { if (!Solos.isAdminLoggedIn(context)) {
context.sendError(401); context.sendError(401);
context.abort(); context.abort();
return; return;
} }
......
...@@ -33,7 +33,6 @@ public class ConsoleAuthMidware { ...@@ -33,7 +33,6 @@ public class ConsoleAuthMidware {
if (null == currentUser) { if (null == currentUser) {
context.sendError(401); context.sendError(401);
context.abort(); context.abort();
return; return;
} }
......
...@@ -323,7 +323,6 @@ public class LinkConsole { ...@@ -323,7 +323,6 @@ public class LinkConsole {
final JSONObject result = linkQueryService.getLink(linkId); final JSONObject result = linkQueryService.getLink(linkId);
if (null == result) { if (null == result) {
renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false)); renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false));
return; return;
} }
......
...@@ -283,7 +283,6 @@ public class PageConsole { ...@@ -283,7 +283,6 @@ public class PageConsole {
final JSONObject result = pageQueryService.getPage(pageId); final JSONObject result = pageQueryService.getPage(pageId);
if (null == result) { if (null == result) {
renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false)); renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false));
return; return;
} }
......
...@@ -181,7 +181,6 @@ public class PreferenceConsole { ...@@ -181,7 +181,6 @@ public class PreferenceConsole {
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
if (null == preference) { if (null == preference) {
renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false)); renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false));
return; return;
} }
......
...@@ -93,7 +93,6 @@ public class SkinConsole { ...@@ -93,7 +93,6 @@ public class SkinConsole {
final JSONObject skin = optionQueryService.getSkin(); final JSONObject skin = optionQueryService.getSkin();
if (null == skin) { if (null == skin) {
renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false)); renderer.setJSONObject(new JSONObject().put(Keys.STATUS_CODE, false));
return; return;
} }
...@@ -104,7 +103,6 @@ public class SkinConsole { ...@@ -104,7 +103,6 @@ public class SkinConsole {
final String name = Latkes.getSkinName(dirName); final String name = Latkes.getSkinName(dirName);
if (null == name) { if (null == name) {
LOGGER.log(Level.WARN, "The directory [{}] does not contain any skin, ignored it", dirName); LOGGER.log(Level.WARN, "The directory [{}] does not contain any skin, ignored it", dirName);
continue; continue;
} }
......
...@@ -83,14 +83,12 @@ public class StaticSiteConsole { ...@@ -83,14 +83,12 @@ public class StaticSiteConsole {
if (!Strings.isURL(url)) { if (!Strings.isURL(url)) {
context.renderJSON(-1); context.renderJSON(-1);
context.renderMsg("Invalid site URL"); context.renderMsg("Invalid site URL");
return; return;
} }
if (Latkes.isInJar()) { if (Latkes.isInJar()) {
context.renderJSON(-1); context.renderJSON(-1);
context.renderMsg("Do not support this feature while running in Jar"); context.renderMsg("Do not support this feature while running in Jar");
return; return;
} }
......
...@@ -229,7 +229,6 @@ public class UserConsole { ...@@ -229,7 +229,6 @@ public class UserConsole {
final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false); final JSONObject jsonObject = new JSONObject().put(Keys.STATUS_CODE, false);
renderer.setJSONObject(jsonObject); renderer.setJSONObject(jsonObject);
jsonObject.put(Keys.MSG, langPropsService.get("getFailLabel")); jsonObject.put(Keys.MSG, langPropsService.get("getFailLabel"));
return; return;
} }
......
...@@ -219,7 +219,6 @@ public class ArticleMgmtService { ...@@ -219,7 +219,6 @@ public class ArticleMgmtService {
optionMgmtService.addOrUpdateOption(githubReposOpt); optionMgmtService.addOrUpdateOption(githubReposOpt);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Updates github repos option failed", e); LOGGER.log(Level.ERROR, "Updates github repos option failed", e);
return; return;
} }
......
...@@ -83,7 +83,6 @@ public class CategoryMgmtService { ...@@ -83,7 +83,6 @@ public class CategoryMgmtService {
} }
LOGGER.log(Level.WARN, "Cant not find the target category of source category [order={}]", srcCategoryOrder); LOGGER.log(Level.WARN, "Cant not find the target category of source category [order={}]", srcCategoryOrder);
return; return;
} }
......
...@@ -171,7 +171,6 @@ public class CommentQueryService { ...@@ -171,7 +171,6 @@ public class CommentQueryService {
final String commentId = comment.optString(Keys.OBJECT_ID); final String commentId = comment.optString(Keys.OBJECT_ID);
commentRepository.remove(commentId); commentRepository.remove(commentId);
transaction.commit(); transaction.commit();
continue; continue;
} }
......
...@@ -629,7 +629,7 @@ public class DataModelService { ...@@ -629,7 +629,7 @@ public class DataModelService {
dataModel.put(User.USERS, userList); dataModel.put(User.USERS, userList);
final JSONObject admin = userRepository.getAdmin(); final JSONObject admin = userRepository.getAdmin();
dataModel.put(Common.ADMIN_USER, admin); dataModel.put(Common.ADMIN_USER, admin);
final String skinDirName = (String) context.attr(Keys.TEMAPLTE_DIR_NAME); final String skinDirName = (String) context.attr(Keys.TEMPLATE_DIR_NAME);
dataModel.put(Option.ID_C_SKIN_DIR_NAME, skinDirName); dataModel.put(Option.ID_C_SKIN_DIR_NAME, skinDirName);
Keys.fillRuntime(dataModel); Keys.fillRuntime(dataModel);
fillPageNavigations(dataModel); fillPageNavigations(dataModel);
......
...@@ -456,11 +456,9 @@ public class ExportService { ...@@ -456,11 +456,9 @@ public class ExportService {
if (StringUtils.isNotBlank(article.optString(Article.ARTICLE_VIEW_PWD))) { if (StringUtils.isNotBlank(article.optString(Article.ARTICLE_VIEW_PWD))) {
passwords.add(one); passwords.add(one);
continue; continue;
} else if (Article.ARTICLE_STATUS_C_PUBLISHED == article.optInt(Article.ARTICLE_STATUS)) { } else if (Article.ARTICLE_STATUS_C_PUBLISHED == article.optInt(Article.ARTICLE_STATUS)) {
posts.add(one); posts.add(one);
continue; continue;
} else { } else {
drafts.add(one); drafts.add(one);
......
...@@ -98,7 +98,6 @@ public class UpgradeService { ...@@ -98,7 +98,6 @@ public class UpgradeService {
V380_390.perform(); V380_390.perform();
case "3.9.0": case "3.9.0":
V390_400.perform(); V390_400.perform();
break; break;
default: default:
LOGGER.log(Level.ERROR, "Please upgrade to v3.0.0 first"); LOGGER.log(Level.ERROR, "Please upgrade to v3.0.0 first");
......
...@@ -131,7 +131,6 @@ public class UserMgmtService { ...@@ -131,7 +131,6 @@ public class UserMgmtService {
usite = result.optJSONObject(Common.DATA); usite = result.optJSONObject(Common.DATA);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Gets usite failed", e); LOGGER.log(Level.ERROR, "Gets usite failed", e);
return; return;
} }
...@@ -146,7 +145,6 @@ public class UserMgmtService { ...@@ -146,7 +145,6 @@ public class UserMgmtService {
optionMgmtService.addOrUpdateOption(usiteOpt); optionMgmtService.addOrUpdateOption(usiteOpt);
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Updates usite option failed", e); LOGGER.log(Level.ERROR, "Updates usite option failed", e);
return; return;
} }
} }
......
...@@ -29,7 +29,7 @@ import java.util.concurrent.ThreadLocalRandom; ...@@ -29,7 +29,7 @@ import java.util.concurrent.ThreadLocalRandom;
* Image utilities. * Image utilities.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.0, Apr 30, 2020 * @version 1.2.0.1, May 15, 2020
* @since 2.7.0 * @since 2.7.0
*/ */
public final class Images { public final class Images {
...@@ -42,7 +42,7 @@ public final class Images { ...@@ -42,7 +42,7 @@ public final class Images {
/** /**
* Community file service URL. * Community file service URL.
*/ */
public static String COMMUNITY_FILE_URL = "https://img.hacpai.com"; public static String COMMUNITY_FILE_URL = "https://b3logfile.com";
/** /**
* Checks whether the specified URL has uploaded. * Checks whether the specified URL has uploaded.
...@@ -51,7 +51,7 @@ public final class Images { ...@@ -51,7 +51,7 @@ public final class Images {
* @return {@code true} if it has uploaded, returns {@code false} otherwise * @return {@code true} if it has uploaded, returns {@code false} otherwise
*/ */
public static boolean uploaded(final String url) { public static boolean uploaded(final String url) {
return StringUtils.startsWith(url, COMMUNITY_FILE_URL); return StringUtils.startsWith(url, COMMUNITY_FILE_URL) || StringUtils.startsWith(url, "https://img.hacpai.com");
} }
/** /**
...@@ -67,7 +67,7 @@ public final class Images { ...@@ -67,7 +67,7 @@ public final class Images {
for (final Element img : imgs) { for (final Element img : imgs) {
String imgSrc = img.attr("src"); String imgSrc = img.attr("src");
if (!StringUtils.startsWith(imgSrc, COMMUNITY_FILE_URL) || if (!uploaded(imgSrc) ||
StringUtils.contains(imgSrc, ".gif") || StringUtils.containsIgnoreCase(imgSrc, "imageView") || StringUtils.contains(imgSrc, ".gif") || StringUtils.containsIgnoreCase(imgSrc, "imageView") ||
StringUtils.containsIgnoreCase(imgSrc, "data:")) { StringUtils.containsIgnoreCase(imgSrc, "data:")) {
continue; continue;
...@@ -105,11 +105,9 @@ public final class Images { ...@@ -105,11 +105,9 @@ public final class Images {
final long max = System.currentTimeMillis(); final long max = System.currentTimeMillis();
final long delta = max - min; final long delta = max - min;
final long time = ThreadLocalRandom.current().nextLong(0, delta) + min; final long time = ThreadLocalRandom.current().nextLong(0, delta) + min;
return COMMUNITY_FILE_URL + "/bing/" + DateFormatUtils.format(time, "yyyyMMdd") + ".jpg"; return COMMUNITY_FILE_URL + "/bing/" + DateFormatUtils.format(time, "yyyyMMdd") + ".jpg";
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Generates random image URL failed", e); LOGGER.log(Level.ERROR, "Generates random image URL failed", e);
return COMMUNITY_FILE_URL + "/bing/20171104.jpg"; return COMMUNITY_FILE_URL + "/bing/20171104.jpg";
} }
} }
...@@ -122,7 +120,6 @@ public final class Images { ...@@ -122,7 +120,6 @@ public final class Images {
*/ */
public static List<String> randomImages(final int n) { public static List<String> randomImages(final int n) {
final List<String> ret = new ArrayList<>(); final List<String> ret = new ArrayList<>();
int i = 0; int i = 0;
while (i < n * 5) { while (i < n * 5) {
final String url = randImage(); final String url = randImage();
......
...@@ -249,7 +249,6 @@ public final class Markdowns { ...@@ -249,7 +249,6 @@ public final class Markdowns {
for (final Thread thread : threads) { for (final Thread thread : threads) {
if (thread.getId() == threadId[0]) { if (thread.getId() == threadId[0]) {
thread.stop(); thread.stop();
break; break;
} }
} }
......
...@@ -111,7 +111,7 @@ public final class Skins { ...@@ -111,7 +111,7 @@ public final class Skins {
* @return template, returns {@code null} if not found * @return template, returns {@code null} if not found
*/ */
public static Template getSkinTemplate(final RequestContext context, final String templateName) { public static Template getSkinTemplate(final RequestContext context, final String templateName) {
String templateDirName = (String) context.attr(Keys.TEMAPLTE_DIR_NAME); String templateDirName = (String) context.attr(Keys.TEMPLATE_DIR_NAME);
if (StringUtils.isBlank(templateDirName)) { if (StringUtils.isBlank(templateDirName)) {
templateDirName = Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME; templateDirName = Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME;
} }
......
...@@ -18,7 +18,8 @@ import org.apache.logging.log4j.Level; ...@@ -18,7 +18,8 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.b3log.latke.http.RequestContext; import org.b3log.latke.http.RequestContext;
import org.b3log.solo.model.Option; import org.b3log.latke.util.Requests;
import org.b3log.latke.util.Strings;
import org.b3log.solo.processor.SkinRenderer; import org.b3log.solo.processor.SkinRenderer;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
...@@ -38,7 +39,7 @@ import java.util.zip.GZIPOutputStream; ...@@ -38,7 +39,7 @@ import java.util.zip.GZIPOutputStream;
* Static utilities. 页面静态化 https://github.com/88250/solo/issues/107 * Static utilities. 页面静态化 https://github.com/88250/solo/issues/107
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Apr 14, 2020 * @version 1.0.0.1, May 10, 2020
* @since 4.1.0 * @since 4.1.0
*/ */
public final class Statics { public final class Statics {
...@@ -46,12 +47,12 @@ public final class Statics { ...@@ -46,12 +47,12 @@ public final class Statics {
/** /**
* Logger. * Logger.
*/ */
private static Logger LOGGER = LogManager.getLogger(Statics.class); private static final Logger LOGGER = LogManager.getLogger(Statics.class);
/** /**
* Generated page expire time. * Generated page expire time.
*/ */
private static long EXPIRED = TimeUnit.HOURS.toMillis(6); private static final long EXPIRED = TimeUnit.HOURS.toMillis(6);
private static File DIR; private static File DIR;
...@@ -81,6 +82,12 @@ public final class Statics { ...@@ -81,6 +82,12 @@ public final class Statics {
return null; return null;
} }
final String remoteAddr = Requests.getRemoteAddr(context.getRequest());
if (Strings.isIPv4(remoteAddr)) {
// 直接用 IP 访问不走缓存
return null;
}
final String key = key(context); final String key = key(context);
if (null == key) { if (null == key) {
return null; return null;
......
This diff is collapsed.
...@@ -416,6 +416,7 @@ admin.article = { ...@@ -416,6 +416,7 @@ admin.article = {
// editor // editor
admin.editors.articleEditor = new SoloEditor({ admin.editors.articleEditor = new SoloEditor({
outline: true,
id: 'articleContent', id: 'articleContent',
height: 500, height: 500,
fun: fun, fun: fun,
......
...@@ -57,6 +57,7 @@ $.extend(SoloEditor.prototype, { ...@@ -57,6 +57,7 @@ $.extend(SoloEditor.prototype, {
}) })
const options = { const options = {
outline: this.conf.outline || false,
mode: Label.editorMode, mode: Label.editorMode,
typewriterMode: this.conf.typewriterMode, typewriterMode: this.conf.typewriterMode,
cache: { cache: {
...@@ -105,6 +106,51 @@ $.extend(SoloEditor.prototype, { ...@@ -105,6 +106,51 @@ $.extend(SoloEditor.prototype, {
toolbarConfig: { toolbarConfig: {
pin: true, pin: true,
}, },
toolbar:[
"emoji",
"headings",
"bold",
"link",
"|",
"list",
"ordered-list",
"check",
"outdent",
"indent",
"|",
"quote",
"code",
"insert-before",
"insert-after",
"|",
"upload",
"record",
"table",
"|",
"undo",
"redo",
"|",
"fullscreen",
"edit-mode",
{
name: "more",
toolbar: [
"italic",
"strike",
"line",
"inline-code",
"both",
"code-theme",
"content-theme",
"export",
"outline",
"preview",
"format",
"devtools",
"info",
"help",
],
}],
after: () => { after: () => {
if (typeof this.conf.fun === 'function') { if (typeof this.conf.fun === 'function') {
this.conf.fun() this.conf.fun()
...@@ -118,8 +164,6 @@ $.extend(SoloEditor.prototype, { ...@@ -118,8 +164,6 @@ $.extend(SoloEditor.prototype, {
'link', 'link',
'upload', 'upload',
'edit-mode', 'edit-mode',
'code-theme',
'content-theme',
{ {
name: 'more', name: 'more',
toolbar: [ toolbar: [
......
...@@ -108,6 +108,7 @@ admin.themeList = { ...@@ -108,6 +108,7 @@ admin.themeList = {
cache: false, cache: false,
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
success: function (result, textStatus) { success: function (result, textStatus) {
sessionStorage.removeItem('skin')
$('#tipMsg').text(result.msg) $('#tipMsg').text(result.msg)
if (!result.sc) { if (!result.sc) {
$('#loadMsg').text('') $('#loadMsg').text('')
......
...@@ -23,7 +23,7 @@ window.Vcomment = Vcomment ...@@ -23,7 +23,7 @@ window.Vcomment = Vcomment
* *
* @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 2.2.1.0, Apr 30, 2020 * @version 2.3.1.0, May 15, 2020
*/ */
/** /**
...@@ -109,11 +109,7 @@ window.Util = { ...@@ -109,11 +109,7 @@ window.Util = {
return true return true
}, },
callback: function () { callback: function () {
try { Util.parseMarkdown()
// TODO vditor@3.1.21 移除 try cache
Util.parseMarkdown()
} catch (e) {
}
if (typeof Util.uvstat === 'undefined') { if (typeof Util.uvstat === 'undefined') {
Util.uvstat = new Uvstat() Util.uvstat = new Uvstat()
} }
...@@ -310,7 +306,7 @@ window.Util = { ...@@ -310,7 +306,7 @@ window.Util = {
loadVditor: function (cb) { loadVditor: function (cb) {
$.ajax({ $.ajax({
method: 'GET', method: 'GET',
url: 'https://cdn.jsdelivr.net/npm/vditor@3.1.20/dist/index.min.js', url: 'https://cdn.jsdelivr.net/npm/vditor@3.2.6/dist/index.min.js',
dataType: 'script', dataType: 'script',
cache: true, cache: true,
success: () => { success: () => {
...@@ -321,9 +317,35 @@ window.Util = { ...@@ -321,9 +317,35 @@ window.Util = {
}, },
}) })
}, },
skinPreview: () => {
if (location.pathname === '/admin-index.do') {
return
}
const skinParam = location.search.split('skin=')
let skin = ''
let urlHasSkin = false
if (skinParam.length === 2) {
skin = skinParam[1].split('=')[0]
urlHasSkin = true
}
if (skin) {
sessionStorage.setItem('skin', skin)
} else {
skin = sessionStorage.getItem('skin')
}
if (!skin) {
return
}
if (!urlHasSkin) {
location.search = location.search
? location.search + '&skin=' + skin
: '?skin=' + skin
}
},
}; };
(() => { (() => {
Util.skinPreview()
if (typeof Vditor === 'undefined') { if (typeof Vditor === 'undefined') {
Util.loadVditor() Util.loadVditor()
} }
......
This diff is collapsed.
...@@ -180,8 +180,6 @@ $.extend(Page.prototype, { ...@@ -180,8 +180,6 @@ $.extend(Page.prototype, {
'emoji', 'emoji',
'link', 'link',
'edit-mode', 'edit-mode',
'code-theme',
'content-theme',
{ {
name: 'more', name: 'more',
toolbar: [ toolbar: [
......
This diff is collapsed.
...@@ -23,7 +23,7 @@ html { ...@@ -23,7 +23,7 @@ html {
body { body {
margin: 0; margin: 0;
font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif ; font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif ;
font-size: 14px; font-size: 14px;
background-color: #fff; background-color: #fff;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
...@@ -123,7 +123,7 @@ textarea { ...@@ -123,7 +123,7 @@ textarea {
margin: 0; margin: 0;
font-size: 100%; font-size: 100%;
vertical-align: middle; vertical-align: middle;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
outline: none; outline: none;
} }
...@@ -172,4 +172,4 @@ svg { ...@@ -172,4 +172,4 @@ svg {
blockquote { blockquote {
margin: 0; margin: 0;
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -425,7 +425,7 @@ a { ...@@ -425,7 +425,7 @@ a {
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
outline: none; outline: none;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
} }
button { button {
......
...@@ -55,7 +55,7 @@ html { ...@@ -55,7 +55,7 @@ html {
} }
body { body {
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
font-size: 12px; font-size: 12px;
background-color: #292929; background-color: #292929;
margin: 0; margin: 0;
......
This diff is collapsed.
This diff is collapsed.
...@@ -53,7 +53,7 @@ html { ...@@ -53,7 +53,7 @@ html {
body { body {
height: 100%; height: 100%;
max-height: 100%; max-height: 100%;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
letter-spacing: 0.01rem; letter-spacing: 0.01rem;
font-size: 100%; font-size: 100%;
line-height: 1.75em; line-height: 1.75em;
...@@ -89,7 +89,7 @@ h4, h5, h6 { ...@@ -89,7 +89,7 @@ h4, h5, h6 {
-o-font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; -o-font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1;
color: #666; color: #666;
line-height: 1.15em; line-height: 1.15em;
font-family: "Open Sans", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: "Open Sans", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
text-rendering: geometricPrecision; text-rendering: geometricPrecision;
} }
...@@ -194,7 +194,7 @@ mark { ...@@ -194,7 +194,7 @@ mark {
code, tt { code, tt {
padding: 1px 3px; padding: 1px 3px;
font-family: Inconsolata, monospace, "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: Inconsolata, monospace, "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
font-size: 0.85em; font-size: 0.85em;
white-space: pre-wrap; white-space: pre-wrap;
border: #E3EDF3 1px solid; border: #E3EDF3 1px solid;
...@@ -352,7 +352,7 @@ pre code, pre tt { ...@@ -352,7 +352,7 @@ pre code, pre tt {
box-sizing: border-box; box-sizing: border-box;
font-size: 14px; font-size: 14px;
outline: none; outline: none;
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif; font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
} }
.form textarea { .form textarea {
......
...@@ -136,7 +136,7 @@ public abstract class AbstractTestCase { ...@@ -136,7 +136,7 @@ public abstract class AbstractTestCase {
cookieJSONObject.put(Keys.TOKEN, "pass:" + random); cookieJSONObject.put(Keys.TOKEN, "pass:" + random);
final String cookieValue = Crypts.encryptByAES(cookieJSONObject.toString(), Solos.COOKIE_SECRET); final String cookieValue = Crypts.encryptByAES(cookieJSONObject.toString(), Solos.COOKIE_SECRET);
request.addCookie(Solos.COOKIE_NAME, cookieValue); request.addCookie(Solos.COOKIE_NAME, cookieValue);
request.setAttribute(Keys.TEMAPLTE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME); request.setAttribute(Keys.TEMPLATE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
} }
/** /**
......
...@@ -161,7 +161,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase { ...@@ -161,7 +161,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final MockRequest request = mockRequest(); final MockRequest request = mockRequest();
request.setRequestURI("/archives/" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy/MM")); request.setRequestURI("/archives/" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy/MM"));
request.setParameter("p", "1"); request.setParameter("p", "1");
request.setAttribute(Keys.TEMAPLTE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME); request.setAttribute(Keys.TEMPLATE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
final MockResponse response = mockResponse(); final MockResponse response = mockResponse();
mockDispatcher(request, response); mockDispatcher(request, response);
...@@ -181,7 +181,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase { ...@@ -181,7 +181,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final MockRequest request = mockRequest(); final MockRequest request = mockRequest();
request.setRequestURI("/article"); request.setRequestURI("/article");
request.setAttribute(Article.ARTICLE, article); request.setAttribute(Article.ARTICLE, article);
request.setAttribute(Keys.TEMAPLTE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME); request.setAttribute(Keys.TEMPLATE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
final MockResponse response = mockResponse(); final MockResponse response = mockResponse();
mockDispatcher(request, response); mockDispatcher(request, response);
...@@ -202,7 +202,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase { ...@@ -202,7 +202,7 @@ public class ArticleProcessorTestCase extends AbstractTestCase {
final MockRequest request = mockRequest(); final MockRequest request = mockRequest();
request.setRequestURI("/console/article-pwd"); request.setRequestURI("/console/article-pwd");
request.setParameter("articleId", articleId); request.setParameter("articleId", articleId);
request.setAttribute(Keys.TEMAPLTE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME); request.setAttribute(Keys.TEMPLATE_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
final MockResponse response = mockResponse(); final MockResponse response = mockResponse();
mockDispatcher(request, response); mockDispatcher(request, response);
......
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