Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-arena-api
Commits
a3653fae
Commit
a3653fae
authored
Jan 17, 2018
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
2bbd2acd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
app.js
app.js
+7
-2
routes/api.js
routes/api.js
+6
-3
No files found.
app.js
View file @
a3653fae
...
@@ -31,8 +31,13 @@ app.all('*', function (req, res, next) {
...
@@ -31,8 +31,13 @@ app.all('*', function (req, res, next) {
// uncomment after placing your favicon in /public
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app
.
use
(
logger
(
'
dev
'
));
app
.
use
(
logger
(
'
dev
'
));
app
.
use
(
bodyParser
.
json
());
// app.use(bodyParser.json());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
// app.use(bodyParser.urlencoded({ extended: false }));
app
.
use
(
bodyParser
.
json
({
limit
:
"
50mb
"
}));
app
.
use
(
bodyParser
.
urlencoded
({
limit
:
"
50mb
"
,
extended
:
true
,
parameterLimit
:
50000
}));
app
.
use
(
cookieParser
());
app
.
use
(
cookieParser
());
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
public
'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
public
'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
upload
'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'
upload
'
)));
...
...
routes/api.js
View file @
a3653fae
...
@@ -1368,6 +1368,8 @@ router.post('/deckinfo', function (req, res) {
...
@@ -1368,6 +1368,8 @@ router.post('/deckinfo', function (req, res) {
}
}
var
contentStr
=
JSON
.
stringify
(
content
);
var
contentStr
=
JSON
.
stringify
(
content
);
contentStr
=
contentStr
.
replace
(
/'/g
,
"
''
"
)
if
(
!
name
)
{
if
(
!
name
)
{
return
res
.
status
(
404
).
send
(
'
deck name is required!
'
)
return
res
.
status
(
404
).
send
(
'
deck name is required!
'
)
...
@@ -1411,6 +1413,7 @@ router.post('/deckinfo', function (req, res) {
...
@@ -1411,6 +1413,7 @@ router.post('/deckinfo', function (req, res) {
done
();
done
();
var
response
=
{};
var
response
=
{};
console
.
log
(
err
)
if
(
err
)
{
if
(
err
)
{
response
.
code
=
500
;
response
.
code
=
500
;
}
else
{
}
else
{
...
@@ -1853,12 +1856,12 @@ router.post('/adClick', function (req, res) {
...
@@ -1853,12 +1856,12 @@ router.post('/adClick', function (req, res) {
let
id
=
req
.
body
.
id
;
let
id
=
req
.
body
.
id
;
var
response
=
{};
var
response
=
{};
if
(
!
id
)
{
if
(
!
id
)
{
response
.
code
=
500
;
response
.
code
=
500
;
res
.
json
(
response
);
res
.
json
(
response
);
return
return
}
}
var
sql
=
`update ads set
var
sql
=
`update ads set
clk = clk + 1
clk = clk + 1
where id = '
${
id
}
'`
;
where id = '
${
id
}
'`
;
...
@@ -1892,7 +1895,7 @@ router.post('/adImpl', function (req, res) {
...
@@ -1892,7 +1895,7 @@ router.post('/adImpl', function (req, res) {
let
id
=
req
.
body
.
id
;
let
id
=
req
.
body
.
id
;
var
response
=
{};
var
response
=
{};
if
(
!
id
)
{
if
(
!
id
)
{
response
.
code
=
500
;
response
.
code
=
500
;
res
.
json
(
response
);
res
.
json
(
response
);
return
return
...
...
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