Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
cfe3f473
Commit
cfe3f473
authored
Apr 22, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
7546c18d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
7 deletions
+37
-7
center-manage/app/base/controller/ctl.base.js
+23
-5
center-manage/app/base/controller/impl/auth/userCtl.js
+5
-0
center-manage/app/base/service/impl/auth/userSve.js
+7
-0
center-manage/app/base/service/sve.base.js
+2
-2
No files found.
center-manage/app/base/controller/ctl.base.js
View file @
cfe3f473
...
@@ -11,17 +11,35 @@ class CtlBase {
...
@@ -11,17 +11,35 @@ class CtlBase {
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Ctl"
)).
toLowerCase
()
+
"Sve"
;
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Ctl"
)).
toLowerCase
()
+
"Sve"
;
}
}
async
update
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
update
(
pobj
);
return
system
.
getResult
(
up
);
}
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
//设置查询条件
console
.
log
(
pobj
)
const
apps
=
await
this
.
service
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
apps
);
}
async
refQuery
(
pobj
,
qobj
,
req
)
{
return
this
.
dao
.
refQuery
(
pobj
);
}
async
setContextParams
(
pobj
,
qobj
,
req
)
{
async
setContextParams
(
pobj
,
qobj
,
req
)
{
req
.
xctx
=
{
let
custtags
=
req
.
headers
[
"x-consumetag"
]?
req
.
headers
[
"x-consumetag"
].
split
(
"|"
):
null
;
appkey
:
req
.
headers
[
"x-appkey"
],
req
.
xctx
=
{
}
appkey
:
req
.
headers
[
"x-appkey"
],
companyid
:
custtags
?
custtags
[
0
].
split
(
"_"
)[
1
]:
null
,
password
:
custtags
?
custtags
[
1
].
split
(
"_"
)[
1
]:
null
,
username
:
req
.
headers
[
"x-consumer-username"
],
credid
:
req
.
headers
[
"x-credential-identifier"
]
}
}
}
async
doexec
(
methodname
,
pobj
,
query
,
req
)
{
async
doexec
(
methodname
,
pobj
,
query
,
req
)
{
try
{
try
{
await
this
.
setContextParams
(
pobj
,
query
,
req
);
await
this
.
setContextParams
(
pobj
,
query
,
req
);
//从请求头里面取appkey_consumename
//从请求头里面取appkey_consumename
// var consumeName=req.headers[""]
// var consumeName=req.headers[""]
// var appkey=
// var appkey=
// if( this.session["appkey_consumename"]) {
// if( this.session["appkey_consumename"]) {
// }else{
// }else{
...
...
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
cfe3f473
...
@@ -39,6 +39,11 @@ class UserCtl extends CtlBase {
...
@@ -39,6 +39,11 @@ class UserCtl extends CtlBase {
let
rtn
=
await
this
.
service
.
pmlogin
(
pobj
,
qobj
,
req
);
let
rtn
=
await
this
.
service
.
pmlogin
(
pobj
,
qobj
,
req
);
return
system
.
getResult
(
rtn
);
return
system
.
getResult
(
rtn
);
}
}
async
getUserInfo
(
pobj
,
qobj
,
req
){
let
uname
=
req
.
xctx
.
username
;
let
rtn
=
await
this
.
service
.
getUserInfo
(
uname
);
return
system
.
getResult
(
rtn
);
}
async
pmloginByVCode
(
pobj
,
qobj
,
req
){
async
pmloginByVCode
(
pobj
,
qobj
,
req
){
let
rtn
=
this
.
service
.
pmloginByVCode
(
pobj
,
qobj
);
let
rtn
=
this
.
service
.
pmloginByVCode
(
pobj
,
qobj
);
return
system
.
getResult
(
rtn
);
return
system
.
getResult
(
rtn
);
...
...
center-manage/app/base/service/impl/auth/userSve.js
View file @
cfe3f473
...
@@ -103,6 +103,13 @@ class UserService extends ServiceBase {
...
@@ -103,6 +103,13 @@ class UserService extends ServiceBase {
}
}
})
})
}
}
async
getUserInfo
(
uname
){
let
userfind
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
userName
:
uname
,
app_id
:
settings
.
pmappid
},
include
:
[{
model
:
this
.
db
.
models
.
company
,
raw
:
true
,
attributes
:
[
"companykey"
]
}]
});
return
userfind
;
}
//平台注册与登录
//平台注册与登录
//用户验证码登录
//用户验证码登录
//
//
...
...
center-manage/app/base/service/sve.base.js
View file @
cfe3f473
...
@@ -35,8 +35,8 @@ class ServiceBase {
...
@@ -35,8 +35,8 @@ class ServiceBase {
const
apps
=
await
this
.
dao
.
findAndCountAll
(
obj
);
const
apps
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
apps
;
return
apps
;
}
}
async
refQuery
(
q
obj
)
{
async
refQuery
(
p
obj
)
{
return
this
.
dao
.
refQuery
(
q
obj
);
return
this
.
dao
.
refQuery
(
p
obj
);
}
}
async
bulkDelete
(
ids
)
{
async
bulkDelete
(
ids
)
{
var
en
=
await
this
.
dao
.
bulkDelete
(
ids
);
var
en
=
await
this
.
dao
.
bulkDelete
(
ids
);
...
...
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