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
7b6d86ce
Commit
7b6d86ce
authored
Nov 12, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
eee81216
Pipeline
#16200
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
wechat.js
app/controller/gjj/wechat.js
+7
-6
No files found.
app/controller/gjj/wechat.js
View file @
7b6d86ce
...
@@ -35,8 +35,14 @@ class WechatController extends Controller {
...
@@ -35,8 +35,14 @@ class WechatController extends Controller {
ctx
.
failed
(
'获取openid失败2'
);
ctx
.
failed
(
'获取openid失败2'
);
}
}
const
openid
=
wx_ret
.
openid
;
const
openid
=
wx_ret
.
openid
;
//微信端需要关闭重新打开APP才会销毁cookie,所以在这里重置cookie
ctx
.
cookies
.
set
(
'openid'
,
openid
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'openid'
,
openid
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'app_user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'jianbing_customer_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'auth_token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
const
redirect_url
=
this
.
app
.
config
.
PULIC_BASE_URL
+
REDIRECT_PAGE
;
const
redirect_url
=
this
.
app
.
config
.
PULIC_BASE_URL
+
REDIRECT_PAGE
;
//判断是否已绑定手机号
//判断是否已绑定手机号
const
user_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/user_api/v1/user/is_exist/
${
openid
}
`
;
const
user_exist_url
=
`
${
this
.
app
.
config
.
NODE_BASE_URL
}
/user_api/v1/user/is_exist/
${
openid
}
`
;
...
@@ -159,11 +165,6 @@ class WechatController extends Controller {
...
@@ -159,11 +165,6 @@ 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
===
'需要重新授权'
)
{
if
(
error_msg
===
'需要重新授权'
)
{
ctx
.
cookies
.
set
(
'token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'app_user_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'jianbing_customer_id'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
ctx
.
cookies
.
set
(
'auth_token'
,
null
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
return
{
anew
:
1
};
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