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
f7a496f9
Commit
f7a496f9
authored
Jan 11, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
27b265fe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
17 deletions
+151
-17
center-channel/app/base/api/impl/auth/accessAuth.js
+6
-0
center-channel/app/base/service/app.base.js
+11
-2
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+37
-12
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+3
-3
center-channel/app/front/entry/public/apidoc/user/user.md
+94
-0
No files found.
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
f7a496f9
...
@@ -61,6 +61,12 @@ class AccessAuthAPI extends APIBase {
...
@@ -61,6 +61,12 @@ class AccessAuthAPI extends APIBase {
return
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
return
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
}
}
break
;
break
;
case
"logout"
:
opResult
=
await
this
.
utilsAuthSve
.
userLogout
(
action_body
);
break
;
case
"putUserPwdByMobile"
:
opResult
=
await
this
.
utilsAuthSve
.
putUserPwdByMobile
(
action_body
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-channel/app/base/service/app.base.js
View file @
f7a496f9
...
@@ -5,6 +5,7 @@ const md5 = require("MD5");
...
@@ -5,6 +5,7 @@ const md5 = require("MD5");
class
AppServiceBase
{
class
AppServiceBase
{
constructor
()
{
constructor
()
{
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
}
}
/**
/**
...
@@ -40,10 +41,18 @@ class AppServiceBase {
...
@@ -40,10 +41,18 @@ class AppServiceBase {
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
async
exec
PostUrl
(
pobj
,
url
)
{
async
rest
PostUrl
(
pobj
,
url
)
{
var
rtn
=
await
this
.
restClient
.
execPost
(
pobj
,
url
);
var
rtn
=
await
this
.
restClient
.
execPost
(
pobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost is empty"
);
return
system
.
getResult
(
null
,
"restPost data is empty"
);
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
async
execPostUrl
(
pobj
,
url
)
{
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
return
result
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
f7a496f9
...
@@ -36,18 +36,6 @@ class UtilsAuthSve extends AppServiceBase {
...
@@ -36,18 +36,6 @@ class UtilsAuthSve extends AppServiceBase {
var
result
=
await
this
.
cacheManager
[
"AppTokenByHostsCache"
].
cache
(
tokenValue
,
appHosts
,
system
.
exTime
);
var
result
=
await
this
.
cacheManager
[
"AppTokenByHostsCache"
].
cache
(
tokenValue
,
appHosts
,
system
.
exTime
);
return
result
;
return
result
;
}
}
async
getVerifyCodeByMoblie
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
var
acckapp
=
await
this
.
restClient
.
execPost
(
pobj
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/getVerifyCodeByMoblie"
);
var
result
=
acckapp
.
stdout
;
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
return
tmp
;
}
return
system
.
getResult
(
null
,
"data is empty"
);
}
async
getReqUserPinByLgoin
(
pobj
,
actionBody
)
{
async
getReqUserPinByLgoin
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
userName
)
{
if
(
!
actionBody
.
userName
)
{
return
system
.
getResult
(
null
,
"actionBody.userName can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.userName can not be empty"
);
...
@@ -74,5 +62,42 @@ class UtilsAuthSve extends AppServiceBase {
...
@@ -74,5 +62,42 @@ class UtilsAuthSve extends AppServiceBase {
return
result
;
return
result
;
}
}
async
getVerifyCodeByMoblie
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
return
await
this
.
restPostUrl
(
pobj
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/getVerifyCodeByMoblie"
);
}
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
result
=
await
this
.
restPostUrl
(
pobj
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/modiPasswordByMobile"
);
if
(
acckapp
.
status
==
0
&&
actionBody
.
userpin
)
{
this
.
userLogout
(
pobj
,
actionBody
);
}
return
system
.
getResultSuccess
();
}
async
userLogout
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
userpin
)
{
return
system
.
getResult
(
null
,
"actionBody.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
=
UtilsAuthSve
;
module
.
exports
=
UtilsAuthSve
;
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
f7a496f9
...
@@ -17,7 +17,7 @@ class UtilsProductSve extends AppServiceBase {
...
@@ -17,7 +17,7 @@ class UtilsProductSve extends AppServiceBase {
return
system
.
getResult
(
null
,
"actionBody.typeCode can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.typeCode can not be empty"
);
}
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
exec
PostUrl
(
pobj
,
url
);
return
await
this
.
rest
PostUrl
(
pobj
,
url
);
}
}
/**
/**
* 根据产品类型码获取产品列表
* 根据产品类型码获取产品列表
...
@@ -28,7 +28,7 @@ class UtilsProductSve extends AppServiceBase {
...
@@ -28,7 +28,7 @@ class UtilsProductSve extends AppServiceBase {
return
system
.
getResult
(
null
,
"actionBody.typeOneCode can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.typeOneCode can not be empty"
);
}
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
exec
PostUrl
(
pobj
,
url
);
return
await
this
.
rest
PostUrl
(
pobj
,
url
);
}
}
/**
/**
* 获取产品详情
* 获取产品详情
...
@@ -39,7 +39,7 @@ class UtilsProductSve extends AppServiceBase {
...
@@ -39,7 +39,7 @@ class UtilsProductSve extends AppServiceBase {
return
system
.
getResult
(
null
,
"actionBody.channelItemCode can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.channelItemCode can not be empty"
);
}
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
exec
PostUrl
(
pobj
,
url
);
return
await
this
.
rest
PostUrl
(
pobj
,
url
);
}
}
//--------------------------------应用中心获取产品信息--end----------------------------------------------------
//--------------------------------应用中心获取产品信息--end----------------------------------------------------
...
...
center-channel/app/front/entry/public/apidoc/user/user.md
View file @
f7a496f9
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
1.
[
密码登录
](
#pwdLogin
)
1.
[
密码登录
](
#pwdLogin
)
1.
[
验证码登录
](
#userPinByLgoinVcode
)
1.
[
验证码登录
](
#userPinByLgoinVcode
)
1.
[
用户注册
](
#userPinByRegister
)
1.
[
用户注册
](
#userPinByRegister
)
1.
[
按照手机号和验证码修改密码
](
#putUserPwdByMobile
)
1.
[
退出
](
#logout
)
## **<a name="smsCode"> 短信验证码</a>**
## **<a name="smsCode"> 短信验证码</a>**
...
@@ -114,3 +116,95 @@
...
@@ -114,3 +116,95 @@
}
}
```
```
## **<a name="putUserPwdByMobile"> 按照手机号和验证码修改密码</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/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
[
/web/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