扑飞漫画
This commit is contained in:
@@ -1,47 +1,75 @@
|
||||
|
||||
let findlist = async (ctx,next)=>{
|
||||
let findlist = async (ctx, next) => {
|
||||
// for(let i in reptilelist){
|
||||
// let a = await reptilelist[i].find(ctx.query.name)
|
||||
// // list.push({name:reptilelist[i].name,list: [...a]})
|
||||
// for(let j in a){
|
||||
// let has = true
|
||||
// for(let k in list){
|
||||
// if(list[k].name == a[j].name){
|
||||
// if(list[k].list == undefined){
|
||||
// list[k].list = []
|
||||
// }
|
||||
// has = false
|
||||
// list[k].list.push({name:reptilelist[i].name,url:a[j].url,date:a[j].date,update:a[j].update})
|
||||
// }
|
||||
|
||||
// }
|
||||
// if(has){
|
||||
// list.push({name:a[j].name,list:[{name:reptilelist[i].name,url:a[j].url,date:a[j].date,update:a[j].update}]})
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
let pro = []
|
||||
let list = []
|
||||
for(let i in reptilelist){
|
||||
let a = await reptilelist[i].find(ctx.query.name)
|
||||
// list.push({name:reptilelist[i].name,list: [...a]})
|
||||
for(let j in a){
|
||||
let has = true
|
||||
for(let k in list){
|
||||
if(list[k].name == a[j].name){
|
||||
if(list[k].list == undefined){
|
||||
list[k].list = []
|
||||
}
|
||||
has = false
|
||||
list[k].list.push({name:reptilelist[i].name,url:a[j].url,date:a[j].date,update:a[j].update})
|
||||
}
|
||||
|
||||
}
|
||||
if(has){
|
||||
list.push({name:a[j].name,list:[{name:reptilelist[i].name,url:a[j].url,date:a[j].date,update:a[j].update}]})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (let i in reptilelist) {
|
||||
pro.push(reptilelist[i].find(ctx.query.name))
|
||||
}
|
||||
|
||||
await Promise.all(pro).then((res) => {
|
||||
// console.log(res)
|
||||
for (let i in res) {
|
||||
for (let j in res[i].list) {
|
||||
let has = true
|
||||
for (let k in list) {
|
||||
if (list[k].name == res[i].list[j].name) {
|
||||
if (list[k].list == undefined) {
|
||||
list[k].list = []
|
||||
}
|
||||
has = false
|
||||
list[k].list.push({ name: res[i].name, url: res[i].list[j].url, date: res[i].list[j].date, update: res[i].list[j].update })
|
||||
}
|
||||
|
||||
}
|
||||
if (has) {
|
||||
list.push({ name: res[i].list[j].name, list: [{ name: res[i].name, url: res[i].list[j].url, date: res[i].list[j].date, update: res[i].list[j].update }] })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
ctx.body = JSON.stringify(list)
|
||||
}
|
||||
let section = async(ctx,next)=>{
|
||||
for(let i in reptilelist){
|
||||
if(ctx.query.name == reptilelist[i].name){
|
||||
ctx.body = await reptilelist[i].section(ctx.query.url)
|
||||
let section = async (ctx, next) => {
|
||||
for (let i in reptilelist) {
|
||||
if (ctx.query.name == reptilelist[i].name) {
|
||||
ctx.body = await reptilelist[i].section(ctx.query.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
let picture = async(ctx,next)=>{
|
||||
for(let i in reptilelist){
|
||||
if(ctx.query.name == reptilelist[i].name){
|
||||
let picture = async (ctx, next) => {
|
||||
for (let i in reptilelist) {
|
||||
if (ctx.query.name == reptilelist[i].name) {
|
||||
// console.log(await reptilelist[i].imglist(ctx.query.url))
|
||||
ctx.body = await reptilelist[i].imglist(ctx.query.url)
|
||||
ctx.body = await reptilelist[i].imglist(ctx.query.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
'GET /find':findlist,
|
||||
'GET /section':section,
|
||||
'GET /picture':picture
|
||||
'GET /find': findlist,
|
||||
'GET /section': section,
|
||||
'GET /picture': picture
|
||||
}
|
||||
Reference in New Issue
Block a user