bate
This commit is contained in:
parent
3cdd790fe7
commit
db2edebeaf
21
collection.js
Normal file
21
collection.js
Normal 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);
|
||||||
|
//});
|
||||||
|
}
|
1
index.js
1
index.js
@ -7,6 +7,7 @@ import random from 'string-random'
|
|||||||
import formidable from 'formidable'
|
import formidable from 'formidable'
|
||||||
import md5 from 'md5-node'
|
import md5 from 'md5-node'
|
||||||
import HUB from './fmhub.js'
|
import HUB from './fmhub.js'
|
||||||
|
import site from './collection.js'
|
||||||
|
|
||||||
const app = expressWs(express()).app
|
const app = expressWs(express()).app
|
||||||
const databases = new Map() // 所有数据库
|
const databases = new Map() // 所有数据库
|
||||||
|
Loading…
Reference in New Issue
Block a user