|
|
|
@ -1945,30 +1945,13 @@ function resource() { |
|
|
|
|
if(newfiles.length==0){ |
|
|
|
|
return "toast://没有新增js" |
|
|
|
|
}else{ |
|
|
|
|
let addlist = newfiles.map(extfile=>{ |
|
|
|
|
let name = extfile.substr(extfile.lastIndexOf('/')+1).split(".")[0]; |
|
|
|
|
let arr = { "name": name, "type": "hipy_t3", "ext": extfile}; |
|
|
|
|
if(arr.name.includes('[搜]')){ |
|
|
|
|
arr['onlysearch'] = 1; |
|
|
|
|
} |
|
|
|
|
let filepath = cachepath + 'libs_jk/' + arr.type; |
|
|
|
|
let urlfile = filepath + '_' + extfile.substr(extfile.lastIndexOf('/')+1); |
|
|
|
|
arr['url'] = urlfile; |
|
|
|
|
writeFile(urlfile, fetch(extfile)); |
|
|
|
|
return arr; |
|
|
|
|
}) |
|
|
|
|
let sharetxt = gzip.zip(JSON.stringify(addlist)); |
|
|
|
|
let code = '聚影接口¥' + aesEncode('Juying2', sharetxt) + '¥新增接口'; |
|
|
|
|
writeFile("hiker://files/_cache/juying2/cloudimport.txt", code); |
|
|
|
|
return $('hiker://empty#noRecordHistory##noHistory#').rule(() => { |
|
|
|
|
return $('hiker://empty#noRecordHistory##noHistory#').rule((newfiles) => { |
|
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJySet.js'); |
|
|
|
|
importConfirm(); |
|
|
|
|
}) |
|
|
|
|
importConfirm(newfiles); |
|
|
|
|
},newfiles) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function exeImport(input){ |
|
|
|
|
let importtype = getMyVar('importtype','1'); |
|
|
|
|
if(importtype=="1"){ |
|
|
|
@ -2684,17 +2667,18 @@ function yundisksave(datas, mode){ |
|
|
|
|
return num; |
|
|
|
|
} |
|
|
|
|
// 云口令导入确认页
|
|
|
|
|
function importConfirm(input) { |
|
|
|
|
function importConfirm(jsfile) { |
|
|
|
|
let code,name,lx,sm,datalist; |
|
|
|
|
let importfile = "hiker://files/_cache/juying2/cloudimport.txt"; |
|
|
|
|
addListener("onClose", $.toString((importfile) => { |
|
|
|
|
deleteFile(importfile); |
|
|
|
|
clearMyVar('importConfirm'); |
|
|
|
|
},importfile)); |
|
|
|
|
let code,name,lx,sm,datalist; |
|
|
|
|
|
|
|
|
|
input = input || fetch(importfile); |
|
|
|
|
if(!jsfile){ |
|
|
|
|
//云口令导入
|
|
|
|
|
let input = fetch(importfile); |
|
|
|
|
input = input.replace('云口令:','').trim(); |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
code = aesDecode('Juying2', input.split('¥')[1]); |
|
|
|
|
name = input.split('¥')[0]; |
|
|
|
@ -2735,6 +2719,23 @@ function importConfirm(input) { |
|
|
|
|
toast("聚影:无法识别的口令>"+e.message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//js文件导入
|
|
|
|
|
datalist = storage0.getMyVar('importConfirm') || jsfile.map(extfile=>{ |
|
|
|
|
let name = extfile.substr(extfile.lastIndexOf('/')+1).split(".")[0]; |
|
|
|
|
let arr = { "name": name, "type": "hipy_t3", "ext": extfile}; |
|
|
|
|
if(arr.name.includes('[搜]')){ |
|
|
|
|
arr['onlysearch'] = 1; |
|
|
|
|
} |
|
|
|
|
let filepath = cachepath + 'libs_jk/' + arr.type; |
|
|
|
|
let urlfile = filepath + '_' + extfile.substr(extfile.lastIndexOf('/')+1); |
|
|
|
|
arr['url'] = urlfile; |
|
|
|
|
writeFile(urlfile, fetch(extfile)); |
|
|
|
|
return arr; |
|
|
|
|
}) |
|
|
|
|
sm = "接口"; |
|
|
|
|
lx = "jk"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取现有接口
|
|
|
|
|
let datas = []; |
|
|
|
@ -2742,7 +2743,7 @@ function importConfirm(input) { |
|
|
|
|
let sourcedata = fetch(sourcefile); |
|
|
|
|
if(sourcedata != ""){ |
|
|
|
|
try{ |
|
|
|
|
eval("datas=" + sourcedata+ ";"); |
|
|
|
|
eval("datas = " + sourcedata+ ";"); |
|
|
|
|
}catch(e){} |
|
|
|
|
} |
|
|
|
|
let ndatalist = []; |
|
|
|
|