增加了elasticsearch全局搜索和文章内搜索

This commit is contained in:
暮光:城中城
2019-07-11 23:36:30 +08:00
parent 9a50db6b5d
commit a081443c91
21 changed files with 1132 additions and 131 deletions

View File

@@ -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',

View File

@@ -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;
}
}