Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
71195722
提交
71195722
authored
3月 03, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 调整response返回值
上级
60d01465
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
37 行增加
和
27 行删除
+37
-27
MsDialogFooter.vue
...tend/src/metersphere/common/components/MsDialogFooter.vue
+4
-1
permission.js
frontend/src/permission.js
+2
-2
user.js
frontend/src/store/modules/user.js
+2
-2
request.js
frontend/src/utils/request.js
+1
-1
DatasetTableData.vue
frontend/src/views/dataset/common/DatasetTableData.vue
+1
-0
Group.vue
frontend/src/views/dataset/group/Group.vue
+3
-3
index.vue
frontend/src/views/system/datasource/index.vue
+1
-1
index.vue
frontend/src/views/system/dept/index.vue
+12
-6
index.vue
frontend/src/views/system/menu/index.vue
+3
-3
index.vue
frontend/src/views/system/role/index.vue
+3
-3
index.vue
frontend/src/views/system/user/index.vue
+4
-4
index_back.vue
frontend/src/views/system/user/index_back.vue
+1
-1
没有找到文件。
frontend/src/metersphere/common/components/MsDialogFooter.vue
浏览文件 @
71195722
...
@@ -25,7 +25,10 @@ export default {
...
@@ -25,7 +25,10 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
title
:
String
title
:
{
type
:
String
,
default
:
null
}
},
},
methods
:
{
methods
:
{
cancel
()
{
cancel
()
{
...
...
frontend/src/permission.js
浏览文件 @
71195722
...
@@ -37,7 +37,7 @@ router.beforeEach(async(to, from, next) => {
...
@@ -37,7 +37,7 @@ router.beforeEach(async(to, from, next) => {
store
.
dispatch
(
'user/getInfo'
).
then
(()
=>
{
store
.
dispatch
(
'user/getInfo'
).
then
(()
=>
{
loadMenus
(
next
,
to
)
loadMenus
(
next
,
to
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
store
.
dispatch
(
'logout'
).
then
(()
=>
{
store
.
dispatch
(
'
user/
logout'
).
then
(()
=>
{
location
.
reload
()
// 为了重新实例化vue-router对象 避免bug
location
.
reload
()
// 为了重新实例化vue-router对象 避免bug
})
})
})
})
...
@@ -65,7 +65,7 @@ router.beforeEach(async(to, from, next) => {
...
@@ -65,7 +65,7 @@ router.beforeEach(async(to, from, next) => {
})
})
export
const
loadMenus
=
(
next
,
to
)
=>
{
export
const
loadMenus
=
(
next
,
to
)
=>
{
buildMenus
().
then
(
res
=>
{
buildMenus
().
then
(
res
=>
{
const
asyncRouter
=
filterAsyncRouter
(
res
.
data
.
data
)
const
asyncRouter
=
filterAsyncRouter
(
res
.
data
)
asyncRouter
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
})
asyncRouter
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
})
store
.
dispatch
(
'permission/GenerateRoutes'
,
asyncRouter
).
then
(()
=>
{
// 存储路由
store
.
dispatch
(
'permission/GenerateRoutes'
,
asyncRouter
).
then
(()
=>
{
// 存储路由
router
.
addRoutes
(
asyncRouter
)
router
.
addRoutes
(
asyncRouter
)
...
...
frontend/src/store/modules/user.js
浏览文件 @
71195722
...
@@ -46,7 +46,7 @@ const actions = {
...
@@ -46,7 +46,7 @@ const actions = {
const
{
username
,
password
}
=
userInfo
const
{
username
,
password
}
=
userInfo
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
login
({
username
:
username
.
trim
(),
password
:
password
}).
then
(
response
=>
{
login
({
username
:
username
.
trim
(),
password
:
password
}).
then
(
response
=>
{
const
{
data
}
=
response
.
data
const
{
data
}
=
response
commit
(
'SET_TOKEN'
,
data
.
token
)
commit
(
'SET_TOKEN'
,
data
.
token
)
setToken
(
data
.
token
)
setToken
(
data
.
token
)
resolve
()
resolve
()
...
@@ -60,7 +60,7 @@ const actions = {
...
@@ -60,7 +60,7 @@ const actions = {
getInfo
({
commit
,
state
})
{
getInfo
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getInfo
(
state
.
token
).
then
(
response
=>
{
getInfo
(
state
.
token
).
then
(
response
=>
{
const
{
data
}
=
response
.
data
const
{
data
}
=
response
if
(
!
data
)
{
if
(
!
data
)
{
reject
(
'Verification failed, please Login again.'
)
reject
(
'Verification failed, please Login again.'
)
...
...
frontend/src/utils/request.js
浏览文件 @
71195722
...
@@ -98,7 +98,7 @@ service.interceptors.response.use(
...
@@ -98,7 +98,7 @@ service.interceptors.response.use(
// 请根据实际需求修改
// 请根据实际需求修改
service
.
interceptors
.
response
.
use
(
response
=>
{
service
.
interceptors
.
response
.
use
(
response
=>
{
checkAuth
(
response
)
checkAuth
(
response
)
return
response
return
response
.
data
},
error
=>
{
},
error
=>
{
let
msg
let
msg
if
(
error
.
response
)
{
if
(
error
.
response
)
{
...
...
frontend/src/views/dataset/common/DatasetTableData.vue
浏览文件 @
71195722
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
export
default
{
export
default
{
name
:
'DatasetTableData'
,
name
:
'DatasetTableData'
,
props
:
{
props
:
{
// eslint-disable-next-line vue/require-default-prop
table
:
Object
table
:
Object
},
},
data
()
{
data
()
{
...
...
frontend/src/views/dataset/group/Group.vue
浏览文件 @
71195722
...
@@ -462,7 +462,7 @@ export default {
...
@@ -462,7 +462,7 @@ export default {
tree
(
group
)
{
tree
(
group
)
{
groupTree
(
group
).
then
(
res
=>
{
groupTree
(
group
).
then
(
res
=>
{
this
.
tData
=
res
.
data
.
data
this
.
tData
=
res
.
data
})
})
},
},
...
@@ -473,7 +473,7 @@ export default {
...
@@ -473,7 +473,7 @@ export default {
sort
:
'type asc,create_time desc,name asc'
,
sort
:
'type asc,create_time desc,name asc'
,
sceneId
:
this
.
currGroup
.
id
sceneId
:
this
.
currGroup
.
id
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
tableData
=
res
.
data
.
data
this
.
tableData
=
res
.
data
})
})
}
}
},
},
...
@@ -555,7 +555,7 @@ export default {
...
@@ -555,7 +555,7 @@ export default {
this
.
sceneMode
=
true
this
.
sceneMode
=
true
const
sceneId
=
this
.
$store
.
state
.
dataset
.
sceneData
const
sceneId
=
this
.
$store
.
state
.
dataset
.
sceneData
getScene
(
sceneId
).
then
(
res
=>
{
getScene
(
sceneId
).
then
(
res
=>
{
this
.
currGroup
=
res
.
data
.
data
this
.
currGroup
=
res
.
data
})
})
}
else
{
}
else
{
this
.
$router
.
push
(
'/dataset'
)
this
.
$router
.
push
(
'/dataset'
)
...
...
frontend/src/views/system/datasource/index.vue
浏览文件 @
71195722
...
@@ -361,7 +361,7 @@ export default {
...
@@ -361,7 +361,7 @@ export default {
},
},
initTableData
()
{
initTableData
()
{
dsGrid
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
dsGrid
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
const
data
=
response
.
data
.
data
const
data
=
response
.
data
this
.
tableData
=
data
.
listObject
this
.
tableData
=
data
.
listObject
this
.
total
=
data
.
itemCount
this
.
total
=
data
.
itemCount
})
})
...
...
frontend/src/views/system/dept/index.vue
浏览文件 @
71195722
...
@@ -218,7 +218,9 @@ export default {
...
@@ -218,7 +218,9 @@ export default {
treeByArr
(
arr
)
{
treeByArr
(
arr
)
{
if
(
!
Array
.
isArray
(
arr
)
||
!
arr
.
length
)
return
if
(
!
Array
.
isArray
(
arr
)
||
!
arr
.
length
)
return
const
map
=
{}
const
map
=
{}
arr
.
forEach
(
item
=>
map
[
item
.
id
]
=
item
)
arr
.
forEach
(
item
=>
{
map
[
item
.
id
]
=
item
})
const
roots
=
[]
const
roots
=
[]
arr
.
forEach
(
item
=>
{
arr
.
forEach
(
item
=>
{
...
@@ -236,7 +238,7 @@ export default {
...
@@ -236,7 +238,7 @@ export default {
const
_self
=
this
const
_self
=
this
const
pid
=
row
?
row
.
deptId
:
'0'
const
pid
=
row
?
row
.
deptId
:
'0'
getDeptTree
(
pid
).
then
(
response
=>
{
getDeptTree
(
pid
).
then
(
response
=>
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
data
=
data
.
map
(
obj
=>
{
data
=
data
.
map
(
obj
=>
{
if
(
obj
.
subCount
>
0
)
{
if
(
obj
.
subCount
>
0
)
{
obj
.
hasChildren
=
true
obj
.
hasChildren
=
true
...
@@ -244,7 +246,9 @@ export default {
...
@@ -244,7 +246,9 @@ export default {
return
obj
return
obj
})
})
if
(
!
row
)
{
if
(
!
row
)
{
data
.
some
(
node
=>
node
.
children
=
null
)
data
.
some
(
node
=>
{
node
.
children
=
null
})
_self
.
tableData
=
data
_self
.
tableData
=
data
_self
.
depts
=
null
_self
.
depts
=
null
}
else
{
}
else
{
...
@@ -267,7 +271,7 @@ export default {
...
@@ -267,7 +271,7 @@ export default {
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
!
this
.
depts
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
!
this
.
depts
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
_self
.
depts
=
res
.
data
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
_self
.
depts
=
res
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
callback
()
callback
()
})
})
}
}
...
@@ -275,7 +279,7 @@ export default {
...
@@ -275,7 +279,7 @@ export default {
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
data
.
map
(
function
(
obj
)
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
return
_self
.
normalizer
(
obj
)
})
})
callback
()
callback
()
...
@@ -375,7 +379,9 @@ export default {
...
@@ -375,7 +379,9 @@ export default {
array2Tree
(
arr
)
{
array2Tree
(
arr
)
{
if
(
!
Array
.
isArray
(
arr
)
||
!
arr
.
length
)
return
if
(
!
Array
.
isArray
(
arr
)
||
!
arr
.
length
)
return
const
map
=
{}
const
map
=
{}
arr
.
forEach
(
item
=>
map
[
item
.
id
]
=
item
)
arr
.
forEach
(
item
=>
{
map
[
item
.
id
]
=
item
})
const
roots
=
[]
const
roots
=
[]
arr
.
forEach
(
item
=>
{
arr
.
forEach
(
item
=>
{
...
...
frontend/src/views/system/menu/index.vue
浏览文件 @
71195722
...
@@ -284,7 +284,7 @@ export default {
...
@@ -284,7 +284,7 @@ export default {
const
pid
=
row
?
row
.
menuId
:
'0'
const
pid
=
row
?
row
.
menuId
:
'0'
getMenusTree
(
pid
).
then
(
response
=>
{
getMenusTree
(
pid
).
then
(
response
=>
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
data
=
data
.
map
(
obj
=>
{
data
=
data
.
map
(
obj
=>
{
if
(
obj
.
subCount
>
0
)
{
if
(
obj
.
subCount
>
0
)
{
obj
.
hasChildren
=
true
obj
.
hasChildren
=
true
...
@@ -316,7 +316,7 @@ export default {
...
@@ -316,7 +316,7 @@ export default {
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
!
this
.
menus
&&
getMenusTree
(
'0'
).
then
(
res
=>
{
!
this
.
menus
&&
getMenusTree
(
'0'
).
then
(
res
=>
{
_self
.
menus
=
res
.
data
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
_self
.
menus
=
res
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
callback
()
callback
()
})
})
}
}
...
@@ -324,7 +324,7 @@ export default {
...
@@ -324,7 +324,7 @@ export default {
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
getMenusTree
(
parentNode
.
id
).
then
(
res
=>
{
getMenusTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
data
.
map
(
function
(
obj
)
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
return
_self
.
normalizer
(
obj
)
})
})
callback
()
callback
()
...
...
frontend/src/views/system/role/index.vue
浏览文件 @
71195722
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
},
},
search
()
{
search
()
{
roleGrid
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
roleGrid
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
const
data
=
response
.
data
.
data
const
data
=
response
.
data
this
.
total
=
data
.
itemCount
this
.
total
=
data
.
itemCount
this
.
tableData
=
data
.
listObject
this
.
tableData
=
data
.
listObject
})
})
...
@@ -178,7 +178,7 @@ export default {
...
@@ -178,7 +178,7 @@ export default {
getMenuDatas
(
node
,
resolve
)
{
getMenuDatas
(
node
,
resolve
)
{
const
pid
=
node
.
data
.
id
?
node
.
data
.
id
:
'0'
const
pid
=
node
.
data
.
id
?
node
.
data
.
id
:
'0'
getMenusTree
(
pid
).
then
(
res
=>
{
getMenusTree
(
pid
).
then
(
res
=>
{
const
datas
=
res
.
data
.
data
const
datas
=
res
.
data
const
nodes
=
datas
.
map
(
data
=>
this
.
formatNode
(
data
))
const
nodes
=
datas
.
map
(
data
=>
this
.
formatNode
(
data
))
resolve
&&
resolve
(
nodes
)
resolve
&&
resolve
(
nodes
)
})
})
...
@@ -194,7 +194,7 @@ export default {
...
@@ -194,7 +194,7 @@ export default {
},
},
menuChange
(
menu
)
{
menuChange
(
menu
)
{
getChild
(
menu
.
id
).
then
(
res
=>
{
getChild
(
menu
.
id
).
then
(
res
=>
{
const
childIds
=
res
.
data
.
data
const
childIds
=
res
.
data
if
(
this
.
menuIds
.
indexOf
(
menu
.
id
)
!==
-
1
)
{
if
(
this
.
menuIds
.
indexOf
(
menu
.
id
)
!==
-
1
)
{
for
(
let
i
=
0
;
i
<
childIds
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
childIds
.
length
;
i
++
)
{
const
index
=
this
.
menuIds
.
indexOf
(
childIds
[
i
])
const
index
=
this
.
menuIds
.
indexOf
(
childIds
[
i
])
...
...
frontend/src/views/system/user/index.vue
浏览文件 @
71195722
...
@@ -346,7 +346,7 @@ export default {
...
@@ -346,7 +346,7 @@ export default {
},
},
search
()
{
search
()
{
userLists
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
userLists
(
this
.
currentPage
,
this
.
pageSize
,
this
.
condition
).
then
(
response
=>
{
const
data
=
response
.
data
.
data
const
data
=
response
.
data
this
.
total
=
data
.
itemCount
this
.
total
=
data
.
itemCount
this
.
tableData
=
data
.
listObject
this
.
tableData
=
data
.
listObject
})
})
...
@@ -380,7 +380,7 @@ export default {
...
@@ -380,7 +380,7 @@ export default {
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
!
this
.
depts
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
!
this
.
depts
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
_self
.
depts
=
res
.
data
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
_self
.
depts
=
res
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
callback
()
callback
()
})
})
}
}
...
@@ -388,7 +388,7 @@ export default {
...
@@ -388,7 +388,7 @@ export default {
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
const
_self
=
this
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
data
.
map
(
function
(
obj
)
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
return
_self
.
normalizer
(
obj
)
})
})
callback
()
callback
()
...
@@ -421,7 +421,7 @@ export default {
...
@@ -421,7 +421,7 @@ export default {
},
},
allRoles
()
{
allRoles
()
{
allRoles
().
then
(
res
=>
{
allRoles
().
then
(
res
=>
{
this
.
roles
=
res
.
data
.
data
this
.
roles
=
res
.
data
})
})
}
}
...
...
frontend/src/views/system/user/index_back.vue
浏览文件 @
71195722
...
@@ -106,7 +106,7 @@ export default {
...
@@ -106,7 +106,7 @@ export default {
const
{
currentPage
,
pageSize
}
=
this
.
paginationConfig
const
{
currentPage
,
pageSize
}
=
this
.
paginationConfig
userLists
(
currentPage
,
pageSize
,
{}).
then
(
response
=>
{
userLists
(
currentPage
,
pageSize
,
{}).
then
(
response
=>
{
this
.
data
=
response
.
data
.
data
.
listObject
this
.
data
=
response
.
data
.
data
.
listObject
this
.
paginationConfig
.
total
=
response
.
data
.
data
.
itemCount
this
.
paginationConfig
.
total
=
response
.
data
.
itemCount
})
})
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论