Authored by 陈峰

逛作者页面soridid参数增加默认值

... ... @@ -9,6 +9,7 @@ const mRoot = '../models';
const indexModel = require(`${mRoot}/index`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
const guangProcess = require(`${global.utils}/guang-process`);
const stringProcess = require(`${global.utils}/string-process`);
const Promise = require('bluebird');
const channels = {
boys: 1,
... ... @@ -78,7 +79,7 @@ const _page = (req, res, next) => {
/* 判断参数是否有效 */
let tag = req.query.tag,
sortId = req.query.type,
sortId = req.query.type || 0,
page = req.query.page,
gender = req.query.gender,
authorId = req.query.authorId,
... ... @@ -89,7 +90,7 @@ const _page = (req, res, next) => {
let uid = req.user.uid,
udid = req.sessionID;
if (sortId && !isNaN(sortId)) {
if (!stringProcess.isNumeric(sortId)) {
res.json({ code: 400, message: '参数错误', data: '' });
return;
}
... ...