Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
frontend-yd-email
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
Sweet Zhang
frontend-yd-email
Commits
70b9e0d4
Commit
70b9e0d4
authored
Sep 26, 2025
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按类型封装api
parent
b09264c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
210 additions
and
176 deletions
+210
-176
.env.production
+2
-2
axios.d.ts
+0
-20
src/api/api.ts
+0
-0
src/shim-vue.d.ts
+5
-0
src/types/index.ts
+38
-11
src/utils/request.ts
+12
-3
src/views/ComposeEmail.vue
+33
-28
src/views/ContactManagement.vue
+5
-12
src/views/SenderManagement.vue
+40
-42
src/views/VariableManagement.vue
+42
-43
tsconfig.json
+31
-14
vite.config.ts
+2
-1
No files found.
.env.production
View file @
70b9e0d4
VITE_API_BASE_URL='http://139.224.145.34:9002/email/api'
\ No newline at end of file
VITE_API_BASE_URL='/email/api'
\ No newline at end of file
axios.d.ts
deleted
100644 → 0
View file @
b09264c7
interface
resPage
{
page
:
number
pageSize
:
number
total
:
number
hasNextPage
:
boolean
pageTotal
:
number
}
interface
itfRes
{
code
:
number
msg
:
string
|
undefined
data
:
T
reason
?:
string
page
?:
resPage
}
import
*
as
axios
from
'axios'
declare
module
'axios'
{
interface
AxiosResponse
extends
itfRes
}
src/api/api.ts
View file @
70b9e0d4
This diff is collapsed.
Click to expand it.
src/shim-vue.d.ts
0 → 100644
View file @
70b9e0d4
declare
module
'*.vue'
{
import
type
{
DefineComponent
}
from
'vue'
const
component
:
DefineComponent
<
object
,
object
,
unknown
>
export
default
component
}
src/types/index.ts
View file @
70b9e0d4
// 分页类型
export
interface
Pagination
<
T
>
{
records
?:
T
[]
total
?:
number
pageSize
?:
number
sortField
?:
string
sortOrder
?:
string
pageNo
?:
number
}
// 联系人类型
export
interface
Contact
{
export
interface
Contact
extends
Pagination
<
Contact
>
{
contactBizId
?:
string
name
?:
string
type
?:
string
...
...
@@ -11,17 +21,19 @@ export interface Contact {
}
// 发件人类型
export
interface
Sender
{
export
interface
Sender
extends
Pagination
<
Sender
>
{
senderBizId
?:
string
email
?:
string
password
?:
string
displayName
?:
string
providerBizId
?:
string
active
?:
number
emailSenderConfigName
?:
string
emailSenderConfigEmail
?:
string
}
// 变量类型
export
interface
Variable
{
export
interface
Variable
extends
Pagination
<
Variable
>
{
id
?:
string
variableBizId
?:
string
variableNameCn
?:
string
...
...
@@ -30,7 +42,7 @@ export interface Variable {
}
// 变量模板类型
export
interface
VariableTemplate
{
export
interface
VariableTemplate
extends
Pagination
<
VariableTemplate
>
{
variableGroupBizId
?:
string
groupName
?:
string
description
?:
string
...
...
@@ -39,7 +51,7 @@ export interface VariableTemplate {
}
// 邮件类型
export
interface
Email
{
export
interface
Email
extends
Pagination
<
Email
>
{
id
?:
string
sender
?:
string
to
?:
string
[]
...
...
@@ -52,7 +64,7 @@ export interface Email {
}
// 邮件表单类型
export
interface
EmailForm
{
export
interface
EmailForm
extends
Pagination
<
EmailForm
>
{
to
:
string
cc
:
string
subject
:
string
...
...
@@ -84,12 +96,27 @@ export interface ContactSessionId {
}
// 编辑-邮件联系人导入信息
export
interface
EditContactImport
{
export
interface
EditContactImport
extends
Pagination
<
EditContactImport
>
{
receiveEmail
?:
string
sessionId
?:
string
source
?:
string
pageNo
?:
number
pageSize
?:
number
sortField
?:
string
sortOrder
?:
string
}
// 发送邮件
export
interface
SendEmail
{
senderBizId
?:
string
recipientEmailList
?:
string
[]
ccEmailList
?:
string
[]
bccEmailList
?:
string
[]
subject
?:
string
body
?:
string
}
//邮件服务商类型
export
interface
EmailProvider
extends
Pagination
<
EmailProvider
>
{
providerBizId
?:
string
providerName
?:
string
smtpHost
?:
string
smtpPort
?:
string
sslEnabled
?:
number
active
?:
number
description
?:
string
}
src/utils/request.ts
View file @
70b9e0d4
import
axios
,
{
AxiosError
}
from
'axios'
import
axios
,
{
type
AxiosError
,
type
AxiosResponse
,
type
InternalAxiosRequestConfig
}
from
'axios'
// 定义统一的响应类型
export
interface
ApiResponse
<
T
=
object
>
{
code
:
number
message
?:
string
data
:
T
success
:
boolean
msg
?:
string
}
// 创建axios实例
const
request
=
axios
.
create
({
...
...
@@ -14,7 +23,7 @@ const request = axios.create({
// 请求拦截器 - 添加Authorization头
request
.
interceptors
.
request
.
use
(
(
config
)
=>
{
(
config
:
InternalAxiosRequestConfig
)
=>
{
// 从本地存储获取token
const
token
=
localStorage
.
getItem
(
'authToken'
)
...
...
@@ -33,7 +42,7 @@ request.interceptors.request.use(
// 响应拦截器 - 处理常见错误
request
.
interceptors
.
response
.
use
(
(
response
)
=>
{
(
response
:
AxiosResponse
)
=>
{
// 直接返回响应数据
return
response
.
data
},
...
...
src/views/ComposeEmail.vue
View file @
70b9e0d4
...
...
@@ -7,7 +7,7 @@
class=
"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
>
<option
v-for=
"sender in senders"
:key=
"sender.senderBizId"
:value=
"sender"
>
{{
sender
.
email
}}
{{
sender
.
email
}}
-
{{
sender
.
displayName
}}
</option>
</select>
</div>
...
...
@@ -43,6 +43,7 @@
type=
"text"
class=
"flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder=
"输入收件人邮箱,多个邮箱用逗号分隔"
:disabled=
"!!selectedVariableTemplate"
/>
<!-- 当选择模版有值时,不显示选择联系人按钮 -->
<button
...
...
@@ -69,6 +70,7 @@
type=
"text"
class=
"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder=
"输入抄送人邮箱,多个邮箱用逗号分隔"
:disabled=
"!!selectedVariableTemplate"
/>
</div>
...
...
@@ -261,12 +263,7 @@ import type {
ImportRecord
,
}
from
'../types'
// 引入api接口,获取联系人列表、发件人列表、变量模版列表
import
{
getContactList
,
getEmailSenderConfigList
,
getEmailVariableGroupList
,
getEmailVariableGroupDetail
,
}
from
'../api/api'
import
{
senderApi
,
variableGroupApi
,
contactApi
,
getContactList
}
from
'../api/api'
// 引入弹窗组件
import
CommonModal
from
'@/components/CommonModal.vue'
// 弹窗提示信息对象
...
...
@@ -301,28 +298,34 @@ const handleCancel = (triggerKey: string) => {
}
// 初始化数据
const
getSenders
=
()
=>
{
getEmailSenderConfigList
({
pageNo
:
1
,
pageSize
:
100
,
}).
then
((
res
)
=>
{
senders
.
value
=
res
.
data
?.
records
||
[]
})
senderApi
.
getEmailSenderConfigList
({
pageNo
:
1
,
pageSize
:
100
,
})
.
then
((
res
)
=>
{
senders
.
value
=
res
.
data
?.
records
||
[]
})
}
const
getContacts
=
()
=>
{
getContactList
({
pageNo
:
1
,
pageSize
:
100
,
}).
then
((
res
)
=>
{
contacts
.
value
=
res
.
data
?.
records
||
[]
})
contactApi
.
getContactList
({
pageNo
:
1
,
pageSize
:
100
,
})
.
then
((
res
)
=>
{
contacts
.
value
=
res
.
data
?.
records
||
[]
})
}
const
getGroups
=
()
=>
{
getEmailVariableGroupList
({
pageNo
:
1
,
pageSize
:
100
,
}).
then
((
res
)
=>
{
groups
.
value
=
res
.
data
?.
records
||
[]
})
variableGroupApi
.
getEmailVariableGroupList
({
pageNo
:
1
,
pageSize
:
100
,
})
.
then
((
res
)
=>
{
groups
.
value
=
res
.
data
?.
records
||
[]
})
}
const
senders
=
ref
<
Sender
[]
>
([])
...
...
@@ -388,9 +391,11 @@ const removeAttachment = (index: number) => {
const
applyVariableTemplate
=
()
=>
{
if
(
!
selectedVariableTemplate
.
value
)
return
if
(
selectedVariableTemplate
.
value
.
variableGroupBizId
)
{
getEmailVariableGroupDetail
(
selectedVariableTemplate
.
value
.
variableGroupBizId
).
then
((
res
)
=>
{
variables
.
value
=
res
.
data
?.
emailVariableDtoList
||
[]
})
variableGroupApi
.
getEmailVariableGroupDetail
(
selectedVariableTemplate
.
value
.
variableGroupBizId
)
.
then
((
res
)
=>
{
variables
.
value
=
res
.
data
?.
emailVariableDtoList
||
[]
})
}
}
...
...
src/views/ContactManagement.vue
View file @
70b9e0d4
...
...
@@ -319,14 +319,7 @@
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
onMounted
}
from
'vue'
// 引入我们创建的api拦截器
import
{
addContact
,
editContact
,
deleteContact
,
getContactDetail
,
getContactList
,
getEmailSenderConfigList
,
}
from
'@/api/api'
import
{
contactApi
}
from
'@/api/api'
import
type
{
Contact
}
from
'@/types/index'
// 引入弹窗组件
import
CommonModal
from
'@/components/CommonModal.vue'
...
...
@@ -355,7 +348,7 @@ const handleConfirm = (triggerKey: string) => {
modalVisible
.
value
=
false
console
.
log
(
'用户确认操作'
,
triggerKey
)
if
(
triggerKey
===
'deleteContactModal'
&&
form
.
value
.
contactBizId
)
{
deleteContact
(
form
.
value
.
contactBizId
as
string
).
then
((
res
)
=>
{
contactApi
.
deleteContact
(
form
.
value
.
contactBizId
as
string
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
fetchContacts
()
openModal
({
...
...
@@ -476,7 +469,7 @@ const totalPages = computed(() => {
const
fetchContacts
=
async
()
=>
{
try
{
isLoading
.
value
=
true
const
data
=
await
getContactList
({
const
data
=
await
contactApi
.
getContactList
({
pageNo
:
currentPage
.
value
,
pageSize
:
pageSize
.
value
,
sortField
:
sortBy
.
value
,
...
...
@@ -614,7 +607,7 @@ const saveContact = async () => {
if
(
isEditing
.
value
&&
form
.
value
.
contactBizId
)
{
// 更新现有联系人
edit
Contact
({
...
contactData
}).
then
((
res
)
=>
{
contactApi
.
update
Contact
({
...
contactData
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
openModal
({
title
:
'更新联系人成功'
,
...
...
@@ -631,7 +624,7 @@ const saveContact = async () => {
})
}
else
{
// 添加新联系人
await
addContact
(
contactData
).
then
((
res
)
=>
{
await
contactApi
.
addContact
(
contactData
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
openModal
({
title
:
'添加联系人成功'
,
...
...
src/views/SenderManagement.vue
View file @
70b9e0d4
...
...
@@ -102,8 +102,8 @@
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{
sender
.
email
}}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{
providers
.
find
((
provider
)
=>
provider
.
providerBizId
===
sender
.
providerBizId
)
?.
providerName
||
'未知'
providers
.
find
((
i
)
=>
i
.
providerBizId
===
sender
.
providerBizId
)?.
providerName
||
'未知'
}}
</td>
<td
class=
"px-6 py-4 whitespace-nowrap"
>
{{
sender
.
displayName
}}
</td>
...
...
@@ -149,13 +149,7 @@
<
script
setup
lang=
"ts"
>
import
{
ref
,
defineProps
,
defineEmits
,
onMounted
}
from
'vue'
import
{
getEmailSenderConfigList
,
getEmailProviderList
,
deleteEmailSenderConfig
,
addEmailSenderConfig
,
editEmailSenderConfig
,
}
from
'@/api/api'
import
{
emailProviderApi
,
senderApi
,
getEmailSenderConfigList
}
from
'@/api/api'
import
type
{
Sender
}
from
'@/types/index'
// 引入弹窗组件
import
CommonModal
from
'@/components/CommonModal.vue'
...
...
@@ -184,7 +178,7 @@ const handleConfirm = (triggerKey: string) => {
modalVisible
.
value
=
false
console
.
log
(
'用户确认操作'
,
triggerKey
)
if
(
triggerKey
===
'deleteModal'
)
{
deleteEmailSenderConfig
(
editingSenderId
.
value
).
then
((
res
)
=>
{
senderApi
.
deleteEmailSenderConfig
(
editingSenderId
.
value
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
openModal
({
title
:
'删除确认'
,
...
...
@@ -235,22 +229,24 @@ const resetForm = () => {
}
}
const
getProviders
=
()
=>
{
getEmailProviderList
({
providerName
:
''
,
pageNo
:
1
,
pageSize
:
100
,
})
.
then
((
res
)
=>
{
providers
.
value
=
res
.
data
?.
records
||
[]
})
emailProviderApi
.
getEmailProviderList
({
providerName
:
''
,
})
.
then
((
res
)
=>
{
providers
.
value
=
res
.
data
?.
records
||
[]
})
}
const
getSenders
=
()
=>
{
getEmailSenderConfigList
({
emailSenderConfigName
:
''
,
pageNo
:
1
,
pageSize
:
100
,
}).
then
((
res
)
=>
{
senders
.
value
=
res
.
data
?.
records
||
[]
})
senderApi
.
getEmailSenderConfigList
({
emailSenderConfigName
:
''
,
pageNo
:
1
,
pageSize
:
100
,
})
.
then
((
res
)
=>
{
senders
.
value
=
res
.
data
?.
records
||
[]
})
}
const
saveSender
=
()
=>
{
console
.
log
(
formData
.
value
)
...
...
@@ -264,23 +260,25 @@ const saveSender = () => {
if
(
editingSenderId
.
value
)
{
// 更新现有发件人
editEmailSenderConfig
({
senderBizId
:
editingSenderId
.
value
,
...
formData
.
value
,
}).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
getSenders
()
openModal
({
title
:
'更新确认'
,
message
:
'发件人更新成功'
,
})
}
else
{
openModal
({
title
:
'更新失败'
,
message
:
res
.
msg
||
'更新失败'
,
})
}
})
senderApi
.
editEmailSenderConfig
({
senderBizId
:
editingSenderId
.
value
,
...
formData
.
value
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
getSenders
()
openModal
({
title
:
'更新确认'
,
message
:
'发件人更新成功'
,
})
}
else
{
openModal
({
title
:
'更新失败'
,
message
:
res
.
msg
||
'更新失败'
,
})
}
})
}
else
{
// 添加新发件人
const
newSender
:
Sender
=
{
...
...
@@ -290,7 +288,7 @@ const saveSender = () => {
displayName
:
formData
.
value
.
displayName
||
''
,
active
:
formData
.
value
.
active
??
1
,
}
addEmailSenderConfig
(
newSender
).
then
((
res
)
=>
{
senderApi
.
addEmailSenderConfig
(
newSender
).
then
((
res
)
=>
{
// 补充异常处理
if
(
res
.
code
===
200
)
{
getSenders
()
...
...
src/views/VariableManagement.vue
View file @
70b9e0d4
...
...
@@ -290,17 +290,7 @@
import
{
ref
,
defineProps
,
defineEmits
,
onMounted
}
from
'vue'
import
type
{
Variable
,
VariableTemplate
}
from
'../types'
import
{
getEmailVariableList
,
addEmailVariable
,
editEmailVariable
,
deleteEmailVariable
,
addEmailVariableGroup
,
editEmailVariableGroup
,
deleteEmailVariableGroup
,
getEmailVariableGroupList
,
getEmailVariableGroupDetail
,
}
from
'@/api/api'
import
{
variableApi
,
variableGroupApi
}
from
'@/api/api'
// 引入弹窗组件
import
CommonModal
from
'@/components/CommonModal.vue'
...
...
@@ -386,26 +376,29 @@ const saveVariable = () => {
if
(
editingVariableId
.
value
)
{
// 更新接口
editEmailVariable
({
variableBizId
:
variableForm
.
value
.
variableBizId
||
''
,
variableNameCn
:
variableForm
.
value
.
variableNameCn
,
variableNameEn
:
variableForm
.
value
.
variableNameEn
,
description
:
variableForm
.
value
.
description
,
}).
then
(()
=>
{
// 更新本地变量列表
fetchVariables
()
openModal
({
title
:
'成功'
,
message
:
'变量更新成功'
,
variableApi
.
editEmailVariable
({
variableBizId
:
variableForm
.
value
.
variableBizId
||
''
,
variableNameCn
:
variableForm
.
value
.
variableNameCn
,
variableNameEn
:
variableForm
.
value
.
variableNameEn
,
description
:
variableForm
.
value
.
description
,
})
.
then
(()
=>
{
// 更新本地变量列表
fetchVariables
()
openModal
({
title
:
'成功'
,
message
:
'变量更新成功'
,
})
})
})
}
else
{
// 创建接口
addEmailVariable
({
variableNameCn
:
variableForm
.
value
.
variableNameCn
,
variableNameEn
:
variableForm
.
value
.
variableNameEn
,
description
:
variableForm
.
value
.
description
,
})
variableApi
.
addEmailVariable
({
variableNameCn
:
variableForm
.
value
.
variableNameCn
,
variableNameEn
:
variableForm
.
value
.
variableNameEn
,
description
:
variableForm
.
value
.
description
,
})
.
then
((
res
)
=>
{
// 刷新变量列表
fetchVariables
()
...
...
@@ -441,7 +434,8 @@ const editVariable = (variable: Variable) => {
const
deleteVariable
=
(
id
:
string
,
type
?:
string
)
=>
{
editingVariableId
.
value
=
id
if
(
id
&&
type
===
'confirmDelete'
)
{
deleteEmailVariable
(
id
)
variableApi
.
deleteEmailVariable
(
id
)
.
then
(()
=>
{
// 刷新变量列表
fetchVariables
()
...
...
@@ -483,7 +477,8 @@ const fetchVariables = () => {
pageNo
:
1
,
pageSize
:
10
,
}
getEmailVariableList
(
params
)
variableApi
.
getEmailVariableList
(
params
)
.
then
((
res
)
=>
{
variables
.
value
=
res
.
data
.
records
||
[]
})
...
...
@@ -508,7 +503,8 @@ const fetchVariableTemplates = () => {
pageNo
:
1
,
pageSize
:
10
,
}
getEmailVariableGroupList
(
params
)
variableGroupApi
.
getEmailVariableGroupList
(
params
)
.
then
((
res
)
=>
{
variableTemplates
.
value
=
res
.
data
.
records
||
[]
})
...
...
@@ -581,12 +577,13 @@ const saveVariableTemplate = () => {
if
(
editingTemplateId
.
value
)
{
console
.
log
(
'更新变量模版'
,
templateForm
.
value
)
// 更新现有模板
editEmailVariableGroup
({
variableGroupBizId
:
editingTemplateId
.
value
,
groupName
:
templateForm
.
value
.
groupName
||
''
,
description
:
templateForm
.
value
.
description
||
''
,
variableBizIdList
:
templateForm
.
value
.
variableBizIdList
||
[],
})
variableGroupApi
.
editEmailVariableGroup
({
variableGroupBizId
:
editingTemplateId
.
value
,
groupName
:
templateForm
.
value
.
groupName
||
''
,
description
:
templateForm
.
value
.
description
||
''
,
variableBizIdList
:
templateForm
.
value
.
variableBizIdList
||
[],
})
.
then
(()
=>
{
// 刷新变量模版列表
fetchVariableTemplates
()
...
...
@@ -607,11 +604,12 @@ const saveVariableTemplate = () => {
})
}
else
{
// 调用变量组保存接口
addEmailVariableGroup
({
groupName
:
templateForm
.
value
.
groupName
||
''
,
description
:
templateForm
.
value
.
description
||
''
,
variableBizIdList
:
templateForm
.
value
.
variableBizIdList
||
[],
})
variableGroupApi
.
addEmailVariableGroup
({
groupName
:
templateForm
.
value
.
groupName
||
''
,
description
:
templateForm
.
value
.
description
||
''
,
variableBizIdList
:
templateForm
.
value
.
variableBizIdList
||
[],
})
.
then
(()
=>
{
// 刷新变量模版列表
fetchVariableTemplates
()
...
...
@@ -638,7 +636,8 @@ const saveVariableTemplate = () => {
const
deleteVariableTemplate
=
(
id
:
string
,
type
?:
string
)
=>
{
editingTemplateId
.
value
=
id
if
(
type
===
'confirmDelete'
)
{
deleteEmailVariableGroup
(
editingTemplateId
.
value
)
variableGroupApi
.
deleteEmailVariableGroup
(
editingTemplateId
.
value
)
.
then
(()
=>
{
// 刷新变量模版列表
fetchVariableTemplates
()
...
...
tsconfig.json
View file @
70b9e0d4
{
"files"
:
[],
"references"
:
[
{
"path"
:
"./tsconfig.node.json"
},
{
"path"
:
"./tsconfig.app.json"
},
{
"path"
:
"./tsconfig.vitest.json"
}
],
"compilerOptions"
:
{
"target"
:
"ES2020"
,
"useDefineForClassFields"
:
true
,
"lib"
:
[
"ES2020"
,
"DOM"
,
"DOM.Iterable"
],
"module"
:
"ESNext"
,
"skipLibCheck"
:
true
,
"strict"
:
false
}
"moduleResolution"
:
"bundler"
,
"allowImportingTsExtensions"
:
true
,
"resolveJsonModule"
:
true
,
"isolatedModules"
:
true
,
"noEmit"
:
true
,
"jsx"
:
"preserve"
,
"strict"
:
true
,
"noUnusedLocals"
:
true
,
"noUnusedParameters"
:
true
,
"noFallthroughCasesInSwitch"
:
true
,
"composite"
:
true
,
"declaration"
:
true
,
"declarationMap"
:
true
,
"baseUrl"
:
"/yd-email"
,
"paths"
:
{
"@/*"
:
[
"src/*"
],
"@/components/*"
:
[
"src/components/*"
],
"@/views/*"
:
[
"src/views/*"
],
"@/utils/*"
:
[
"src/utils/*"
],
"@/api/*"
:
[
"src/api/*"
],
"@/types/*"
:
[
"src/types/*"
],
"@/stores/*"
:
[
"src/stores/*"
],
"@/assets/*"
:
[
"src/assets/*"
]
}
},
"include"
:
[
"src/**/*.ts"
,
"src/**/*.tsx"
,
"src/**/*.vue"
,
"src/**/*.d.ts"
,
"src/shims-vue.d.ts"
],
"exclude"
:
[
"node_modules"
,
"dist"
]
}
vite.config.ts
View file @
70b9e0d4
...
...
@@ -3,7 +3,7 @@ import { defineConfig } from 'vite'
import
vue
from
'@vitejs/plugin-vue'
import
vueJsx
from
'@vitejs/plugin-vue-jsx'
import
vueDevTools
from
'vite-plugin-vue-devtools'
/**设置server转发 */
import
{
resolve
}
from
'path'
export
default
defineConfig
({
// 关键配置:设置基础路径为子目录 yd-email
...
...
@@ -12,6 +12,7 @@ export default defineConfig({
resolve
:
{
alias
:
{
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
)),
'@/components'
:
resolve
(
__dirname
,
'src/components'
),
},
},
// 添加CSS配置
...
...
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