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
bab60577
Commit
bab60577
authored
Feb 05, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
b9838446
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
4 deletions
+48
-4
bigdata/app/base/api/impl/auth/accessAuth.js
+32
-0
bigdata/app/base/service/impl/auth/userSve.js
+14
-2
bigdata/app/config/localsettings.js
+2
-2
No files found.
bigdata/app/base/api/impl/auth/accessAuth.js
View file @
bab60577
...
...
@@ -269,6 +269,22 @@ class AccessAuthAPI extends APIBase {
await
this
.
cacheManager
[
"OpenCodeCache"
].
cache
(
opencode
,
ruser
,
120
);
return
system
.
getResultSuccess
({
auth_url
:
authUrl
,
opencode
:
opencode
});
}
//unWxBind
async
unWxBind
(
pobj
,
qobj
,
req
)
{
var
appkey
=
req
.
app
.
appkey
;
if
(
!
pobj
.
mobile
)
{
return
system
.
getResult
(
null
,
"电话号码不能为空."
);
}
var
param
=
{
app_id
:
req
.
app
.
id
,
mobile
:
pobj
.
mobile
,
}
var
ruser
=
await
this
.
userSve
.
unWxBind
(
param
);
if
(
!
ruser
){
return
system
.
getResultFail
(
-
1
,
"查无此账户"
,
-
129
);
}
return
system
.
getResult
(
ruser
);
}
//wxbind
async
wxBind
(
pobj
,
qobj
,
req
)
{
var
appkey
=
req
.
app
.
appkey
;
...
...
@@ -309,6 +325,8 @@ class AccessAuthAPI extends APIBase {
return
system
.
getResultSuccess
({
auth_url
:
authUrl
,
opencode
:
opencode
});
}
//wxbind
async
wxBindWithoutVCode
(
pobj
,
qobj
,
req
)
{
var
appkey
=
req
.
app
.
appkey
;
if
(
!
pobj
.
mobile
)
{
...
...
@@ -802,6 +820,20 @@ class AccessAuthAPI extends APIBase {
rtnType
:
"成功:{status:0,data:{auth_url: xxxxx/auth?opencode=xxxxx,opencode:yyyy})"
},
{
methodDesc
:
"按照手机号,解除微信绑定,访问地址:http://......../api/auth/accessAuth/unWxBind,访问token需要放置到后续API方法调用的请求头中"
,
methodName
:
"wxBind"
,
paramdescs
:
[
{
paramDesc
:
"手机号"
,
paramName
:
"mobile"
,
paramType
:
"string"
,
defaultValue
:
""
,
},
],
rtnTypeDesc
:
"返回绑定后用户"
,
rtnType
:
"成功:{status:0....});失败:{status:-1,....data:-129}),表示不存在账号;"
},
{
methodDesc
:
"按照微信ID进行登录,访问地址:http://......../api/auth/accessAuth/loginByOpenId,访问token需要放置到后续API方法调用的请求头中"
,
methodName
:
"loginByOpenId"
,
paramdescs
:
[
...
...
bigdata/app/base/service/impl/auth/userSve.js
View file @
bab60577
...
...
@@ -349,6 +349,19 @@ class UserService extends ServiceBase {
}
return
user
;
}
async
unWxBind
(
u
){
var
self
=
this
;
return
this
.
db
.
transaction
(
async
function
(
t
)
{
var
user
=
await
self
.
dao
.
model
.
findOne
({
where
:
{
mobile
:
u
.
mobile
,
app_id
:
u
.
app_id
}});
if
(
!
user
){
return
null
;
}
else
{
user
.
wxopenid
=
null
;
await
user
.
save
();
return
user
;
}
});
}
async
checkWxBind
(
u
){
var
user
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
wxopenid
:
u
.
openid
,
app_id
:
u
.
app_id
}});
return
user
;
...
...
@@ -417,8 +430,7 @@ module.exports = UserService;
// (async ()=>{
// var us=new UserService();
// var u= await us.findUserByMobilePwd(2,'123456789','123');
// console.log(u.userName);
// var x=await us.updateUserMobile(u,'987456');
// var x=await us.unWxBind({mobile:'987456',app_id:2});
// if(!x){
// console.log("exit...");
// }
...
...
bigdata/app/config/localsettings.js
View file @
bab60577
...
...
@@ -10,8 +10,8 @@ var settings = {
user
:
"root"
,
password
:
"123456"
,
config
:
{
host
:
'
43.247.184.35
'
,
port
:
8899
,
host
:
'
192.168.4.119
'
,
port
:
3306
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
...
...
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