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
98980f7a
Commit
98980f7a
authored
Oct 30, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
register
parent
23ff18fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
center-app/app/base/db/cache/appUserPinByUserNameCache.js
+2
-1
center-app/app/base/utils/businessManager/opPlatformUtils.js
+10
-11
center-app/app/base/utils/execClient.js
+9
-0
No files found.
center-app/app/base/db/cache/appUserPinByUserNameCache.js
View file @
98980f7a
...
...
@@ -16,6 +16,7 @@ class AppUserPinByUserNameCache extends CacheBase {
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
actionBody
=
val
.
actionBody
;
var
appInfo
=
val
.
appInfo
;
var
uapp_id
=
appInfo
.
uapp_id
;
var
channelUserId
=
actionBody
.
channelUserId
?
actionBody
.
channelUserId
:
actionBody
.
userName
;
var
uUserName
=
actionBody
.
userName
?
actionBody
.
userName
:
actionBody
.
channelUserId
;
var
uPassword
=
actionBody
.
userName
?
actionBody
.
userName
:
actionBody
.
channelUserId
;
//uPassword
...
...
@@ -29,7 +30,7 @@ class AppUserPinByUserNameCache extends CacheBase {
userInfo
.
userpin
=
actionBody
.
userpin
;
return
system
.
getResultSuccess
(
userInfo
);
}
var
uUserInfo
=
await
this
.
opPlatformUtils
.
register
(
uUserName
,
uPassword
,
mobile
,
var
uUserInfo
=
await
this
.
opPlatformUtils
.
register
(
u
app_id
,
u
UserName
,
uPassword
,
mobile
,
appInfo
.
uapp_key
,
appInfo
.
uapp_secret
);
if
(
uUserInfo
.
status
!=
0
&&
uUserInfo
.
status
!=
2000
)
{
return
uUserInfo
;
...
...
center-app/app/base/utils/businessManager/opPlatformUtils.js
View file @
98980f7a
...
...
@@ -194,25 +194,24 @@ class OpPlatformUtils {
"requestid": "5362bf6f941e4f92961a61068f05cd7f"
}
*/
async
register
(
userName
,
password
,
mobile
,
appKey
,
secret
)
{
async
register
(
u
app_id
,
u
serName
,
password
,
mobile
,
appKey
,
secret
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
appKey
,
secret
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
userName
:
userName
,
channel_userid
:
userName
,
channel_username
:
userName
,
password
:
password
||
settings
.
defaultPassWord
,
mobile
:
mobile
mobile
:
mobile
,
uapp_id
:
uapp_id
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
registerUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResultFail
(
restResult
.
status
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
(
restResult
.
data
);
// var restResult = await this.restClient.execPostWithAK(
// param,
// this.registerUrl, reqApiAccessKey.data.accessKey);
let
restResult
=
await
this
.
appuserDao
.
create
(
param
)
return
system
.
getResultSuccess
(
restResult
);
}
/**
...
...
center-app/app/base/utils/execClient.js
View file @
98980f7a
var
childproc
=
require
(
'child_process'
);
const
util
=
require
(
'util'
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
settings
=
require
(
"../../config/settings"
)
const
axios
=
require
(
'axios'
)
class
ExecClient
{
constructor
()
{
...
...
@@ -42,6 +44,13 @@ class ExecClient {
return
cmd
;
}
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
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
...
...
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