格式化代码

This commit is contained in:
binaryify
2017-08-17 12:11:38 +08:00
parent 64f781ee1f
commit f62b5e7c04
63 changed files with 418 additions and 457 deletions
+8 -7
View File
@@ -1,17 +1,18 @@
const express = require("express")
const express = require('express')
const router = express()
const { createRequest } = require("../util/util")
const { createRequest } = require('../util/util')
router.get("/", (req, res) => {
router.get('/', (req, res) => {
const keywords = req.query.keywords
const type = req.query.type || 1
const limit = req.query.limit || 30
const offset = req.query.offset || 0
// 搜索单曲(1),歌手(100),专辑(10),歌单(1000),用户(1002) *(type)*
const data = 's=' + keywords + '&limit=' + limit + '&type=' + type + '&offset=' + offset
// 搜索单曲(1),歌手(100),专辑(10),歌单(1000),用户(1002) *(type)*
const data =
's=' + keywords + '&limit=' + limit + '&type=' + type + '&offset=' + offset
createRequest('/api/search/pc/', 'POST', data)
.then(result => {
res.setHeader("Content-Type", "application/json")
res.setHeader('Content-Type', 'application/json')
res.send(result)
})
.catch(err => {
@@ -19,4 +20,4 @@ router.get("/", (req, res) => {
})
})
module.exports = router
module.exports = router