|
@@ -23,6 +23,7 @@ import io.jpress.core.addon.HookInvoker;
|
|
|
import io.jpress.core.cache.ActionCache;
|
|
import io.jpress.core.cache.ActionCache;
|
|
|
import io.jpress.model.query.OptionQuery;
|
|
import io.jpress.model.query.OptionQuery;
|
|
|
import io.jpress.router.RouterMapping;
|
|
import io.jpress.router.RouterMapping;
|
|
|
|
|
+import io.jpress.ui.freemarker.tag.ApiDataTag;
|
|
|
import io.jpress.ui.freemarker.tag.IndexPageTag;
|
|
import io.jpress.ui.freemarker.tag.IndexPageTag;
|
|
|
import io.jpress.utils.StringUtils;
|
|
import io.jpress.utils.StringUtils;
|
|
|
|
|
|
|
@@ -50,6 +51,7 @@ public class IndexController extends BaseFrontController {
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(para)) {
|
|
if (StringUtils.isBlank(para)) {
|
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), null, 1, null));
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), null, 1, null));
|
|
|
|
|
+ setAttr(ApiDataTag.TAG_NAME, new ApiDataTag(getRequest()));
|
|
|
render("index.html");
|
|
render("index.html");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -58,9 +60,11 @@ public class IndexController extends BaseFrontController {
|
|
|
if (paras.length == 1) {
|
|
if (paras.length == 1) {
|
|
|
if (StringUtils.isNumeric(para.trim())) {
|
|
if (StringUtils.isNumeric(para.trim())) {
|
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), null, StringUtils.toInt(para.trim(), 1), null));
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), null, StringUtils.toInt(para.trim(), 1), null));
|
|
|
|
|
+ setAttr(ApiDataTag.TAG_NAME, new ApiDataTag(getRequest()));
|
|
|
render("index.html");
|
|
render("index.html");
|
|
|
} else {
|
|
} else {
|
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), para.trim(), 1, null));
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), para.trim(), 1, null));
|
|
|
|
|
+ setAttr(ApiDataTag.TAG_NAME, new ApiDataTag(getRequest()));
|
|
|
render("page_" + para + ".html");
|
|
render("page_" + para + ".html");
|
|
|
}
|
|
}
|
|
|
} else if (paras.length == 2) {
|
|
} else if (paras.length == 2) {
|
|
@@ -72,6 +76,7 @@ public class IndexController extends BaseFrontController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), pageName, StringUtils.toInt(pageNumber, 1), null));
|
|
setAttr(IndexPageTag.TAG_NAME, new IndexPageTag(getRequest(), pageName, StringUtils.toInt(pageNumber, 1), null));
|
|
|
|
|
+ setAttr(ApiDataTag.TAG_NAME, new ApiDataTag(getRequest()));
|
|
|
render("page_" + pageName + ".html");
|
|
render("page_" + pageName + ".html");
|
|
|
} else {
|
|
} else {
|
|
|
renderError(404);
|
|
renderError(404);
|