Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
8c121c39
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8c121c39
编写于
2月 24, 2020
作者:
S
shiziyuan9527
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
组织成员管理
上级
807135e7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
37 deletion
+32
-37
backend/src/main/java/io/metersphere/controller/UserController.java
...c/main/java/io/metersphere/controller/UserController.java
+2
-1
frontend/src/performance/components/HeaderTopMenus.vue
frontend/src/performance/components/HeaderTopMenus.vue
+3
-1
frontend/src/performance/components/HeaderUser.vue
frontend/src/performance/components/HeaderUser.vue
+5
-2
frontend/src/performance/components/settings/OrganizationMember.vue
...rc/performance/components/settings/OrganizationMember.vue
+22
-33
未找到文件。
backend/src/main/java/io/metersphere/controller/UserController.java
浏览文件 @
8c121c39
...
@@ -62,9 +62,10 @@ public class UserController {
...
@@ -62,9 +62,10 @@ public class UserController {
}
}
@PostMapping
(
"/switch/source/{sourceId}"
)
@PostMapping
(
"/switch/source/{sourceId}"
)
public
void
switchUserRole
(
@PathVariable
(
value
=
"sourceId"
)
String
sourceId
)
{
public
UserDTO
switchUserRole
(
@PathVariable
(
value
=
"sourceId"
)
String
sourceId
)
{
UserDTO
user
=
SessionUtils
.
getUser
();
UserDTO
user
=
SessionUtils
.
getUser
();
userService
.
switchUserRole
(
user
,
sourceId
);
userService
.
switchUserRole
(
user
,
sourceId
);
return
SessionUtils
.
getUser
();
}
}
@GetMapping
(
"/info/{userId}"
)
@GetMapping
(
"/info/{userId}"
)
...
...
frontend/src/performance/components/HeaderTopMenus.vue
浏览文件 @
8c121c39
...
@@ -32,7 +32,9 @@
...
@@ -32,7 +32,9 @@
}
}
},
},
mounted
()
{
mounted
()
{
this
.
activeIndex
=
this
.
$route
.
matched
[
0
].
path
||
'
/
'
if
(
this
.
$route
.
matched
.
length
>
0
)
{
this
.
activeIndex
=
this
.
$route
.
matched
[
0
].
path
;
}
},
},
methods
:
{
methods
:
{
handleSelect
(
index
)
{
handleSelect
(
index
)
{
...
...
frontend/src/performance/components/HeaderUser.vue
浏览文件 @
8c121c39
...
@@ -124,8 +124,11 @@
...
@@ -124,8 +124,11 @@
let
user
=
{};
let
user
=
{};
user
.
id
=
this
.
currentUserInfo
.
id
;
user
.
id
=
this
.
currentUserInfo
.
id
;
user
.
lastSourceId
=
data
.
id
;
user
.
lastSourceId
=
data
.
id
;
this
.
$post
(
"
/user/switch/source/
"
+
user
.
lastSourceId
,
{});
this
.
$post
(
"
/user/switch/source/
"
+
user
.
lastSourceId
,
{},
response
=>
{
window
.
location
.
reload
();
Cookies
.
set
(
TokenKey
,
response
.
data
);
window
.
location
.
reload
();
})
}
}
}
}
}
}
...
...
frontend/src/performance/components/settings/OrganizationMember.vue
浏览文件 @
8c121c39
...
@@ -63,6 +63,8 @@
...
@@ -63,6 +63,8 @@
<
script
>
<
script
>
import
MsCreateBox
from
"
./CreateBox
"
;
import
MsCreateBox
from
"
./CreateBox
"
;
import
Cookies
from
'
js-cookie
'
;
import
{
TokenKey
}
from
"
../../../common/constants
"
;
export
default
{
export
default
{
name
:
"
OrganizationMember
"
,
name
:
"
OrganizationMember
"
,
components
:
{
MsCreateBox
},
components
:
{
MsCreateBox
},
...
@@ -84,19 +86,24 @@
...
@@ -84,19 +86,24 @@
]
]
},
},
multipleSelection
:
[],
multipleSelection
:
[],
currentOrganizationId
:
"
d2f49498-3333-4872-ab98-59174d4a81da
"
,
currentOrganizationId
:
JSON
.
parse
(
Cookies
.
get
(
TokenKey
)).
organizationId
,
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
5
,
pageSize
:
5
,
total
:
0
total
:
0
,
}
}
},
},
methods
:
{
methods
:
{
currentUser
:
()
=>
{
let
user
=
Cookies
.
get
(
TokenKey
);
window
.
console
.
log
(
user
);
return
JSON
.
parse
(
user
);
},
initTableData
()
{
initTableData
()
{
let
param
=
{
let
param
=
{
name
:
this
.
condition
,
name
:
this
.
condition
,
organizationId
:
this
.
currentOrganizationId
organizationId
:
this
.
currentUser
().
organizationId
// organizationId: this.currentOrganizationId
};
};
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
this
.
queryPath
),
param
,
response
=>
{
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
this
.
queryPath
),
param
,
response
=>
{
let
data
=
response
.
data
;
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
this
.
total
=
data
.
itemCount
;
...
@@ -116,22 +123,19 @@
...
@@ -116,22 +123,19 @@
this
.
currentPage
=
current
;
this
.
currentPage
=
current
;
},
},
del
(
row
)
{
del
(
row
)
{
this
.
$confirm
(
'
移除该成员, 是否继续?
'
,
'
提示
'
,
{
this
.
$confirm
(
'
是否删除用户
'
+
row
.
name
+
'
?
'
,
'
'
,
{
confirmButtonText
:
'
确定
'
,
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
loading
=
true
;
this
.
result
=
this
.
$get
(
'
/user/orgmember/delete/
'
+
this
.
currentOrganizationId
+
'
/
'
+
row
.
id
,
()
=>
{
this
.
$get
(
'
/user/member/delete/
'
+
this
.
currentWorkspaceId
+
'
/
'
+
row
.
id
).
then
(()
=>
{
this
.
$message
({
type
:
'
success
'
,
message
:
'
删除成功!
'
});
this
.
initTableData
();
this
.
initTableData
();
this
.
loading
=
false
;
});
this
.
$message
({
type
:
'
success
'
,
message
:
'
删除成功!
'
});
});
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
$message
({
this
.
$message
({
type
:
'
info
'
,
type
:
'
info
'
,
message
:
'
已取消删除
'
message
:
'
已取消删除
'
...
@@ -139,22 +143,10 @@
...
@@ -139,22 +143,10 @@
});
});
},
},
create
()
{
create
()
{
this
.
loading
=
true
;
this
.
result
=
this
.
$get
(
'
/user/list
'
,
response
=>
{
this
.
$get
(
'
/user/list
'
).
then
(
response
=>
{
if
(
response
.
data
.
success
)
{
this
.
createVisible
=
true
;
this
.
createVisible
=
true
;
this
.
form
=
{
userList
:
response
.
data
.
data
};
this
.
form
=
{
userList
:
response
.
data
};
}
else
{
})
this
.
$message
.
error
(
response
.
message
);
}
this
.
loading
=
false
;
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
$message
({
type
:
'
error
'
,
message
:
'
获取用户列表失败
'
});
});
},
},
submitForm
(
formName
)
{
submitForm
(
formName
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -162,14 +154,11 @@
...
@@ -162,14 +154,11 @@
if
(
valid
)
{
if
(
valid
)
{
let
param
=
{
let
param
=
{
userIds
:
this
.
form
.
userIds
,
userIds
:
this
.
form
.
userIds
,
workspaceId
:
this
.
currentWorkspace
Id
organizationId
:
this
.
currentOrganization
Id
};
};
this
.
$post
(
"
user/member/add
"
,
param
).
then
(
()
=>
{
this
.
result
=
this
.
$post
(
"
user/orgmember/add
"
,
param
,
()
=>
{
this
.
initTableData
();
this
.
initTableData
();
this
.
createVisible
=
false
;
this
.
createVisible
=
false
;
this
.
loading
=
false
;
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
})
}
else
{
}
else
{
return
false
;
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录