url-helper.js 500 Bytes
/**
 * Created by TaoHuang on 2017/2/21.
 */

'use strict';

const helpers = global.yoho.helpers;

module.exports.editorUrl = function(channel, authorId) {
    return helpers.urlFormat(`/guang/author-${channel}-${authorId}/`, null);
};

module.exports.listUrl = function(channel, type) {
    return helpers.urlFormat(`/guang/${channel}-t${type}/`, null);
};

module.exports.tagsUrl = function(query, page) {
    return encodeURI(page ? `/guang/tags/${query}-p${page}/` : `/guang/tags/${query}/`);
};