Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
561a3991
Commit
561a3991
authored
Nov 11, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
857af75e
Pipeline
#16160
passed with stage
in 45 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
wechat.js
app/controller/gjj/wechat.js
+9
-3
No files found.
app/controller/gjj/wechat.js
View file @
561a3991
...
@@ -43,16 +43,19 @@ class WechatController extends Controller {
...
@@ -43,16 +43,19 @@ class WechatController extends Controller {
const
bind_phone_result
=
await
ctx
.
helper
.
send_request
(
user_exist_url
,
{
type
:
5
},
{
method
:
'GET'
});
const
bind_phone_result
=
await
ctx
.
helper
.
send_request
(
user_exist_url
,
{
type
:
5
},
{
method
:
'GET'
});
ctx
.
logger
.
info
(
JSON
.
stringify
({
bind_phone_result
:
bind_phone_result
}));
ctx
.
logger
.
info
(
JSON
.
stringify
({
bind_phone_result
:
bind_phone_result
}));
if
(
bind_phone_result
.
status
!==
200
)
{
if
(
bind_phone_result
.
status
!==
200
)
{
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin
&openid=
${
openid
}
`
);
return
;
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
}
const
user_exist_ret
=
bind_phone_result
.
data
;
const
user_exist_ret
=
bind_phone_result
.
data
;
if
(
user_exist_ret
.
result
!=
'true'
)
{
//未绑定的手机号时
if
(
user_exist_ret
.
result
!=
'true'
)
{
//未绑定的手机号时
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin
&openid=
${
openid
}
`
);
return
;
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
}
const
user_id
=
user_exist_ret
.
uid
;
const
user_id
=
user_exist_ret
.
uid
;
//已绑定手机的 继续 判断是否有导入公积金
//已绑定手机的 继续 判断是否有导入公积金
await
this
.
user_login
({
code
,
openid
,
channel_id
});
//已绑定的用户 直接登录
const
login_result
=
await
this
.
user_login
({
code
,
openid
,
channel_id
});
//已绑定的用户 直接登录
if
(
login_result
.
anew
&&
!
login_result
.
token
)
{
ctx
.
redirect
(
redirect_url
+
`?channel_id=
${
channel_id
}
&type=noLogin`
);
return
;
}
const
gjj_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/cassandra-server/gjj/list/
${
user_id
}
`
;
const
gjj_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/cassandra-server/gjj/list/
${
user_id
}
`
;
const
gjj_exist_result
=
await
ctx
.
helper
.
send_request
(
gjj_exist_url
,
{},
{
method
:
'GET'
});
const
gjj_exist_result
=
await
ctx
.
helper
.
send_request
(
gjj_exist_url
,
{},
{
method
:
'GET'
});
...
@@ -155,6 +158,9 @@ class WechatController extends Controller {
...
@@ -155,6 +158,9 @@ class WechatController extends Controller {
}
}
if
(
!
user_login_data
.
token
||
!
user_login_data
.
uid
)
{
if
(
!
user_login_data
.
token
||
!
user_login_data
.
uid
)
{
const
error_msg
=
user_login_data
.
error
?
user_login_data
.
error
:
'用户的登录失败'
;
const
error_msg
=
user_login_data
.
error
?
user_login_data
.
error
:
'用户的登录失败'
;
if
(
error_msg
===
'需要重新授权'
)
{
return
{
anew
:
1
};
}
ctx
.
failed
(
error_msg
);
ctx
.
failed
(
error_msg
);
}
}
//获取用户信息
//获取用户信息
...
...
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