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
f735255c
Commit
f735255c
authored
Jul 13, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:部署后测试环境引入sdk设置
parent
476172cd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
24 deletions
+19
-24
.gitignore
+2
-1
rsbuild.config.minimal.ts
+5
-3
rsbuild.config.ts
+9
-17
src/App.tsx
+1
-2
src/index.tsx
+2
-1
No files found.
.gitignore
View file @
f735255c
...
@@ -71,7 +71,8 @@ typings/
...
@@ -71,7 +71,8 @@ typings/
# Nuxt generate
# Nuxt generate
dist
dist
sdream-ai
sdream-fe
src/sdk/
# Serverless directories
# Serverless directories
.serverless
.serverless
...
...
rsbuild.config.minimal.ts
View file @
f735255c
...
@@ -3,6 +3,8 @@ import { pluginReact } from '@rsbuild/plugin-react'
...
@@ -3,6 +3,8 @@ import { pluginReact } from '@rsbuild/plugin-react'
import
{
pluginLess
}
from
'@rsbuild/plugin-less'
import
{
pluginLess
}
from
'@rsbuild/plugin-less'
import
{
pluginSvgr
}
from
'@rsbuild/plugin-svgr'
import
{
pluginSvgr
}
from
'@rsbuild/plugin-svgr'
const
basename
=
'/sdream-fe'
export
default
defineConfig
({
export
default
defineConfig
({
plugins
:
[
plugins
:
[
pluginReact
(),
pluginReact
(),
...
@@ -10,7 +12,7 @@ export default defineConfig({
...
@@ -10,7 +12,7 @@ export default defineConfig({
pluginSvgr
(),
pluginSvgr
(),
],
],
dev
:
{
dev
:
{
assetPrefix
:
'/sdream-ai'
,
assetPrefix
:
basename
,
},
},
html
:
{
html
:
{
title
:
'晓得. - 晓得解惑,让沟通更智能。'
,
title
:
'晓得. - 晓得解惑,让沟通更智能。'
,
...
@@ -18,9 +20,9 @@ export default defineConfig({
...
@@ -18,9 +20,9 @@ export default defineConfig({
},
},
output
:
{
output
:
{
target
:
'web'
,
target
:
'web'
,
assetPrefix
:
'/sdream-ai'
,
assetPrefix
:
basename
,
distPath
:
{
distPath
:
{
root
:
'sdream-ai'
,
root
:
basename
.
slice
(
1
)
,
image
:
'assets'
,
image
:
'assets'
,
svg
:
'assets'
,
svg
:
'assets'
,
font
:
'assets'
,
font
:
'assets'
,
...
...
rsbuild.config.ts
View file @
f735255c
...
@@ -13,6 +13,8 @@ const sdkChannel = envConf[mode].sdkChannel || ''
...
@@ -13,6 +13,8 @@ const sdkChannel = envConf[mode].sdkChannel || ''
const
sdkMock
=
envConf
[
mode
].
sdkMock
||
false
const
sdkMock
=
envConf
[
mode
].
sdkMock
||
false
const
sdkApiBaseUrl
=
envConf
[
mode
].
sdkApiBaseUrl
||
''
const
sdkApiBaseUrl
=
envConf
[
mode
].
sdkApiBaseUrl
||
''
const
basename
=
'/sdream-fe'
// 处理 VITE_ 前缀的环境变量
// 处理 VITE_ 前缀的环境变量
const
viteEnvVars
:
Record
<
string
,
string
>
=
{}
const
viteEnvVars
:
Record
<
string
,
string
>
=
{}
Object
.
keys
(
process
.
env
).
forEach
((
key
)
=>
{
Object
.
keys
(
process
.
env
).
forEach
((
key
)
=>
{
...
@@ -21,19 +23,6 @@ Object.keys(process.env).forEach((key) => {
...
@@ -21,19 +23,6 @@ Object.keys(process.env).forEach((key) => {
}
}
})
})
// 根据 VITE_OUTPUT_OBJ 设置不同的 title 和 favicon
let
htmlConfig
=
{
title
:
'晓得. - 晓得解惑,让沟通更智能。'
,
favicon
:
'./src/assets/logo.png'
,
}
if
(
process
.
env
.
VITE_OUTPUT_OBJ
===
'inner'
)
{
htmlConfig
=
{
title
:
'建信消金AI智能问答'
,
favicon
:
''
,
}
}
export
default
defineConfig
({
export
default
defineConfig
({
plugins
:
[
plugins
:
[
pluginReact
(),
pluginReact
(),
...
@@ -41,14 +30,17 @@ export default defineConfig({
...
@@ -41,14 +30,17 @@ export default defineConfig({
pluginSvgr
(),
pluginSvgr
(),
],
],
dev
:
{
dev
:
{
assetPrefix
:
'/sdream-ai'
,
assetPrefix
:
basename
,
},
html
:
{
title
:
'晓得. - 晓得解惑,让沟通更智能。'
,
favicon
:
'./src/assets/logo.png'
,
},
},
html
:
htmlConfig
,
output
:
{
output
:
{
target
:
'web'
,
target
:
'web'
,
assetPrefix
:
'/sdream-ai'
,
assetPrefix
:
basename
,
distPath
:
{
distPath
:
{
root
:
'sdream-ai'
,
root
:
basename
.
slice
(
1
)
,
image
:
'assets'
,
image
:
'assets'
,
svg
:
'assets'
,
svg
:
'assets'
,
font
:
'assets'
,
font
:
'assets'
,
...
...
src/App.tsx
View file @
f735255c
...
@@ -8,8 +8,7 @@ import { AuthProvider } from './auth/AuthContext'
...
@@ -8,8 +8,7 @@ import { AuthProvider } from './auth/AuthContext'
import
ToastWrapper
from
'./components/ToastWrapper/ToastWrapper'
import
ToastWrapper
from
'./components/ToastWrapper/ToastWrapper'
import
{
store
}
from
'./store'
import
{
store
}
from
'./store'
const
viteOutputObj
=
import
.
meta
.
env
.
VITE_OUTPUT_OBJ
||
'open'
const
basename
=
'/sdream-fe'
const
basename
=
viteOutputObj
===
'inner'
?
'/sdream-fe'
:
'/sdream-ai'
const
App
:
React
.
FC
=
()
=>
{
const
App
:
React
.
FC
=
()
=>
{
return
(
return
(
...
...
src/index.tsx
View file @
f735255c
...
@@ -68,7 +68,8 @@ async function loadSDK(): Promise<void> {
...
@@ -68,7 +68,8 @@ async function loadSDK(): Promise<void> {
}
}
const
script
=
document
.
createElement
(
'script'
)
const
script
=
document
.
createElement
(
'script'
)
script
.
src
=
'/sdream-ai/sdk/index.js'
const
basename
=
'/sdream-fe'
script
.
src
=
`
${
basename
}
/sdk/index.js`
script
.
type
=
'text/javascript'
script
.
type
=
'text/javascript'
script
.
onload
=
()
=>
{
script
.
onload
=
()
=>
{
if
(
checkAndInitSDK
())
{
if
(
checkAndInitSDK
())
{
...
...
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