Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
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
poc
poc-fe
Commits
1a97ebc4
Commit
1a97ebc4
authored
Oct 09, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: 基础路由路径调整
parent
1bb56c56
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
11 deletions
+19
-11
.env.development
.env.development
+1
-1
.env.production
.env.production
+1
-1
base-url.ts
src/config/base-url.ts
+2
-2
utils.ts
src/router/utils.ts
+4
-2
request.ts
src/utils/request.ts
+4
-1
app-publish.vue
...nal-space/personal-app-setting/components/app-publish.vue
+6
-4
vite.config.ts
vite.config.ts
+1
-0
No files found.
.env.development
View file @
1a97ebc4
...
@@ -4,6 +4,6 @@ VITE_APP_NAME = 'POC'
...
@@ -4,6 +4,6 @@ VITE_APP_NAME = 'POC'
VITE_APP_THEME_COLOR = '#2468f2'
VITE_APP_THEME_COLOR = '#2468f2'
VITE_PORT = 8848
VITE_PORT = 8848
VITE_PUBLIC_PATH = /fe
VITE_PUBLIC_PATH = /fe
VITE_ROUTER_MODE = 'h
ash
'
VITE_ROUTER_MODE = 'h
5
'
VITE_VITEST = true
VITE_VITEST = true
VITE_HIDE_HOME = false
VITE_HIDE_HOME = false
.env.production
View file @
1a97ebc4
...
@@ -3,5 +3,5 @@ VITE_APP_NAME = 'POC'
...
@@ -3,5 +3,5 @@ VITE_APP_NAME = 'POC'
VITE_APP_THEME_COLOR = '#2468f2'
VITE_APP_THEME_COLOR = '#2468f2'
VITE_PUBLIC_PATH = /fe
VITE_PUBLIC_PATH = /fe
VITE_ROUTER_MODE = 'h
ash
'
VITE_ROUTER_MODE = 'h
5
'
src/config/base-url.ts
View file @
1a97ebc4
...
@@ -4,6 +4,6 @@ export const BASE_URLS: Record<'DEV' | 'PROD', string> = {
...
@@ -4,6 +4,6 @@ export const BASE_URLS: Record<'DEV' | 'PROD', string> = {
}
}
export
const
INDEX_URLS
:
Record
<
'DEV'
|
'PROD'
,
string
>
=
{
export
const
INDEX_URLS
:
Record
<
'DEV'
|
'PROD'
,
string
>
=
{
DEV
:
'https://poc-sit.gsstcloud.com/fe
#
/'
,
DEV
:
'https://poc-sit.gsstcloud.com/fe/'
,
PROD
:
'https://poc.gsstcloud.com/fe
#
/'
,
PROD
:
'https://poc.gsstcloud.com/fe/'
,
}
}
src/router/utils.ts
View file @
1a97ebc4
...
@@ -11,11 +11,13 @@ export interface MenuOption {
...
@@ -11,11 +11,13 @@ export interface MenuOption {
}
}
export
function
getHistoryMode
(
modeString
:
ViteEnv
[
'VITE_ROUTER_MODE'
]):
RouterHistory
{
export
function
getHistoryMode
(
modeString
:
ViteEnv
[
'VITE_ROUTER_MODE'
]):
RouterHistory
{
const
PUBLIC_PATH
=
import
.
meta
.
env
.
VITE_PUBLIC_PATH
if
(
modeString
===
'h5'
)
{
if
(
modeString
===
'h5'
)
{
return
createWebHistory
()
return
createWebHistory
(
PUBLIC_PATH
)
}
}
return
createWebHashHistory
()
return
createWebHashHistory
(
PUBLIC_PATH
)
}
}
function
menuSort
(
routes
:
RouteRecordRaw
[])
{
function
menuSort
(
routes
:
RouteRecordRaw
[])
{
...
...
src/utils/request.ts
View file @
1a97ebc4
...
@@ -16,15 +16,18 @@ export interface Response<T> {
...
@@ -16,15 +16,18 @@ export interface Response<T> {
pagingInfo
?:
PagingInfoParams
&
{
totalPages
:
number
;
totalRows
:
number
}
pagingInfo
?:
PagingInfoParams
&
{
totalPages
:
number
;
totalRows
:
number
}
}
}
const
ENV
=
import
.
meta
.
env
.
VITE_APP_ENV
function
handleLogout
()
{
function
handleLogout
()
{
const
currentRoute
=
router
.
currentRoute
.
value
const
currentRoute
=
router
.
currentRoute
.
value
router
.
replace
({
name
:
'Login'
,
query
:
{
redirect
:
encodeURIComponent
(
currentRoute
.
fullPath
)
}
})
router
.
replace
({
name
:
'Login'
,
query
:
{
redirect
:
encodeURIComponent
(
currentRoute
.
fullPath
)
}
})
useUserStore
().
logout
()
window
.
$message
.
warning
(
'身份已过期,请重新登录'
)
window
.
$message
.
warning
(
'身份已过期,请重新登录'
)
}
}
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
baseURL
:
`
${
BASE_URLS
[
window
.
ENV
||
'DEV'
]}
/api/rest`
,
baseURL
:
`
${
BASE_URLS
[
ENV
]}
/api/rest`
,
timeout
:
7000
,
timeout
:
7000
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Content-Type'
:
'application/json'
,
...
...
src/views/personal-space/personal-app-setting/components/app-publish.vue
View file @
1a97ebc4
...
@@ -10,6 +10,8 @@ const { pageContentWrapRef, tableContentY } = useTableScrollY()
...
@@ -10,6 +10,8 @@ const { pageContentWrapRef, tableContentY } = useTableScrollY()
const
router
=
useRouter
()
const
router
=
useRouter
()
const
ENV
=
import
.
meta
.
env
.
VITE_APP_ENV
const
channelPublishList
=
reactive
([
const
channelPublishList
=
reactive
([
{
{
type
:
'web'
,
type
:
'web'
,
...
@@ -30,13 +32,13 @@ function handleClickChannelPublishTableAction(actionType: string) {
...
@@ -30,13 +32,13 @@ function handleClickChannelPublishTableAction(actionType: string) {
}
}
function
handleAccessPage
()
{
function
handleAccessPage
()
{
const
chann
leUrl
=
`
${
INDEX_URLS
[
window
.
ENV
||
'DEV'
]}
share/web_source/
${
router
.
currentRoute
.
value
.
params
.
agentId
}
`
const
chann
elUrl
=
`
${
INDEX_URLS
[
ENV
]}
share/web_source/
${
router
.
currentRoute
.
value
.
params
.
agentId
}
`
location
.
href
=
chann
le
Url
location
.
href
=
chann
el
Url
}
}
function
handleCopyShareLink
()
{
function
handleCopyShareLink
()
{
const
chann
leUrl
=
`
${
INDEX_URLS
[
window
.
ENV
||
'DEV'
]}
share/web_source/
${
router
.
currentRoute
.
value
.
params
.
agentId
}
`
const
chann
elUrl
=
`
${
INDEX_URLS
[
ENV
]}
share/web_source/
${
router
.
currentRoute
.
value
.
params
.
agentId
}
`
copyToClip
(
chann
le
Url
)
copyToClip
(
chann
el
Url
)
window
.
$message
.
success
(
'链接复制成功,快分享给你的好友吧!'
)
window
.
$message
.
success
(
'链接复制成功,快分享给你的好友吧!'
)
}
}
</
script
>
</
script
>
...
...
vite.config.ts
View file @
1a97ebc4
...
@@ -32,6 +32,7 @@ export default defineConfig(({ command, mode }) => {
...
@@ -32,6 +32,7 @@ export default defineConfig(({ command, mode }) => {
preprocessorOptions
:
{
preprocessorOptions
:
{
scss
:
{
scss
:
{
additionalData
:
'@use "@/styles/index.scss" as *;'
,
additionalData
:
'@use "@/styles/index.scss" as *;'
,
api
:
'modern-compiler'
,
},
},
},
},
},
},
...
...
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