|
|
@ -824,7 +824,7 @@ function shareResource() { |
|
|
|
url: resources.length>=3?"toast://分享资源码不能超过3个":$().lazyRule(() => { |
|
|
|
url: resources.length>=3?"toast://分享资源码不能超过3个":$().lazyRule(() => { |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let pastecreate = JSON.parse(request('https://pasteme.tyrantg.com/api/create', { |
|
|
|
let pastecreate = JSON.parse(request('https://pasteme.tyrantg.com/api/create', { |
|
|
|
body: 'content=juying&password=juying', |
|
|
|
body: 'content=juying&auto_password=1', |
|
|
|
method: 'POST' |
|
|
|
method: 'POST' |
|
|
|
})); |
|
|
|
})); |
|
|
|
if(pastecreate.result_code=="SUCCESS"){ |
|
|
|
if(pastecreate.result_code=="SUCCESS"){ |
|
|
@ -847,7 +847,7 @@ function shareResource() { |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return "toast://不能为空"; |
|
|
|
return "toast://不能为空"; |
|
|
|
} |
|
|
|
} |
|
|
|
}, data.path, data.auth_code) |
|
|
|
}, data.path+'@'+data.password, data.auth_code) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return 'toast://申请失败:'+pastecreate.message; |
|
|
|
return 'toast://申请失败:'+pastecreate.message; |
|
|
|
} |
|
|
|
} |
|
|
@ -860,7 +860,7 @@ function shareResource() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
resources.forEach(it=>{ |
|
|
|
resources.forEach(it=>{ |
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
|
title: it.name + "-" + it.path, |
|
|
|
title: it.name + "-" + it.path.split('@')[0], |
|
|
|
desc: "上传同步时间:" + (it.time||"") + "\n上次同步项目:" + (it.options||""), |
|
|
|
desc: "上传同步时间:" + (it.time||"") + "\n上次同步项目:" + (it.options||""), |
|
|
|
url: $(["复制","删除","改名","上传"], 2, "选择操作功能项").select((it)=>{ |
|
|
|
url: $(["复制","删除","改名","上传"], 2, "选择操作功能项").select((it)=>{ |
|
|
|
let Juconfig = storage0.getMyVar('Juconfig'); |
|
|
|
let Juconfig = storage0.getMyVar('Juconfig'); |
|
|
@ -872,14 +872,15 @@ function shareResource() { |
|
|
|
}else if(input=="删除"){ |
|
|
|
}else if(input=="删除"){ |
|
|
|
return $("确定要删除云端分享:"+it.name+"\n删除后无法找回").confirm((Juconfig,it,cfgfile)=>{ |
|
|
|
return $("确定要删除云端分享:"+it.name+"\n删除后无法找回").confirm((Juconfig,it,cfgfile)=>{ |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
|
|
|
|
it.path = it.path + (it.path.includes('@')?'':'@juying'); |
|
|
|
showLoading("执行中,请稍后"); |
|
|
|
showLoading("执行中,请稍后"); |
|
|
|
let pastecreate = JSON.parse(request('https://pasteme.tyrantg.com/api/update', { |
|
|
|
let pastecreate = JSON.parse(request('https://pasteme.tyrantg.com/api/update', { |
|
|
|
body: 'content=juying&path='+it.path+'@juying'+'&auth_code='+it.token, |
|
|
|
body: 'content=juying&path='+it.path+'&auth_code='+it.token, |
|
|
|
method: 'POST' |
|
|
|
method: 'POST' |
|
|
|
})); |
|
|
|
})); |
|
|
|
if(pastecreate.result_code=="SUCCESS"){ |
|
|
|
if(pastecreate.result_code=="SUCCESS"){ |
|
|
|
let resources = Juconfig['shareResource'] || []; |
|
|
|
let resources = Juconfig['shareResource'] || []; |
|
|
|
const index = resources.findIndex(item => item.path === it.path); |
|
|
|
const index = resources.findIndex(item => item.path.split('@')[0] === it.path.split('@')[0]); |
|
|
|
if (index !== -1) { |
|
|
|
if (index !== -1) { |
|
|
|
resources.splice(index, 1); |
|
|
|
resources.splice(index, 1); |
|
|
|
} |
|
|
|
} |
|
|
@ -975,7 +976,7 @@ function shareResource() { |
|
|
|
let textcontent = globalMap0.getVar('Jy_gmParams').zip(JSON.stringify(text)); |
|
|
|
let textcontent = globalMap0.getVar('Jy_gmParams').zip(JSON.stringify(text)); |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let pasteupdate = JSON.parse(request('https://pasteme.tyrantg.com/api/update', { |
|
|
|
let pasteupdate = JSON.parse(request('https://pasteme.tyrantg.com/api/update', { |
|
|
|
body: 'content='+textcontent+'&path='+it.path+'@juying'+'&auth_code='+it.token, |
|
|
|
body: 'content='+textcontent+'&path='+it.path+'&auth_code='+it.token, |
|
|
|
method: 'POST' |
|
|
|
method: 'POST' |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
@ -1030,8 +1031,8 @@ function subResource() { |
|
|
|
return "toast://输入不正确"; |
|
|
|
return "toast://输入不正确"; |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let codeid = aesDecode('Juying2', input.split('¥')[1]); |
|
|
|
let path = aesDecode('Juying2', input.split('¥')[1]); |
|
|
|
let pasteget = JSON.parse(request('https://pasteme.tyrantg.com/api/getContent/'+codeid+'@juying')); |
|
|
|
let pasteget = JSON.parse(request('https://pasteme.tyrantg.com/api/getContent/'+path)); |
|
|
|
if(pasteget.result_code=="SUCCESS"){ |
|
|
|
if(pasteget.result_code=="SUCCESS"){ |
|
|
|
let data = pasteget.data; |
|
|
|
let data = pasteget.data; |
|
|
|
if(data=="juying"){ |
|
|
|
if(data=="juying"){ |
|
|
@ -1054,7 +1055,7 @@ function subResource() { |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return "toast://不能为空"; |
|
|
|
return "toast://不能为空"; |
|
|
|
} |
|
|
|
} |
|
|
|
}, codeid) |
|
|
|
}, path) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return 'toast://获取失败:'+pasteget.message; |
|
|
|
return 'toast://获取失败:'+pasteget.message; |
|
|
|
} |
|
|
|
} |
|
|
@ -1068,7 +1069,7 @@ function subResource() { |
|
|
|
|
|
|
|
|
|
|
|
resources.forEach(it=>{ |
|
|
|
resources.forEach(it=>{ |
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
|
title: it.name + "-" + it.path, |
|
|
|
title: it.name + "-" + it.path.split('@')[0], |
|
|
|
desc: "最后同步时间:" + (it.time||"") + "\n是否自动同步:" + (it.auto?"是":"否") + " 下载导入模式:" + (it.mode==2?"全量":"增量"), |
|
|
|
desc: "最后同步时间:" + (it.time||"") + "\n是否自动同步:" + (it.auto?"是":"否") + " 下载导入模式:" + (it.mode==2?"全量":"增量"), |
|
|
|
url: $(["复制","删除","改名","下载","自动",it.mode=="2"?"增量":"全量"], 2, "选择操作功能项").select((it)=>{ |
|
|
|
url: $(["复制","删除","改名","下载","自动",it.mode=="2"?"增量":"全量"], 2, "选择操作功能项").select((it)=>{ |
|
|
|
let Juconfig = storage0.getMyVar('Juconfig'); |
|
|
|
let Juconfig = storage0.getMyVar('Juconfig'); |
|
|
@ -1157,7 +1158,7 @@ function updateResource(it) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let pasteget = JSON.parse(request('https://pasteme.tyrantg.com/api/getContent/'+it.path+'@juying',{ |
|
|
|
let pasteget = JSON.parse(request('https://pasteme.tyrantg.com/api/getContent/'+it.path,{ |
|
|
|
"content-type": "application/json;charset=UTF-8" |
|
|
|
"content-type": "application/json;charset=UTF-8" |
|
|
|
})); |
|
|
|
})); |
|
|
|
if(pasteget.result_code=="SUCCESS"){ |
|
|
|
if(pasteget.result_code=="SUCCESS"){ |
|
|
|