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
3ee3f957
Commit
3ee3f957
authored
Jan 11, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
3d8e2d0a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
2 deletions
+108
-2
igirl-channel/app/base/api/impl/auth/accessAuth.js
+8
-2
igirl-channel/app/base/utils/businessManager/opPlatformUtils.js
+46
-0
igirl-channel/app/front/entry/public/apidoc/user/user.md
+54
-0
No files found.
igirl-channel/app/base/api/impl/auth/accessAuth.js
View file @
3ee3f957
...
...
@@ -43,8 +43,8 @@ class AccessAuthAPI extends APIBase {
action_body
.
appInfo
=
req
.
app
;
var
opStr
=
action_body
.
userName
||
action_body
.
mobile
;
var
encryptStrResult
=
await
this
.
toolSve
.
encryptStr
(
req
.
app
,
opStr
);
if
(
encryptStrResult
.
status
==
0
)
{
encryptStrResult
.
data
=
encodeURIComponent
(
encryptStrResult
.
data
);
if
(
encryptStrResult
.
status
==
0
)
{
encryptStrResult
.
data
=
encodeURIComponent
(
encryptStrResult
.
data
);
}
switch
(
action_type
)
{
// sy
...
...
@@ -81,6 +81,12 @@ class AccessAuthAPI extends APIBase {
return
system
.
getResultSuccess
({
userpin
:
userpin
,
channelUserId
:
encryptStrResult
.
data
,
userName
:
opStr
})
}
break
;
case
"logout"
:
opResult
=
await
this
.
opPlatformUtils
.
userLogout
(
action_body
);
break
;
case
"putUserPwdByMobile"
:
opResult
=
await
this
.
opPlatformUtils
.
putUserPwdByMobile
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
igirl-channel/app/base/utils/businessManager/opPlatformUtils.js
View file @
3ee3f957
...
...
@@ -11,6 +11,8 @@ class OpPlatformUtils {
this
.
loginUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/loginByMd5Password"
;
this
.
authByCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/authByCode"
;
this
.
loginByVCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/loginByVCode"
;
this
.
modiPasswordByMobileUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/modiPasswordByMobile"
;
this
.
exTime
=
2
*
3600
;
//缓存过期时间,2小时
}
getUUID
()
{
...
...
@@ -86,6 +88,22 @@ class OpPlatformUtils {
}
return
system
.
getResultSuccess
();
}
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
();
}
/**
* 用户登录
* @param {*} userName 用户名
...
...
@@ -243,6 +261,34 @@ class OpPlatformUtils {
var
acckapp
=
await
this
.
fetchVCode
(
actionBody
.
mobile
,
actionBody
.
appInfo
.
uappKey
,
actionBody
.
appInfo
.
appSecret
);
return
acckapp
;
}
async
putUserPwdByMobile
(
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
,
actionBody
.
appInfo
.
uappKey
,
actionBody
.
appInfo
.
appSecret
);
if
(
acckapp
.
status
==
0
&&
actionBody
.
userpin
)
{
this
.
userLogout
(
actionBody
);
}
return
acckapp
;
}
async
userLogout
(
actionBody
)
{
if
(
!
actionBody
.
userpin
)
{
return
system
.
getResult
(
null
,
"pobj.userpin can not be empty !"
);
}
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
await
cacheManager
[
"AppUserPinByLoginVcodeCache"
].
invalidate
(
actionBody
.
userpin
);
await
cacheManager
[
"AppUserPinByLoginPwdCache"
].
invalidate
(
actionBody
.
userpin
);
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
OpPlatformUtils
;
igirl-channel/app/front/entry/public/apidoc/user/user.md
View file @
3ee3f957
...
...
@@ -3,6 +3,8 @@
1.
[
密码登录
](
#pwdLogin
)
1.
[
验证码登录
](
#userPinByLgoinVcode
)
1.
[
用户注册
](
#userPinByRegister
)
1.
[
按照手机号和验证码修改密码
](
#putUserPwdByMobile
)
1.
[
退出
](
#logout
)
## **<a name="smsCode"> 短信验证码</a>**
...
...
@@ -120,3 +122,55 @@
}
```
## **<a name="putUserPwdByMobile"> 按照手机号和验证码修改密码</a>**
[
返回到目录
](
#menu
)
##### URL
[
/auth/accessAuth/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:putUserPwdByMobile
```
javascript
{
"mobile"
:
"15010929366"
,
// Y 手机号
"vcode"
:
"593555"
,
// Y 验证码
"newPwd"
:
"123456"
// Y 新密码
"userpin"
:
"79009f97cebf4866834ee9e863d5f9b8"
// N 用户登录凭证key
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,2030为验证码错误,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="logout"> 退出</a>**
[
返回到目录
](
#menu
)
##### URL
[
/auth/accessAuth/springBoard
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:logout
```
javascript
{
"userpin"
:
"15010929366"
// Y 用户登录凭证key
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
// 0为成功,否则失败
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"1b12b0e9c190436da000386ddf693c8f"
}
```
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