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
522fb0f2
Commit
522fb0f2
authored
Aug 03, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gsb-center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into gsb-center-manage
parents
275d42b5
af871764
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
29 deletions
+28
-29
center-manage/app/base/controller/impl/auth/userCtl.js
+28
-29
No files found.
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
522fb0f2
...
...
@@ -7,35 +7,35 @@ class UserCtl extends CtlBase {
constructor
()
{
super
(
"auth"
,
CtlBase
.
getServiceName
(
UserCtl
));
}
async
logout
(
pobj
,
qobj
,
req
)
{
let
rtn
=
await
this
.
service
.
logout
(
pobj
)
async
logout
(
pobj
,
qobj
,
req
)
{
let
rtn
=
await
this
.
service
.
logout
(
pobj
)
return
system
.
getResult
(
rtn
)
}
async
pmgetUserByCode
(
pobj
,
qobj
,
req
)
{
let
code
=
pobj
.
code
let
rtn
=
await
this
.
service
.
pmgetUserByCode
(
code
)
async
pmgetUserByCode
(
pobj
,
qobj
,
req
)
{
let
code
=
pobj
.
code
let
rtn
=
await
this
.
service
.
pmgetUserByCode
(
code
)
return
system
.
getResult
(
rtn
)
}
async
loginApp
(
pobj
,
qobj
,
req
)
{
let
appkey
=
pobj
.
fromAppKey
let
uname
=
pobj
.
username
let
rtn
=
await
this
.
service
.
loginApp
(
appkey
,
uname
)
async
loginApp
(
pobj
,
qobj
,
req
)
{
let
appkey
=
pobj
.
fromAppKey
let
uname
=
pobj
.
username
let
rtn
=
await
this
.
service
.
loginApp
(
appkey
,
uname
)
return
system
.
getResult
(
rtn
);
}
async
resetPassword
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
resetPassword
(
req
.
xctx
.
username
,
pobj
.
onepassword
)
async
resetPassword
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
resetPassword
(
req
.
xctx
.
username
,
pobj
.
onepassword
)
return
system
.
getResult
({});
}
async
allowOrNot
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},{
company_id
:
pobj
.
company_id
})
async
allowOrNot
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},
{
company_id
:
pobj
.
company_id
})
return
system
.
getResult
({});
}
async
allowOrNotToOne
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},{
id
:
pobj
.
curid
})
async
allowOrNotToOne
(
pobj
,
qobj
,
req
)
{
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},
{
id
:
pobj
.
curid
})
return
system
.
getResult
({});
}
async
initNewInstance
(
queryobj
,
req
)
{
async
initNewInstance
(
queryobj
,
req
)
{
var
rtn
=
{};
rtn
.
roles
=
[];
return
system
.
getResultSuccess
(
rtn
);
...
...
@@ -46,17 +46,17 @@ class UserCtl extends CtlBase {
// let v = await this.smsS.sendVCode(mobile);
// return system.getResult({ vcodestr: v });
// }
async
exit
(
pobj
,
qobj
,
req
)
{
async
exit
(
pobj
,
qobj
,
req
)
{
}
//应用的自由用户注册,无需验证,需要前端头设置公司KEY
async
pmregisterByFreeUser
(
p
,
q
,
req
)
{
async
pmregisterByFreeUser
(
p
,
q
,
req
)
{
//检查是否有用户名和密码
if
(
!
pobj
.
userName
||
!
pobj
.
password
)
{
return
system
.
getResult
(
null
,
"请检查用户名和密码是否存在"
)
}
//p.company_id = req.xctx.companyid;//控制基类里已经添加
if
(
!
p
.
company_id
)
{
return
system
.
getResultFail
(
-
201
,
"自有用户创建需要提供公司KEY"
);
}
...
...
@@ -64,7 +64,7 @@ class UserCtl extends CtlBase {
return
rtn
;
}
async
create
(
p
,
q
,
req
)
{
async
create
(
p
,
q
,
req
)
{
//检查是否有用户名和密码
if
(
!
p
.
userName
)
{
return
system
.
getResult
(
null
,
"请检查用户名和密码是否存在"
)
...
...
@@ -77,7 +77,7 @@ class UserCtl extends CtlBase {
//和租户绑定同一家公司
//按照用户名和密码进行注册
//控制器端检查用户名和密码非空
async
registerByTantent
(
p
,
q
,
req
)
{
async
registerByTantent
(
p
,
q
,
req
)
{
//检查是否有用户名和密码
if
(
!
pobj
.
userName
)
{
return
system
.
getResult
(
null
,
"请检查用户名和密码是否存在"
)
...
...
@@ -86,7 +86,7 @@ class UserCtl extends CtlBase {
return
rtn
;
}
//租户用户名和密码的租户注册
async
pmregister
(
pobj
,
qobj
,
req
)
{
async
pmregister
(
pobj
,
qobj
,
req
)
{
//平台注册设置平台的应用ID
pobj
.
app_id
=
settings
.
pmappid
;
//检查是否有用户名和密码
...
...
@@ -96,19 +96,19 @@ class UserCtl extends CtlBase {
var
rtn
=
await
this
.
service
.
pmregister
(
pobj
);
return
system
.
getResult
(
rtn
);
}
async
pmlogin
(
pobj
,
qobj
,
req
)
{
async
pmlogin
(
pobj
,
qobj
,
req
)
{
//平台注册设置平台的应用ID
let
rtn
=
await
this
.
service
.
pmlogin
(
pobj
,
qobj
,
req
);
return
system
.
getResult
(
rtn
);
}
async
getUserInfo
(
pobj
,
qobj
,
req
)
{
async
getUserInfo
(
pobj
,
qobj
,
req
)
{
let
uname
=
req
.
xctx
.
username
;
let
rtn
=
await
this
.
service
.
getUserInfo
(
uname
);
return
system
.
getResult
(
rtn
);
}
//按照电话创建自由用户
async
pmloginByVCodeForFreeUser
(
p
,
q
,
req
)
{
async
pmloginByVCodeForFreeUser
(
p
,
q
,
req
)
{
if
(
!
pobj
.
mobile
||
!
pobj
.
vcode
)
{
return
system
.
getResult
(
null
,
"请检查手机号和验证码是否存在"
)
}
...
...
@@ -119,14 +119,13 @@ class UserCtl extends CtlBase {
let
rtn
=
await
this
.
service
.
pmloginByVCodeForFreeUser
(
p
,
q
);
return
rtn
;
}
async
pmloginByVCode
(
pobj
,
qobj
,
req
)
{
async
pmloginByVCode
(
pobj
,
qobj
,
req
)
{
let
rtn
=
await
this
.
service
.
pmloginByVCode
(
pobj
,
qobj
);
return
system
.
getResult
(
rtn
);
}
async
pmSendVCode
(
pobj
,
qobj
,
req
)
{
async
pmSendVCode
(
pobj
,
qobj
,
req
)
{
let
rtn
=
await
this
.
service
.
sendVCode
(
pobj
,
qobj
);
return
system
.
getResult
(
rtn
);
}
}
module
.
exports
=
UserCtl
;
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