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
c33df82b
Commit
c33df82b
authored
Jan 11, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
185e5384
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
center-app/app/base/api/impl/auth/accessAuth.js
+16
-0
center-app/app/base/utils/businessManager/opPlatformUtils.js
+36
-0
No files found.
center-app/app/base/api/impl/auth/accessAuth.js
View file @
c33df82b
...
...
@@ -52,5 +52,20 @@ class AccessAuthAPI extends APIBase {
var
result
=
await
this
.
opPlatformUtils
.
getReqUserPinByLgoinVcode
(
pobj
);
return
result
;
}
async
modiPasswordByMobile
(
pobj
,
qobj
,
req
)
{
var
actionBody
=
pobj
.
actionBody
;
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
if
(
!
actionBody
.
vcode
)
{
return
system
.
getResult
(
null
,
"actionBody.vcode can not be empty !"
);
}
if
(
!
actionBody
.
newPwd
)
{
return
system
.
getResult
(
null
,
"actionBody.newPwd can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
putUserPwdByMobile
(
pobj
,
actionBody
);
return
result
;
}
}
module
.
exports
=
AccessAuthAPI
;
\ No newline at end of file
center-app/app/base/utils/businessManager/opPlatformUtils.js
View file @
c33df82b
...
...
@@ -10,6 +10,7 @@ class OpPlatformUtils {
this
.
fetchDefaultVCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/fetchDefaultVCode"
;
this
.
loginUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/login"
;
this
.
loginByVCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/loginByVCode"
;
this
.
modiPasswordByMobileUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/modiPasswordByMobile"
;
}
getUUID
()
{
var
uuid
=
uuidv4
();
...
...
@@ -193,6 +194,23 @@ class OpPlatformUtils {
return
system
.
getResultSuccess
(
restResult
.
data
);
}
async
modiPasswordByMobile
(
mobile
,
vcode
,
newPwd
,
appKey
,
secret
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
appKey
,
secret
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
mobile
:
mobile
,
vcode
:
vcode
,
newPwd
:
newPwd
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
modiPasswordByMobileUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
null
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
();
}
//------------------------新的方式------------------------------------------------------------------------------------
async
getReqTokenByHosts
(
app_hosts
)
{
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
...
...
@@ -229,6 +247,24 @@ class OpPlatformUtils {
result
=
await
cacheManager
[
"AppUserPinByLoginVcodeCache"
].
cache
(
inputkey
,
pobj
,
system
.
shortExTime
);
return
result
;
}
async
putUserPwdByMobile
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"pobj.mobile can not be empty !"
);
}
if
(
!
actionBody
.
vcode
)
{
return
system
.
getResult
(
null
,
"pobj.vcode can not be empty !"
);
}
if
(
!
actionBody
.
newPwd
)
{
return
system
.
getResult
(
null
,
"pobj.newPwd can not be empty !"
);
}
if
(
!
actionBody
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
}
var
acckapp
=
await
this
.
modiPasswordByMobile
(
actionBody
.
mobile
,
actionBody
.
vcode
,
actionBody
.
newPwd
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
return
acckapp
;
}
}
module
.
exports
=
OpPlatformUtils
;
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