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
4072761e
Commit
4072761e
authored
Sep 09, 2020
by
黎博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/QA/qa-api
parents
c5318b53
3b518f00
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
dbsync.js
app/controller/dbsync.js
+19
-1
k8s.js
app/controller/k8s.js
+4
-1
user.js
app/controller/user.js
+3
-2
repoServiceNew.js
app/service/repoServiceNew.js
+0
-1
No files found.
app/controller/dbsync.js
View file @
4072761e
...
@@ -7,6 +7,7 @@ const jenkinsService = require('../service/jenkinsService')
...
@@ -7,6 +7,7 @@ const jenkinsService = require('../service/jenkinsService')
const
k8sService
=
require
(
'
../service/k8sService
'
)
const
k8sService
=
require
(
'
../service/k8sService
'
)
const
{
DBConfig
}
=
require
(
'
../service/mongoService
'
)
const
{
DBConfig
}
=
require
(
'
../service/mongoService
'
)
const
{
api
}
=
require
(
'
../../src
'
)
const
{
api
}
=
require
(
'
../../src
'
)
const
{
StatisticsLog
}
=
require
(
'
../service/mongoService
'
);
const
domain
=
'
liangkebang.com
'
const
domain
=
'
liangkebang.com
'
let
domainTKE
=
'
liangkebang.net
'
let
domainTKE
=
'
liangkebang.net
'
...
@@ -109,6 +110,23 @@ const dbSyncTke = async function (ctx) {
...
@@ -109,6 +110,23 @@ const dbSyncTke = async function (ctx) {
domain
:
domainTKE
,
domain
:
domainTKE
,
})
})
ctx
.
body
=
ctx
.
ok
({
location
:
res
.
location
})
ctx
.
body
=
ctx
.
ok
({
location
:
res
.
location
})
// 数据库同步时新增行为记录
if
(
ctx
.
request
.
method
===
'
POST
'
&&
ctx
.
response
.
status
===
200
)
{
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
:
'
同步
'
+
body
.
mysqlName
,
microservice_name
:
body
.
dbname
,
user
:
user
.
cn
,
user_mail
:
user
.
mail
,
detail
:
body
,
}
await
StatisticsLog
.
saveLog
(
data
);
}
}
}
}
const
dbSyncQuery
=
async
function
(
ctx
)
{
const
dbSyncQuery
=
async
function
(
ctx
)
{
...
...
app/controller/k8s.js
View file @
4072761e
...
@@ -19,9 +19,12 @@ const api = async function (ctx) {
...
@@ -19,9 +19,12 @@ const api = async function (ctx) {
user_mail
:
user
.
mail
,
user_mail
:
user
.
mail
,
detail
:
body
,
detail
:
body
,
}
}
// 用户行为记录中过滤rabbitmq
if
(
!
(
data
.
active
===
'
service_details
'
&&
data
.
microservice_name
===
'
rabbitmq
'
))
{
await
StatisticsLog
.
saveLog
(
data
);
await
StatisticsLog
.
saveLog
(
data
);
}
}
}
}
}
}
}
const
router
=
new
Router
();
const
router
=
new
Router
();
...
...
app/controller/user.js
View file @
4072761e
...
@@ -12,7 +12,8 @@ const authenticate = require('../service/authenticate')
...
@@ -12,7 +12,8 @@ const authenticate = require('../service/authenticate')
const
router
=
new
Router
()
const
router
=
new
Router
()
const
admin
=
[
'
zhijie.xue
'
,
'
luoyong.meng
'
,
'
jinfang.liu
'
,
'
qiuyue.gui
'
,
'
yong.zhi
'
,
'
haiyuan.wen
'
]
const
admin
=
[
'
qiaoling.yu
'
,
'
lili.wang
'
,
'
zhijie.xue
'
,
'
luoyong.meng
'
,
'
jinfang.liu
'
,
'
qiuyue.gui
'
,
'
yong.zhi
'
,
'
haiyuan.wen
'
]
const
login
=
async
function
(
ctx
)
{
const
login
=
async
function
(
ctx
)
{
const
{
body
}
=
ctx
.
request
const
{
body
}
=
ctx
.
request
...
@@ -67,7 +68,7 @@ const checkTokenNew = async (ctx) => {
...
@@ -67,7 +68,7 @@ const checkTokenNew = async (ctx) => {
const
{
token
}
=
ctx
.
request
.
query
const
{
token
}
=
ctx
.
request
.
query
const
info
=
await
ctx
.
redisGet
(
config
.
QA_TOKEN
,
token
)
const
info
=
await
ctx
.
redisGet
(
config
.
QA_TOKEN
,
token
)
if
(
info
)
{
if
(
info
)
{
const
role
=
admin
.
includes
(
info
.
SAMACCOUNTNAME
)
?
[
'
admin
'
]
:
[
'
user
'
]
const
role
=
admin
.
includes
(
info
.
SAMACCOUNTNAME
||
info
.
sAMAccountName
)
?
[
'
admin
'
]
:
[
'
user
'
]
if
(
info
.
title
&&
info
.
title
.
indexOf
(
'
测试
'
)
!==
-
1
)
{
if
(
info
.
title
&&
info
.
title
.
indexOf
(
'
测试
'
)
!==
-
1
)
{
role
.
push
(
'
test
'
)
role
.
push
(
'
test
'
)
...
...
app/service/repoServiceNew.js
View file @
4072761e
...
@@ -53,7 +53,6 @@ async function getRepoOfNs(ctx, ns) {
...
@@ -53,7 +53,6 @@ async function getRepoOfNs(ctx, ns) {
// 把tag信息拉平到appname上
// 把tag信息拉平到appname上
const
m
=
[]
const
m
=
[]
console
.
log
(
1
,
repos
)
repos
.
forEach
((
item
)
=>
{
repos
.
forEach
((
item
)
=>
{
const
tags
=
item
.
tags
||
[
LASTEST
]
const
tags
=
item
.
tags
||
[
LASTEST
]
tags
.
forEach
((
tag
)
=>
{
tags
.
forEach
((
tag
)
=>
{
...
...
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