Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
方斌
51business
Commits
0c4d4450
Commit
0c4d4450
authored
Feb 27, 2020
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addd
parent
7a5dedbb
Pipeline
#19655
passed with stage
in 2 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
loan_caculator.js
app/controller/cd/loan_caculator.js
+2
-2
news.js
app/controller/cd/news.js
+24
-0
cd.js
app/router/cd.js
+5
-1
No files found.
app/controller/cd/loan_caculator.js
View file @
0c4d4450
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
const
Controller
=
require
(
'egg'
).
Controller
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
L
ike
Controller
extends
Controller
{
class
L
oanCaculator
Controller
extends
Controller
{
/**
/**
* 贷款计算器
* 贷款计算器
*/
*/
...
@@ -68,4 +68,4 @@ class LikeController extends Controller {
...
@@ -68,4 +68,4 @@ class LikeController extends Controller {
}
}
module
.
exports
=
L
ike
Controller
;
module
.
exports
=
L
oanCaculator
Controller
;
app/controller/cd/news.js
0 → 100644
View file @
0c4d4450
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
NewsController
extends
Controller
{
/**
* 获取资讯内容
*/
async
getNews
()
{
const
{
ctx
}
=
this
;
let
inputParams
=
ctx
.
params
;
let
rule
=
{
id
:
{
type
:
'string'
,
required
:
true
},
};
ctx
.
validate
(
rule
,
inputParams
);
let
ret
=
await
ctx
.
service
.
cd
.
news
.
getNews
(
Number
(
inputParams
.
id
));
ctx
.
success
(
ret
);
}
}
module
.
exports
=
NewsController
;
app/router/cd.js
View file @
0c4d4450
...
@@ -5,6 +5,9 @@ module.exports = app => {
...
@@ -5,6 +5,9 @@ module.exports = app => {
const
loginAuth
=
app
.
middleware
.
loginAuth
({
type
:
'new'
});
//登录中间件
const
loginAuth
=
app
.
middleware
.
loginAuth
({
type
:
'new'
});
//登录中间件
router
.
post
(
'/caculator'
,
'cd.loanCaculator.caculator'
);
//贷款计算器
router
.
post
(
'third'
,
'/caculator'
,
'cd.loanCaculator.caculator'
);
//贷款计算器
router
.
get
(
'third'
,
'/news/:id'
,
'cd.news.getNews'
);
//资讯详细内容
};
};
\ 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