You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Juying/test.js

16 lines
870 B

2 years ago
function(input) {
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAliPublic.js');
2 years ago
log('aaa');
2 years ago
headers.authorization = "Bearer " + userinfo.access_token;
let drive_id = userinfo.default_drive_id;
2 years ago
let postdata = {"drive_id":drive_id,"limit":100,"query":"name match \""+input+"\" and type = \"folder\"","image_thumbnail_process":"image/resize,w_200/format,jpeg","image_url_process":"image/resize,w_1920/format,jpeg","video_thumbnail_process":"video/snapshot,t_1000,f_jpg,ar_auto,w_300","order_by":"updated_at DESC"}
2 years ago
let list = JSON.parse(request('https://api.aliyundrive.com/adrive/v3/file/search', { headers: headers, body: postdata, method: 'POST', timeout: 3000 })).items;
2 years ago
let data = list.map(item => {
return {
title: item.name,
2 years ago
url: item.file_id
2 years ago
}
})
2 years ago
log(data);
2 years ago
return data;
2 years ago
}