更新 'SrcJyAliDisk.js'

main
src48597962 2 years ago
parent eae05db745
commit 859871befe
  1. 44
      SrcJyAliDisk.js

@ -347,26 +347,25 @@ function aliMyDisk(folder_id,nofilter) {
}else{
d.push({
title: "⚡登录云盘⚡",
url: $("hiker://empty##").rule(() => {
url: $("hiker://empty###noRecordHistory##noHistory#").rule(() => {
let d = [];
let url = 'https://auth.aliyundrive.com/v2/oauth/authorize?login_type=custom&response_type=code&redirect_uri=https%3A%2F%2Fwww.aliyundrive.com%2Fsign%2Fcallback&client_id=25dzX3vbYqktVxyX&state=%7B%22origin%22%3A%22*%22%7D#/login'
let js = $.toString(() => {
const tokenFunction = function () {
var token = JSON.parse(localStorage.getItem('token'))
if (token && token.user_id) {
let token_url = 'hiker://files/rules/Joe/ali.json';
fy_bridge_app.writeFile(token_url, JSON.stringify(token));
let icy = "hiker://files/rules/icy/icy-ali-token.json";
let a = fy_bridge_app.fetch(icy);
if (!a || a == "") {
let b = [];
b.push(token);
fy_bridge_app.writeFile(icy, JSON.stringify(b));
let alistfile = "hiker://files/rules/Src/Juying/Alist.json";
if(fy_bridge_app.fetch(alistfile)){
eval("var alistData = " + fy_bridge_app.fetch(alistfile));
}else{
var alistData = {};
}
let alistconfig = alistData.config || {};
alistconfig.alitoken = token.refresh_token;
alistData.config = alistconfig;
fy_bridge_app.writeFile(alistfile, JSON.stringify(alistData));
localStorage.clear();
//alert('TOKEN获取成功!');
fba.parseLazyRule(`hiker://empty@lazyRule=.js:putMyVar('getalitoken','0');back();`);
//fy_bridge_app.back();
alert('TOKEN获取成功,返回后刷新页面!');
return;
} else {
token_timer();
@ -375,7 +374,6 @@ function aliMyDisk(folder_id,nofilter) {
var token_timer = function () {
setTimeout(tokenFunction, 500)
};
token_timer();
tokenFunction();
})
d.push({
@ -391,8 +389,26 @@ function aliMyDisk(folder_id,nofilter) {
}),
col_type: 'text_center_1'
})
d.push({
title: "⭐手工填写token⭐",
url: $().lazyRule(() => {
let alistfile = "hiker://files/rules/Src/Juying/Alist.json";
if(fetch(alistfile)){
eval("var alistData = " + fetch(alistfile));
}else{
var alistData = {};
}
let alistconfig = alistData.config || {};
return $("", "refresh_token").input((alistfile, alistData, alistconfig) => {
alistconfig.alitoken = input;
alistData.config = alistconfig;
writeFile(alistfile, JSON.stringify(alistData));
return "toast://已设置";
}, alistfile, alistData, alistconfig)
}),
col_type: 'text_center_1'
})
}
setResult(d);
setLastChapterRule('js:' + $.toString(()=>{
setResult('');

Loading…
Cancel
Save