Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjj_api
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
data_server
gjj_api
Commits
4b706095
Commit
4b706095
authored
Apr 29, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
help
parent
752b08d3
Pipeline
#6711
passed with stage
in 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
script.js
app/controller/script.js
+32
-0
router.js
app/router.js
+2
-2
No files found.
app/controller/script.js
View file @
4b706095
...
...
@@ -4,6 +4,14 @@ const Controller = require('egg').Controller;
class
ScriptController
extends
Controller
{
constructor
(
ctx
)
{
super
(
ctx
);
this
.
helpRule
=
{
id
:
'string'
,
format
:
/^
\d
+$/
,
};
}
// 获取城市配置
async
fetchCityConfig
()
{
const
{
ctx
,
service
}
=
this
;
...
...
@@ -16,6 +24,30 @@ class ScriptController extends Controller {
ctx
.
error
(
err
);
}
}
async
helpInfo
()
{
const
{
ctx
,
service
}
=
this
;
ctx
.
validate
(
this
.
helpRule
,
ctx
.
query
);
try
{
const
id
=
ctx
.
query
.
id
;
const
helpList
=
await
service
.
scripts
.
fetchHelp
(
id
);
if
(
helpList
.
length
>
1
)
{
ctx
.
body
=
{
code
:
0
,
data
:
helpList
[
0
].
help_list
,
};
}
else
{
ctx
.
body
=
{
code
:
101
,
msg
:
'未查询到此地区帮助信息'
,
};
return
;
}
}
catch
(
err
)
{
ctx
.
logger
.
error
(
'helpInfo'
,
err
);
ctx
.
error
(
err
);
}
}
}
module
.
exports
=
ScriptController
;
app/router.js
View file @
4b706095
...
...
@@ -10,13 +10,13 @@ module.exports = app => {
gjjRouter
.
post
(
'/getToken'
,
controller
.
token
.
partnerCreate
);
// 合作方创建token
gjjRouter
.
post
(
'/get
o
rderSn'
,
controller
.
order
.
fetchOrderId
);
// 合作方获取订单号
gjjRouter
.
post
(
'/get
O
rderSn'
,
controller
.
order
.
fetchOrderId
);
// 合作方获取订单号
gjjRouter
.
get
(
'/getCity'
,
controller
.
script
.
fetchCityConfig
);
// 获取公积金城市基础配置项
gjjRouter
.
post
(
'/callback'
,
controller
.
task
.
handleCallback
);
// 处理回调结果,不对外
gjjRouter
.
get
(
'/helpInfo'
,
controller
.
task
.
fetchCapture
);
// 获取帮助信息
gjjRouter
.
get
(
'/helpInfo'
,
controller
.
script
.
helpInfo
);
// 获取帮助信息
gjjRouter
.
post
(
'/getCode'
,
controller
.
task
.
fetchCapture
);
// 获取验证码
...
...
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