提交 16618cb6 编写于 作者: H hjdhnx

本地js自动变更搜索模式为1

上级 87a5059a
无法预览此类型文件
......@@ -226,7 +226,7 @@ def config_render(mode):
alists = getAlist()
alists_str = json.dumps(alists, ensure_ascii=False)
live_url = get_live_url(new_conf,mode)
rules = getRules('js')
rules = getRules('js',js_mode)
rules = get_multi_rules(rules)
# html = render_template('config.txt',rules=getRules('js'),host=host,mode=mode,jxs=jxs,base64Encode=base64Encode,config=new_conf)
html = render_template('config.txt',pys=pys,rules=rules,host=host,mode=mode,js_mode=js_mode,jxs=jxs,alists=alists,alists_str=alists_str,live_url=live_url,config=new_conf)
......@@ -255,7 +255,7 @@ def config_gen():
pys = getPys() if use_py else False
alists = getAlist()
alists_str = json.dumps(alists,ensure_ascii=False)
rules = getRules('js')
rules = getRules('js',js_mode)
rules = get_multi_rules(rules)
host0 = getHost(0)
jxs = getJxs(host=host0)
......
......@@ -29,8 +29,9 @@ def getCacheCount():
file_name = list(filter(lambda x: str(x).endswith('.js') and str(x).find('模板') < 0, file_name))
return len(file_name)
def getRules(path='cache'):
def getRules(path='cache',js_mode=0):
t1 = time()
base_path = path+'/' # 当前文件所在目录
# print(base_path)
os.makedirs(base_path,exist_ok=True)
......@@ -70,9 +71,10 @@ def getRules(path='cache'):
# print(rule_codes[0].quickSearch)
new_rule_list = []
for i in range(len(rule_list)):
sable = rule_codes[i].searchable or 0
tmpObj = {
'name':rule_list[i],
'searchable':rule_codes[i].searchable or 0,
'searchable':1 if (js_mode==1 and sable==2) else sable,
'quickSearch':rule_codes[i].quickSearch or 0,
'filterable':rule_codes[i].filterable or 0,
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册