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
ef9c0486
Commit
ef9c0486
authored
Feb 11, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
e6aca6ec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
43 deletions
+154
-43
center-app/app/base/api/impl/auth/accessAuth.js
+17
-15
center-app/app/base/db/cache/appUserPinByLoginPwdCache.js
+1
-0
center-app/app/base/db/cache/appUserPinByLoginVcodeCache.js
+5
-0
center-app/app/base/system.js
+6
-0
center-app/app/base/utils/businessManager/opPlatformUtils.js
+125
-28
No files found.
center-app/app/base/api/impl/auth/accessAuth.js
View file @
ef9c0486
...
...
@@ -11,23 +11,15 @@ class AccessAuthAPI extends APIBase {
return
result
;
}
async
getVerifyCodeByMoblie
(
pobj
,
qobj
,
req
)
{
async
getVerifyCodeByMoblie
(
pobj
,
qobj
,
req
)
{
//获取默认模板的手机验证码
if
(
!
pobj
.
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
fetchVCode
(
pobj
.
actionBody
.
mobile
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
var
result
=
await
this
.
opPlatformUtils
.
fetch
Default
VCode
(
pobj
.
actionBody
.
mobile
,
pobj
.
appInfo
.
uapp_key
,
pobj
.
appInfo
.
uapp_secret
);
return
result
;
}
async
loginUserByChannelUserId
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResult
(
null
,
"actionBody.channelUserId can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
getReqUserPinByChannelUserId
(
pobj
);
return
result
;
}
async
login
(
pobj
,
qobj
,
req
)
{
async
login
(
pobj
,
qobj
,
req
)
{
//通过账户和密码登录
if
(
!
pobj
.
actionBody
.
userName
)
{
return
system
.
getResult
(
null
,
"actionBody.userName can not be empty !"
);
}
...
...
@@ -38,7 +30,7 @@ class AccessAuthAPI extends APIBase {
return
result
;
}
async
loginByVerifyCode
(
pobj
,
qobj
,
req
)
{
async
loginByVerifyCode
(
pobj
,
qobj
,
req
)
{
//通过短信登录或注册信息
if
(
!
pobj
.
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
}
...
...
@@ -48,7 +40,7 @@ class AccessAuthAPI extends APIBase {
var
result
=
await
this
.
opPlatformUtils
.
getReqUserPinByLgoinVcode
(
pobj
);
return
result
;
}
async
modiPasswordByMobile
(
pobj
,
qobj
,
req
)
{
async
modiPasswordByMobile
(
pobj
,
qobj
,
req
)
{
//通过手机验证码修改用户密码
var
actionBody
=
pobj
.
actionBody
;
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"actionBody.mobile can not be empty !"
);
...
...
@@ -59,11 +51,21 @@ class AccessAuthAPI extends APIBase {
if
(
!
actionBody
.
newPwd
)
{
return
system
.
getResult
(
null
,
"actionBody.newPwd can not be empty !"
);
}
if
(
!
actionBody
.
userpin
)
{
return
system
.
getResult
(
null
,
"actionBody.userpin can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
putUserPwdByMobile
(
pobj
,
actionBody
);
return
result
;
}
async
logout
(
pobj
,
qobj
,
req
){
async
getLoginInfo
(
pobj
,
qobj
,
req
)
{
//通过手机验证码修改用户密码
var
actionBody
=
pobj
.
actionBody
;
if
(
!
actionBody
.
userpin
)
{
return
system
.
getResult
(
null
,
"actionBody.userpin can not be empty !"
);
}
var
result
=
await
this
.
opPlatformUtils
.
getUserLoginInfo
(
pobj
,
actionBody
);
return
result
;
}
async
logout
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
opPlatformUtils
.
logout
(
pobj
);
return
result
;
}
...
...
center-app/app/base/db/cache/appUserPinByLoginPwdCache.js
View file @
ef9c0486
...
...
@@ -30,6 +30,7 @@ class AppUserPinByLoginPwdCache extends CacheBase {
if
(
userInfo
.
is_enabled
!=
1
)
{
return
system
.
getResult
(
null
,
"user to item is Disable !"
);
}
userInfo
.
userpin
=
actionBody
.
userpin
;
return
system
.
getResultSuccess
(
userInfo
);
}
}
...
...
center-app/app/base/db/cache/appUserPinByLoginVcodeCache.js
View file @
ef9c0486
...
...
@@ -27,6 +27,10 @@ class AppUserPinByLoginVcodeCache extends CacheBase {
if
(
userInfo
.
is_enabled
!=
1
)
{
return
system
.
getResult
(
null
,
"user to item is Disable !"
);
}
if
(
actionBody
.
reqType
==
"reg"
)
{
return
system
.
getResultFail
(
system
.
existUserRegFail
,
"已经存在此用户,注册失败"
);
}
userInfo
.
userpin
=
actionBody
.
userpin
;
return
system
.
getResultSuccess
(
userInfo
);
}
var
params
=
{
...
...
@@ -42,6 +46,7 @@ class AppUserPinByLoginVcodeCache extends CacheBase {
last_login_time
:
new
Date
()
};
userInfo
=
await
this
.
appuserDao
.
create
(
params
);
userInfo
.
userpin
=
actionBody
.
userpin
;
return
system
.
getResultSuccess
(
userInfo
);
}
}
...
...
center-app/app/base/system.js
View file @
ef9c0486
...
...
@@ -296,6 +296,12 @@ System.exTime = 4 * 3600;//缓存过期时间,4小时
System
.
shortExTime
=
300
;
//300
//缓存失效
System
.
cacheInvalidation
=
-
88
;
System
.
noLogin
=
-
99
;
//已经存在此用户,注册失败
System
.
existUserRegFail
=
2000
;
//重复登录
System
.
reDoLoginFail
=
2060
;
...
...
center-app/app/base/utils/businessManager/opPlatformUtils.js
View file @
ef9c0486
This diff is collapsed.
Click to expand it.
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