diff --git a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl index c1bf8605..573d4dc7 100644 --- a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl @@ -286,7 +286,7 @@ // 文章标题 contentTitle: '', // 所属栏目 - categoryId: '', + categoryId: undefined, // 文章类型 contentType: [], // 是否显示 @@ -675,8 +675,9 @@ this.type = ms.util.getParameter("type"); //在指定栏目下新增或编辑文章时 - if (ms.util.getParameter("categoryId")) { - this.form.categoryId = ms.util.getParameter("categoryId"); + var categoryId = ms.util.getParameter("categoryId"); + if (categoryId) { + this.form.categoryId = categoryId; //如果是封面栏目直接跳转 if (this.type) { this.getFromFengMian(this.form.categoryId); diff --git a/src/main/webapp/WEB-INF/manager/cms/content/main.ftl b/src/main/webapp/WEB-INF/manager/cms/content/main.ftl index 88ad2771..53551b9b 100644 --- a/src/main/webapp/WEB-INF/manager/cms/content/main.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/content/main.ftl @@ -11,7 +11,7 @@ <@shiro.hasPermission name="cms:content:save"> - 新增 + 新增 <@shiro.hasPermission name="cms:content:del"> 删除 @@ -370,6 +370,9 @@ save: function (id) { if (id) { location.href = this.manager + "/cms/content/form.do?id=" + id; + } else if (id == 0){ + //在全部栏目下新增文章 + location.href = this.manager + "/cms/content/form.do"; } else { location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId; }