Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
74267bdf
authored
May 20, 2025
by
Apple\Apple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
️Refactor: OAuth2Callback Page
parent
e5990751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
web/src/components/OAuth2Callback.js
+10
-6
web/src/pages/Home/index.js
+2
-2
No files found.
web/src/components/OAuth2Callback.js
View file @
74267bdf
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
{
Dimmer
,
Loader
,
Segment
}
from
'semantic-ui-react
'
;
import
{
Spin
,
Typography
,
Space
}
from
'@douyinfe/semi-ui
'
;
import
{
useNavigate
,
useSearchParams
}
from
'react-router-dom'
;
import
{
useNavigate
,
useSearchParams
}
from
'react-router-dom'
;
import
{
API
,
showError
,
showSuccess
,
updateAPI
}
from
'../helpers'
;
import
{
API
,
showError
,
showSuccess
,
updateAPI
}
from
'../helpers'
;
import
{
UserContext
}
from
'../context/User'
;
import
{
UserContext
}
from
'../context/User'
;
...
@@ -52,11 +52,15 @@ const OAuth2Callback = (props) => {
...
@@ -52,11 +52,15 @@ const OAuth2Callback = (props) => {
},
[]);
},
[]);
return
(
return
(
<
Segment
style
=
{{
minHeight
:
'300px'
}}
>
<
div
className
=
"flex items-center justify-center min-h-[300px] w-full bg-white rounded-lg shadow p-6"
>
<
Dimmer
active
inverted
>
<
Space
vertical
align
=
"center"
>
<
Loader
size
=
'large'
>
{
prompt
}
<
/Loader
>
<
Spin
size
=
"large"
spinning
=
{
processing
}
>
<
/Dimmer
>
<
div
className
=
"min-h-[200px] min-w-[200px] flex items-center justify-center"
>
<
/Segment
>
<
Typography
.
Text
type
=
"secondary"
>
{
prompt
}
<
/Typography.Text
>
<
/div
>
<
/Spin
>
<
/Space
>
<
/div
>
);
);
};
};
...
...
web/src/pages/Home/index.js
View file @
74267bdf
...
@@ -95,14 +95,14 @@ const Home = () => {
...
@@ -95,14 +95,14 @@ const Home = () => {
{
/* 操作按钮 */
}
{
/* 操作按钮 */
}
<
div
className
=
"mt-6 md:mt-10 flex flex-wrap gap-4 justify-center md:justify-start"
>
<
div
className
=
"mt-6 md:mt-10 flex flex-wrap gap-4 justify-center md:justify-start"
>
<
Link
to
=
"/console"
>
<
Link
to
=
"/console"
>
<
Button
theme
=
"solid"
type
=
"primary"
size
=
"large"
>
<
Button
theme
=
"solid"
type
=
"primary"
size
=
"large"
className
=
"!rounded-3xl"
>
{
t
(
'开始使用'
)}
{
t
(
'开始使用'
)}
<
/Button
>
<
/Button
>
<
/Link
>
<
/Link
>
{
isDemoSiteMode
&&
(
{
isDemoSiteMode
&&
(
<
Button
<
Button
size
=
"large"
size
=
"large"
className
=
"flex items-center"
className
=
"flex items-center
!rounded-3xl
"
icon
=
{
<
IconGithubLogo
/>
}
icon
=
{
<
IconGithubLogo
/>
}
onClick
=
{()
=>
window
.
open
(
'https://github.com/QuantumNous/new-api'
,
'_blank'
)}
onClick
=
{()
=>
window
.
open
(
'https://github.com/QuantumNous/new-api'
,
'_blank'
)}
>
>
...
...
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