mirror of
https://github.com/cnodejs/nodeclub.git
synced 2026-02-01 16:34:28 +00:00
hotfix 发帖版块选择
This commit is contained in:
parent
0f74e584bb
commit
b3ca077e5a
@ -102,6 +102,10 @@ exports.create = function (req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
var allTags = config.tabs.map(function (tPair) {
|
||||
return tPair[0];
|
||||
});
|
||||
|
||||
exports.put = function (req, res, next) {
|
||||
var title = sanitize(req.body.title).trim();
|
||||
title = sanitize(title).xss();
|
||||
@ -114,7 +118,7 @@ exports.put = function (req, res, next) {
|
||||
editError = '标题不能是空的。';
|
||||
} else if (title.length < 5 && title.length > 100) {
|
||||
editError = '标题字数太多或太少。';
|
||||
} else if (!tab) {
|
||||
} else if (!tab || allTags.indexOf(tab) === -1) {
|
||||
editError = '必须选择一个版块。';
|
||||
}
|
||||
// END 验证
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<fieldset>
|
||||
<span class="tab-selector">选择版块:</span>
|
||||
<select name="tab" id="tab-value">
|
||||
<option>请选择</option>
|
||||
<option value="">请选择</option>
|
||||
<%
|
||||
var tabValue = '';
|
||||
if (typeof(tab) !== 'undefined') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user