Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
52c97ca6
Commit
52c97ca6
authored
Sep 18, 2025
by
weiw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:同步内外网代码
parent
b918f01c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
src/App.tsx
+4
-1
src/auth/AuthContext.tsx
+1
-1
src/utils/object.ts
+3
-3
src/utils/string.ts
+1
-1
No files found.
src/App.tsx
View file @
52c97ca6
...
...
@@ -8,12 +8,15 @@ import { AuthProvider } from './auth/AuthContext'
import
ToastWrapper
from
'./components/ToastWrapper/ToastWrapper'
import
{
store
}
from
'./store'
const
viteOutputObj
=
import
.
meta
.
env
.
VITE_OUTPUT_OBJ
||
'open'
const
basename
=
viteOutputObj
===
'inner'
?
'/sdream-fe'
:
'/sdream-ai'
const
App
:
React
.
FC
=
()
=>
{
return
(
<
Provider
store=
{
store
}
>
<
ToastWrapper
>
<
AuthProvider
>
<
Router
basename=
"/sdream-ai"
>
<
Router
basename=
{
basename
}
>
<
MainLayout
>
<
AppRoutes
/>
</
MainLayout
>
...
...
src/auth/AuthContext.tsx
View file @
52c97ca6
...
...
@@ -93,7 +93,7 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
// eslint-disable-next-line react-refresh/only-export-components
export
function
useAuth
():
AuthContextType
{
const
context
=
useContext
(
AuthContext
)
if
(
context
===
undefined
)
{
if
(
context
===
null
)
{
throw
new
Error
(
'useAuth must be used within an AuthProvider'
)
}
return
context
...
...
src/utils/object.ts
View file @
52c97ca6
...
...
@@ -81,7 +81,7 @@ export function deepMerge<T extends object = object, S extends object = T>(targe
return
target
as
any
const
source
=
sources
.
shift
()
if
(
source
===
undefined
)
if
(
source
===
null
)
return
target
as
any
if
(
isMergableObject
(
target
)
&&
isMergableObject
(
source
))
{
...
...
@@ -131,7 +131,7 @@ export function deepMergeWithArray<T extends object = object, S extends object =
return
target
as
any
const
source
=
sources
.
shift
()
if
(
source
===
undefined
)
if
(
source
===
null
)
return
target
as
any
if
(
Array
.
isArray
(
target
)
&&
Array
.
isArray
(
source
))
...
...
@@ -198,7 +198,7 @@ export function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[
*/
export
function
clearUndefined
<
T
extends
object
>
(
obj
:
T
):
T
{
// @ts-expect-error
Object
.
keys
(
obj
).
forEach
((
key
:
string
)
=>
(
obj
[
key
]
===
undefined
?
delete
obj
[
key
]
:
{}))
Object
.
keys
(
obj
).
forEach
((
key
:
string
)
=>
(
obj
[
key
]
===
null
?
delete
obj
[
key
]
:
{}))
return
obj
}
...
...
src/utils/string.ts
View file @
52c97ca6
...
...
@@ -130,7 +130,7 @@ export function unindent(str: TemplateStringsArray | string) {
if
(
whitespaceLines
[
idx
])
return
min
const
indent
=
line
.
match
(
/^
\s
*/
)?.[
0
].
length
return
indent
===
undefined
?
min
:
Math
.
min
(
min
,
indent
)
return
indent
===
null
?
min
:
Math
.
min
(
min
,
indent
)
},
Number
.
POSITIVE_INFINITY
)
let
emptyLinesHead
=
0
...
...
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