更新 'SrcJySet.js'

master
src48597962 2 years ago
parent 28a420e217
commit bc44198153
  1. 14
      SrcJySet.js

@ -3036,20 +3036,21 @@ function yundiskjiekou() {
col_type: 'input', col_type: 'input',
desc: "建议非懂勿动", desc: "建议非懂勿动",
extra: { extra: {
defaultValue: storage0.getMyVar('yundiskapi')?storage0.getMyVar('yundiskapi'):"", defaultValue: getMyVar('yundiskapi')?JSON.stringify(JSON.parse(getMyVar('yundiskapi')), null, "\t"):"",
titleVisible: false, titleVisible: false,
type: "textarea", type: "textarea",
highlight: true, highlight: true,
height: 12, height: 12,
onChange: 'storage0.putMyVar("yundiskapi",input)' onChange: '/{|}/.test(input)?putMyVar("yundiskapi",JSON.stringify(JSON.parse(input))):""'
} }
}); });
d.push({ d.push({
title:'保存', title:'保存',
col_type:'text_center_1', col_type:'text_center_1',
url:$("确定保存新接口").confirm((filepath)=>{ url:$("确定保存新接口").confirm((filepath)=>{
let newapi = storage0.getMyVar("yundiskapi"); if(getMyVar('yundiskapi')){
if(newapi){ try{
let newapi = JSON.parse(getMyVar('yundiskapi'));
let datafile = fetch(filepath); let datafile = fetch(filepath);
if(datafile != ""){ if(datafile != ""){
try{ try{
@ -3064,6 +3065,9 @@ function yundiskjiekou() {
writeFile(filepath, JSON.stringify(datalist)); writeFile(filepath, JSON.stringify(datalist));
back(true); back(true);
return "toast://已保存"; return "toast://已保存";
}catch(e){
return "toast://接口数据异常,请确认对象格式";
}
}else{ }else{
return "toast://为空不能保存"; return "toast://为空不能保存";
} }
@ -3134,12 +3138,12 @@ function yundiskjiekou() {
}); });
datalist.forEach(item => { datalist.forEach(item => {
log(item);
d.push({ d.push({
title: item.name, title: item.name,
url: $(["复制地址", "分享接口"], 1).select(() => { url: $(["复制地址", "分享接口"], 1).select(() => {
}), }),
desc: '',
col_type: "text_1" col_type: "text_1"
}); });
}) })

Loading…
Cancel
Save