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
fdecf198
Commit
fdecf198
authored
Oct 27, 2020
by
任晓松
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c5ffeb4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletions
+49
-1
center-app/app/base/utils/businessManager/opPlatformUtils.js
+29
-1
center-app/app/base/utils/restClient.js
+20
-0
No files found.
center-app/app/base/utils/businessManager/opPlatformUtils.js
View file @
fdecf198
...
@@ -411,7 +411,35 @@ class OpPlatformUtils {
...
@@ -411,7 +411,35 @@ class OpPlatformUtils {
return
system
.
getResultFail
(
system
.
verifyVCodeFail
,
"验证码校验不成功,请重新获取验证码验证."
,
system
.
verifyVCodeFail
);
return
system
.
getResultFail
(
system
.
verifyVCodeFail
,
"验证码校验不成功,请重新获取验证码验证."
,
system
.
verifyVCodeFail
);
}
}
const
uPassword
=
await
this
.
getEncryptStr
(
actionBody
.
newPwd
);
//uPassword
const
uPassword
=
await
this
.
getEncryptStr
(
actionBody
.
newPwd
);
//uPassword
await
this
.
appuserDao
.
updateByWhere
({
password
:
uPassword
},
{
where
:
{
channel_userid
:
actionBody
.
mobile
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
}
})
await
this
.
appuserDao
.
updateByWhere
({
password
:
uPassword
},
{
where
:
{
channel_userid
:
pobj
.
userInfo
.
channel_userid
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
}
})
return
system
.
getResultSuccess
();
}
/**
* 通过手机验证码修改用户手机号、邮箱,前端修改后要移除掉userpin让用户进行重新登录
* @param {*} pobj
* @param {*} actionBody {mobile:XX,vcode:XXX,email:XXX}
*/
async
putUserMobileByVcode
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
vcode
)
{
return
system
.
getResult
(
null
,
"pobj.vcode can not be empty !"
);
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
}
let
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
inputkey
=
pobj
.
appInfo
.
uapp_key
+
"_"
+
pobj
.
actionBody
.
mobile
;
var
cacheCode
=
await
cacheManager
[
"VCodeCache"
].
getCache
(
inputkey
);
if
(
!
cacheCode
||
pobj
.
vcode
!=
cacheCode
.
vcode
)
{
return
system
.
getResultFail
(
system
.
verifyVCodeFail
,
"验证码校验不成功,请重新获取验证码验证."
,
system
.
verifyVCodeFail
);
}
let
updateObj
=
{};
if
(
actionBody
.
newMobile
){
updateObj
.
mobile
=
actionBody
.
newMobile
;
}
if
(
actionBody
.
email
){
updateObj
.
emial
=
actionBody
.
email
;
}
await
this
.
appuserDao
.
updateByWhere
(
updateObj
,
{
where
:
{
channel_userid
:
pobj
.
userInfo
.
channel_userid
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
}
})
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
/**
/**
...
...
center-app/app/base/utils/restClient.js
View file @
fdecf198
...
@@ -4,6 +4,7 @@ const exec = util.promisify(require('child_process').exec);
...
@@ -4,6 +4,7 @@ const exec = util.promisify(require('child_process').exec);
const
querystring
=
require
(
'querystring'
);
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../config/settings"
);
var
settings
=
require
(
"../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
axios
=
require
(
'axios'
)
class
RestClient
{
class
RestClient
{
constructor
()
{
constructor
()
{
this
.
cmdGetPattern
=
"curl {-G} -k -d '{data}' {url}"
;
this
.
cmdGetPattern
=
"curl {-G} -k -d '{data}' {url}"
;
...
@@ -87,6 +88,13 @@ class RestClient {
...
@@ -87,6 +88,13 @@ class RestClient {
return
result
;
return
result
;
}
}
async
execPost
(
subData
,
url
)
{
async
execPost
(
subData
,
url
)
{
if
(
settings
.
env
==
'dev'
){
const
rs
=
await
axios
.
post
(
url
,
subData
);
const
ret
=
{
stdout
:
JSON
.
stringify
(
rs
.
data
)
}
return
ret
;
}
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
,
{
var
result
=
await
this
.
exec
(
cmd
,
{
maxBuffer
:
10000
*
1024
maxBuffer
:
10000
*
1024
...
@@ -94,6 +102,11 @@ class RestClient {
...
@@ -94,6 +102,11 @@ class RestClient {
return
result
;
return
result
;
}
}
async
execPostWithAK
(
subData
,
url
,
ak
)
{
async
execPostWithAK
(
subData
,
url
,
ak
)
{
if
(
settings
.
env
==
'dev'
){
axios
.
defaults
.
headers
[
'AccessKey'
]
=
ak
;
const
rs
=
await
axios
.
post
(
url
,
subData
);
return
rs
.
data
;
}
let
cmd
=
this
.
FetchPostCmdWithAK
(
subData
,
url
,
ak
);
let
cmd
=
this
.
FetchPostCmdWithAK
(
subData
,
url
,
ak
);
var
result
=
await
this
.
exec
(
cmd
,
{
var
result
=
await
this
.
exec
(
cmd
,
{
maxBuffer
:
1024
*
1024
*
15
maxBuffer
:
1024
*
1024
*
15
...
@@ -106,6 +119,13 @@ class RestClient {
...
@@ -106,6 +119,13 @@ class RestClient {
}
}
}
}
async
execPost2
(
subData
,
url
)
{
async
execPost2
(
subData
,
url
)
{
if
(
settings
.
env
==
'dev'
){
const
rs
=
await
axios
.
post
(
url
,
subData
);
const
ret
=
{
stdout
:
JSON
.
stringify
(
rs
.
data
)
}
return
ret
;
}
let
cmd
=
this
.
FetchPostCmd2
(
subData
,
url
);
let
cmd
=
this
.
FetchPostCmd2
(
subData
,
url
);
console
.
log
(
cmd
);
console
.
log
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
);
...
...
任晓松
@renxiaosong
mentioned in commit
e7482241
Oct 27, 2020
mentioned in commit
e7482241
mentioned in commit e7482241d9f52cf14491f69bc56716bfcd42a774
Toggle commit list
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