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
c9a167b2
Commit
c9a167b2
authored
May 21, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
response fix
parent
bffca079
Pipeline
#7925
passed with stage
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
response.js
app/controller/response.js
+9
-3
No files found.
app/controller/response.js
View file @
c9a167b2
...
@@ -3,20 +3,26 @@
...
@@ -3,20 +3,26 @@
const
Controller
=
require
(
'egg'
).
Controller
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
ResponseController
extends
Controller
{
class
ResponseController
extends
Controller
{
//内部授权注册
//内部授权注册
async
internalAuth
()
{
async
internalAuth
()
{
//https://b.jianbing.com/51business/api/response/internal/auth?target_url=https://b.jianbing.com/webserve/51estate/index?channel_id=fc_gjjfc1
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
header
=
ctx
.
request
.
header
;
const
header
=
ctx
.
request
.
header
;
const
input_params
=
ctx
.
query
;
const
input_params
=
ctx
.
query
;
cons
t
target_url
=
input_params
.
target_url
;
le
t
target_url
=
input_params
.
target_url
;
const
rule
=
{
const
rule
=
{
target_url
:
{
type
:
'string'
,
required
:
true
},
target_url
:
{
type
:
'string'
,
required
:
true
},
channel_id
:
{
type
:
'string'
,
required
:
true
},
channel_id
:
{
type
:
'string'
,
required
:
true
},
}
}
ctx
.
validate
(
rule
,
input_params
);
ctx
.
validate
(
rule
,
input_params
);
if
(
target_url
.
indexOf
(
'?'
)
!==
-
1
)
{
target_url
+=
`&channel_id=
${
channel_id
}
`
;
}
else
{
target_url
+=
`?channel_id=
${
channel_id
}
`
;
}
//如果cookie中已存在 5要素 则可直接 跳到目标地址
//如果cookie中已存在 5要素 则可直接 跳到目标地址
const
token
=
ctx
.
cookies
.
get
(
'token'
,
{
signed
:
false
});
const
token
=
ctx
.
cookies
.
get
(
'token'
,
{
signed
:
false
});
const
user_id
=
ctx
.
cookies
.
get
(
'user_id'
,
{
signed
:
false
});
const
user_id
=
ctx
.
cookies
.
get
(
'user_id'
,
{
signed
:
false
});
...
...
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