Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-kanban
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
ximai
mes-kanban
Commits
96011e8a
Commit
96011e8a
authored
Nov 16, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改pad点不了退出登录的问题
parent
f34a3ca6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
Welcome.less
src/pages/Welcome.less
+2
-1
Welcome.tsx
src/pages/Welcome.tsx
+15
-6
No files found.
src/pages/Welcome.less
View file @
96011e8a
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
margin: 0 300px 0 300px;
margin: 0 300px 0 300px;
padding: 10px 0 0 0;
padding: 10px 0 0 0;
font-weight: 550;
font-weight: 550;
font-size:
6
0px;
font-size:
5
0px;
letter-spacing: 10px;
letter-spacing: 10px;
text-align: center;
text-align: center;
text-shadow: 0 0 6px #9fc4f5, 0 0 6px #9fc4f5;
text-shadow: 0 0 6px #9fc4f5, 0 0 6px #9fc4f5;
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
display: inline-block;
display: inline-block;
border-radius: 5px;
border-radius: 5px;
cursor: pointer;
cursor: pointer;
z-index: 99999;
transition: background-color 0.3s;
transition: background-color 0.3s;
font-size: 20px;
font-size: 20px;
background-color: rgba(255, 255, 255, 0.1);
background-color: rgba(255, 255, 255, 0.1);
...
...
src/pages/Welcome.tsx
View file @
96011e8a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
{
useIntl
,
useModel
}
from
'umi'
;
import
{
useIntl
,
useModel
}
from
'umi'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
styles
from
'./Welcome.less'
;
import
styles
from
'./Welcome.less'
;
...
@@ -25,14 +25,23 @@ const Welcome: React.FC = () => {
...
@@ -25,14 +25,23 @@ const Welcome: React.FC = () => {
const
goToPlaylist
=
(
link
:
string
)
=>
{
const
goToPlaylist
=
(
link
:
string
)
=>
{
history
.
push
(
link
);
history
.
push
(
link
);
};
};
/**
const
tologinOut
=
async
()
=>
{
* 退出登录,并且将当前的 url 保存
*/
const
loginOut
=
async
()
=>
{
setInitialState
((
s
)
=>
({
...
s
,
currentUser
:
undefined
}));
await
outLogin
();
await
outLogin
();
history
.
replace
({
pathname
:
'/user/login'
});
history
.
replace
({
pathname
:
'/user/login'
});
};
};
/**
* 退出登录,并且将当前的 url 保存
*/
const
loginOut
=
useCallback
(()
=>
{
try
{
console
.
log
(
'准备退出登录'
)
setInitialState
((
s
)
=>
({
...
s
,
currentUser
:
undefined
}));
tologinOut
();
console
.
log
(
'准备退出登录1'
)
}
catch
(
e
)
{
console
.
log
(
'退出失败'
,
e
)
}
},
[
setInitialState
]);
return
(
return
(
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
logout
}
onClick=
{
()
=>
loginOut
()
}
>
<
div
className=
{
styles
.
logout
}
onClick=
{
()
=>
loginOut
()
}
>
...
...
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