Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
QA
qa-api
Commits
9d9cc7d0
Commit
9d9cc7d0
authored
Apr 24, 2020
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加redis判断
parent
3c790b94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
k8s.js
app/controller/k8s.js
+11
-9
No files found.
app/controller/k8s.js
View file @
9d9cc7d0
...
...
@@ -9,17 +9,19 @@ const api = async function (ctx) {
})
if
(
ctx
.
request
.
method
===
'
POST
'
&&
ctx
.
response
.
status
===
200
&&
ctx
.
request
.
url
.
indexOf
(
'
/service
'
)
!==
-
1
)
{
const
user
=
await
ctx
.
redisGet
(
config
.
QA_TOKEN
,
ctx
.
request
.
header
[
'
x-token
'
])
if
(
user
)
{
const
body
=
ctx
.
request
.
body
const
data
=
{
namespace
:
body
.
namespace
,
active
:
ctx
.
request
.
url
.
replace
(
'
/k8s/
'
,
''
).
replace
(
'
/
'
,
'
_
'
),
microservice_name
:
body
.
serviceName
,
user
:
user
&&
user
.
cn
,
user_mail
:
user
&&
user
.
mail
,
user
:
user
.
cn
,
user_mail
:
user
.
mail
,
detail
:
body
,
}
await
StatisticsLog
.
saveLog
(
data
);
}
}
}
const
router
=
new
Router
();
...
...
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