This commit is contained in:
satori 2021-12-14 19:39:24 +08:00
parent 3cdd790fe7
commit db2edebeaf
2 changed files with 22 additions and 0 deletions

21
collection.js Normal file
View File

@ -0,0 +1,21 @@
import https from 'https'
export default function (url) {
if (!this.item.link) return false;
var reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/;
if (!reg.test(url)) url = "https://" + url;
https.get(url, resp => {
let data = ''
resp.on('data', chunk => data += chunk)
resp.on('end', () => {
console.log(JSON.parse(data).explanation)
})
}).on('error', err => {
console.log(err.message)
})
//this.$axios.get(this.item.link).then((res) => {
// console.log(res.data);
//});
}

View File

@ -7,6 +7,7 @@ import random from 'string-random'
import formidable from 'formidable'
import md5 from 'md5-node'
import HUB from './fmhub.js'
import site from './collection.js'
const app = expressWs(express()).app
const databases = new Map() // 所有数据库