Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
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
sunyihao
bkunyun
Commits
1d039edc
Commit
1d039edc
authored
Jun 16, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 项目基础信息编辑权限逻辑修改
parent
90d3c40d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+14
-1
No files found.
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
1d039edc
...
...
@@ -50,6 +50,19 @@ const BaseInfo = observer(() => {
const
currentUserName
=
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
)
||
"{}"
).
name
;
const
hasEditAuth
=
useMemo
(()
=>
{
if
(
!
currentUserName
)
{
return
false
;
}
else
if
(
!
projectInfo
.
members
)
{
return
false
;
}
else
{
return
projectInfo
.
members
.
some
((
item
:
any
)
=>
{
return
(
item
.
username
===
currentUserName
&&
item
.
projectRole
===
"OWNER"
);
});
}
},
[
currentUserName
,
projectInfo
]);
const
{
run
,
loading
}
=
useMyRequest
(
getProject
,
{
onSuccess
:
(
result
:
any
)
=>
{
setProjectInfo
(
result
.
data
);
...
...
@@ -236,7 +249,7 @@ const BaseInfo = observer(() => {
<
Loading
/>
</
div
>
);
}
else
if
(
currentUserName
!==
projectInfo
.
owner
)
{
}
else
if
(
!
hasEditAuth
)
{
return
<
InformationDisplay
infoList=
{
infoList
}
/>;
}
else
{
return
(
...
...
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