更新 'SrcJyPublic.js'

master
src48597962 4 months ago
parent 1ffabadacb
commit 119ed6ebf9
  1. 34
      SrcJyPublic.js

@ -1118,6 +1118,25 @@ function subResource() {
return "hiker://empty";
}, Juconfig, it.path, cfgfile)
}else if(input=="下载"){
return updateResource(it);
}
}, it),
col_type: "text_1"
});
})
setResult(d);
}
// 更新同步订阅资源
function updateResource(it) {
if(!it){
let resources = Juconfig['subResource'] || [];
resources.forEach(item=>{
if(item.auto){
it = item;
break;
}
})
}
try{
let pasteget = JSON.parse(request('https://pasteme.tyrantg.com/api/getContent/'+it.path+'@juying',{
"content-type": "application/json;charset=UTF-8"
@ -1155,22 +1174,17 @@ function subResource() {
Juconfig['subResource'] = resources;
writeFile(cfgfile, JSON.stringify(Juconfig));
hideLoading();
return "toast://同步完成,接口:"+jknum+",解析:"+jxnum+(sm?sm:"")+",云盘:"+ypnum;
log("更新同步订阅资源完成;接口:"+jknum+",解析:"+jxnum+(sm?sm:"")+",云盘:"+ypnum);
return "toast://更新同步订阅资源完成";
}else{
hideLoading();
return "toast://网络错误或资源码已失效";
return "toast://订阅资源网络错误或资源码已失效";
}
}catch(e){
log('下载更新失败:'+e.message);
return 'toast://更新失败,请重新再试';
log('更新同步订阅资源失败:'+e.message);
return 'toast://更新同步订阅资源失败';
}
}
}, it),
col_type: "text_1"
});
})
setResult(d);
}
// 全局对象变量gmParams
let gmParams = {
libspath: libspath,

Loading…
Cancel
Save