Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
陆宇天
/
tracking-backend
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d6aaff5f
authored
Jul 15, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加public
1 parent
55510144
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
app/controller/home.js
app/controller/track.js
app/model/track.js
app/controller/home.js
View file @
d6aaff5
'use strict'
;
"use strict"
;
const
Controller
=
require
(
'egg'
).
Controller
;
const
Controller
=
require
(
"egg"
).
Controller
;
const
path
=
require
(
"path"
);
const
fs
=
require
(
"fs"
);
class
HomeController
extends
Controller
{
class
HomeController
extends
Controller
{
async
index
()
{
async
index
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
ctx
.
body
=
'hi, egg'
;
// ctx.body = 'hi, egg';
ctx
.
response
.
type
=
"html"
;
ctx
.
body
=
fs
.
readFileSync
(
path
.
resolve
(
__dirname
,
"../public/index.html"
));
}
}
}
}
...
...
app/controller/track.js
View file @
d6aaff5
...
@@ -70,7 +70,7 @@ class TrackController extends Controller {
...
@@ -70,7 +70,7 @@ class TrackController extends Controller {
// page_url: 'string?',
// page_url: 'string?',
};
};
try
{
try
{
ctx
.
validate
(
createRule
,
ctx
.
request
.
body
);
//
ctx.validate(createRule, ctx.request.body);
const
result
=
await
ctx
.
service
.
trackService
.
create
(
ctx
.
request
.
body
);
const
result
=
await
ctx
.
service
.
trackService
.
create
(
ctx
.
request
.
body
);
ctx
.
body
=
result
;
ctx
.
body
=
result
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
app/model/track.js
View file @
d6aaff5
...
@@ -28,7 +28,7 @@ module.exports = (app) => {
...
@@ -28,7 +28,7 @@ module.exports = (app) => {
isMerchantStaffAdmin
:
BOOLEAN
,
isMerchantStaffAdmin
:
BOOLEAN
,
token
:
STRING
(
100
),
token
:
STRING
(
100
),
event
:
STRING
(
20
),
event
:
STRING
(
20
),
pageUrl
:
STRING
(
1
00
),
pageUrl
:
STRING
(
3
00
),
pageName
:
STRING
(
100
),
pageName
:
STRING
(
100
),
intoTime
:
STRING
(
100
),
intoTime
:
STRING
(
100
),
leaveTime
:
STRING
(
100
),
leaveTime
:
STRING
(
100
),
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment