Commit d100b168 authored by 智勇's avatar 智勇

shell

parent 80e44fe3
...@@ -16,7 +16,7 @@ const login = async function (ctx) { ...@@ -16,7 +16,7 @@ const login = async function (ctx) {
if (body.auth) { if (body.auth) {
let query = queryString.unescape(body.auth) let query = queryString.unescape(body.auth)
query = new Buffer(query, 'base64').toString() query = Buffer.from(query, 'base64').toString()
query = query.replace(" ", "+") query = query.replace(" ", "+")
body = queryString.parse(query) body = queryString.parse(query)
} }
...@@ -77,5 +77,4 @@ router ...@@ -77,5 +77,4 @@ router
.post('/login', bodyParser(), login) .post('/login', bodyParser(), login)
.get('/get_station', get_station) .get('/get_station', get_station)
module.exports = router module.exports = router
...@@ -32,7 +32,7 @@ app ...@@ -32,7 +32,7 @@ app
.use(cors({ .use(cors({
maxAge: 86400, // options请求缓存24小时 maxAge: 86400, // options请求缓存24小时
origin: function (req) { origin: function (req) {
return req.headers.host return req.header.origin
} }
})) }))
.use(log4js.koaLogger(log4js.getLogger("http"), { level: 'auto', format: logFormat })) .use(log4js.koaLogger(log4js.getLogger("http"), { level: 'auto', format: logFormat }))
......
#!/bin/sh
source /etc/profile
pm2 start ./bin/server.js --node-args="--harmony" -n qa-api
\ No newline at end of file
#!/bin/sh
source /etc/profile
pm2 stop qa-api
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment