增加了elasticsearch全局搜索和文章内搜索
This commit is contained in:
@@ -9,6 +9,7 @@ var URL = {
|
||||
pageDetail: '/zyplayer-doc-wiki/page/detail',
|
||||
pageDelete: '/zyplayer-doc-wiki/page/delete',
|
||||
pageNews: '/zyplayer-doc-wiki/page/news',
|
||||
pageSearchByEs: '/zyplayer-doc-wiki/page/searchByEs',
|
||||
pageLock: '/zyplayer-doc-wiki/page/lock',
|
||||
pageUnlock: '/zyplayer-doc-wiki/page/unlock',
|
||||
spaceList: '/zyplayer-doc-wiki/space/list',
|
||||
|
||||
@@ -106,5 +106,25 @@ export default {
|
||||
isNotEmpty(str) {
|
||||
return !isEmpty(str);
|
||||
},
|
||||
/**
|
||||
* param 将要转为URL参数字符串的对象
|
||||
* key URL参数字符串的前缀
|
||||
* encode true/false 是否进行URL编码,默认为true
|
||||
* return URL参数字符串
|
||||
*/
|
||||
objUrlEncode(param, key, encode) {
|
||||
if (param == null) return '';
|
||||
var paramStr = '';
|
||||
var t = typeof (param);
|
||||
if (t == 'string' || t == 'number' || t == 'boolean') {
|
||||
paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param);
|
||||
} else {
|
||||
for (var i in param) {
|
||||
var k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '.' + i);
|
||||
paramStr += urlEncode(param[i], k, encode);
|
||||
}
|
||||
}
|
||||
return paramStr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user