DataFront/server/api/tools/qqazk/search.ts

24 lines
465 B
TypeScript
Raw Normal View History

2023-08-27 10:15:04 +00:00
import {readFile} from "fs";
import path from "path";
interface Word{
bsm:string
hz:string
pyJs:string[]
}
interface Ret{
data:any
message:string
haveMess:boolean
}
let words:Word[]
readFile("./word.json",'utf-8',(err, data)=>{
if (err)console.error(err)
words=JSON.parse(data)
})
export default defineEventHandler((event):Ret=>{
return {
data:words[0].pyJs.toString(),
message:"",
haveMess:false
}
})