Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
5504a7b8
Commit
5504a7b8
authored
Jun 01, 2021
by
zhangtong5@yidian-inc.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:文件更改
parent
d55ed89c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
107 deletions
+83
-107
life-no.js
server/controllers/life-no.js
+12
-32
role.js
server/controllers/role.js
+52
-0
system.js
server/controllers/system.js
+7
-61
router.js
server/router.js
+9
-7
index.vue
src/pages/Life-no/index.vue
+3
-7
No files found.
server/controllers/life-no.js
View file @
5504a7b8
const
{
API_INTERNAL_URI
}
=
require
(
'../config.js'
)
const
LOGIN_URI
=
require
(
'../config.js'
).
LOGIN_URI
const
req
=
require
(
'../utils/request'
).
httpReq
const
API_INTERNAL_URI
=
require
(
'../config.js'
).
API_INTERNAL_URI
var
query
=
{
const
req
=
require
(
'../utils/request'
).
httpReqexports
.
get_life_list
=
async
(
ctx
,
next
)
=>
{
async
getRole_list
(
ctx
,
next
)
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/lifeinner/life_list`
;
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/role_list`
;
var
opts
=
{
const
opts
=
{
url
:
url
,
url
,
method
:
'GET'
,
method
:
'GET'
,
json
:
true
,
}
timeout
:
8000
,
ctx
.
body
=
await
req
(
ctx
,
opts
)
body
:
ctx
.
request
.
body
},
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
query
=
async
(
ctx
,
next
)
=>
{
var
type
=
ctx
.
params
.
type
console
.
log
(
812391823912839
)
// query[type](ctx, next)
// var type = ctx.params.type
// if (query[type]) {
// try {
// ctx.set('Content-Type', 'application/json; charset=utf-8')
// await query[type](ctx, next)
// } catch (e) {
// console.error('/home/q error', e, ctx.url, ctx.headers['cookie'])
// ctx.body = { status: 'failed', reason: 'Internal Server Error' }
// }
// } else {
// ctx.body = {
// status: 'failed',
// reason: 'Invalid type param',
// }
// }
}
}
\ No newline at end of file
server/controllers/role.js
0 → 100644
View file @
5504a7b8
const
LOGIN_URI
=
require
(
'../config.js'
).
LOGIN_URI
const
API_INTERNAL_URI
=
require
(
'../config.js'
).
API_INTERNAL_URI
const
req
=
require
(
'../utils/request'
).
httpReq
exports
.
getAll_role_list
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/get_role_list`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
json
:
true
,
timeout
:
8000
,
body
:
ctx
.
request
.
body
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getRole_list
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/role_list`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
,
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
get_role_info
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/get_role_info`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
json
:
true
,
timeout
:
8000
,
body
:
ctx
.
request
.
body
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getUpdate_role
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/update_role`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getUser_detail
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/lifeinner/life_info`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
\ No newline at end of file
server/controllers/system.js
View file @
5504a7b8
...
@@ -14,73 +14,19 @@ exports.login = async (ctx, next) => {
...
@@ -14,73 +14,19 @@ exports.login = async (ctx, next) => {
}
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
}
exports
.
getAll_role_list
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/get_role_list`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
json
:
true
,
timeout
:
8000
,
body
:
ctx
.
request
.
body
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getRole_list
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/role_list`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
,
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getAdd_role
=
async
(
ctx
,
next
)
=>
{
exports
.
getAdd_role
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/add_role`
;
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/add_role`
;
var
opts
=
{
var
opts
=
{
url
:
url
,
url
:
url
,
method
:
'POST'
,
method
:
'POST'
,
json
:
true
,
json
:
true
,
timeout
:
8000
,
headers
:
{
}
'content-type'
:
'application/json'
ctx
.
body
=
await
req
(
ctx
,
opts
)
},
}
exports
.
get_role_info
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/get_role_info`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
json
:
true
,
timeout
:
8000
,
body
:
ctx
.
request
.
body
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getUpdate_role
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/authority/update_role`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
get_life_list
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/lifeinner/life_list`
;
var
opts
=
{
url
:
url
,
method
:
'GET'
,
json
:
true
,
timeout
:
8000
,
body
:
ctx
.
request
.
body
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
exports
.
getUser_detail
=
async
(
ctx
,
next
)
=>
{
var
url
=
`
${
API_INTERNAL_URI
}
/merchant/lifeinner/life_info`
;
var
opts
=
{
url
:
url
,
method
:
'POST'
,
timeout
:
8000
}
}
ctx
.
body
=
await
req
(
ctx
,
opts
)
ctx
.
body
=
await
req
(
ctx
,
opts
)
}
}
server/router.js
View file @
5504a7b8
const
Router
=
require
(
'koa-router'
);
const
Router
=
require
(
'koa-router'
);
const
system
=
require
(
'./controllers/system'
)
const
system
=
require
(
'./controllers/system'
)
const
role
=
require
(
'./controllers/role'
)
const
life
=
require
(
'./controllers/life-no'
)
const
user
=
require
(
'./controllers/user'
)
const
user
=
require
(
'./controllers/user'
)
const
router
=
Router
();
const
router
=
Router
();
const
API_VERSION
=
"/api/v1"
;
const
API_VERSION
=
"/api/v1"
;
router
.
post
(
`
${
API_VERSION
}
/login`
,
system
.
login
);
router
.
post
(
`
${
API_VERSION
}
/login`
,
system
.
login
);
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/role_list`
,
system
.
getRole_list
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/role_list`
,
role
.
getRole_list
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/add_role`
,
system
.
getAdd_role
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/add_role`
,
role
.
getAdd_role
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/update_role`
,
system
.
getUpdate_role
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/update_role`
,
role
.
getUpdate_role
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/get_role_list`
,
system
.
getAll_role_list
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/get_role_list`
,
role
.
getAll_role_list
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/get_role_info`
,
system
.
get_role_info
)
router
.
post
(
`
${
API_VERSION
}
/merchant/authority/get_role_info`
,
role
.
get_role_info
)
router
.
post
(
`
${
API_VERSION
}
/merchant/lifeinner/life_info`
,
system
.
getUser_detail
)
router
.
post
(
`
${
API_VERSION
}
/merchant/lifeinner/life_info`
,
role
.
getUser_detail
)
router
.
get
(
`
${
API_VERSION
}
/merchant/lifeinner/life_list`
,
system
.
get_life_list
)
router
.
get
(
`
${
API_VERSION
}
/merchant/lifeinner/life_list`
,
life
.
get_life_list
)
module
.
exports
=
router
;
module
.
exports
=
router
;
src/pages/Life-no/index.vue
View file @
5504a7b8
...
@@ -12,12 +12,8 @@
...
@@ -12,12 +12,8 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"类型"
>
<el-form-item
label=
"类型"
>
<el-select
v-model=
"life_account.type"
placeholder=
"类型"
>
<el-select
v-model=
"life_account.type"
placeholder=
"类型"
>
<el-option
<el-option
value=
"个人"
label=
"个人"
></el-option>
v-for=
"item in LifeNoList"
<el-option
value=
"企业"
label=
"企业"
></el-option>
:key=
"item.value"
:label=
"item.life_account_type == 1 ? '个人' : '企业'"
:value=
"item.life_account_type"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -82,7 +78,7 @@ export default {
...
@@ -82,7 +78,7 @@ export default {
page
,
page
,
page_size
,
page_size
,
life_account_name
:
name
,
life_account_name
:
name
,
life_account_type
:
type
life_account_type
:
type
==
"个人"
?
1
:
2
}
}
reqGetLifeNoList
(
params
).
then
(
res
=>
{
reqGetLifeNoList
(
params
).
then
(
res
=>
{
this
.
totalNum
=
res
.
count
this
.
totalNum
=
res
.
count
...
...
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