Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-api
Commits
d100b168
Commit
d100b168
authored
Oct 22, 2018
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell
parent
80e44fe3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
user.js
app/controller/user.js
+1
-2
server.js
bin/server.js
+1
-1
start.sh
start.sh
+5
-0
stop.sh
stop.sh
+5
-0
No files found.
app/controller/user.js
View file @
d100b168
...
@@ -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
bin/server.js
View file @
d100b168
...
@@ -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
.
header
s
.
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
}))
...
...
start.sh
0 → 100644
View file @
d100b168
#!/bin/sh
source
/etc/profile
pm2 start ./bin/server.js
--node-args
=
"--harmony"
-n
qa-api
\ No newline at end of file
stop.sh
0 → 100644
View file @
d100b168
#!/bin/sh
source
/etc/profile
pm2 stop qa-api
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment