web编译修正

This commit is contained in:
2026-01-02 15:32:04 +08:00
parent 73badc175d
commit 97724c8c8d
2 changed files with 12 additions and 10 deletions

View File

@@ -12,6 +12,7 @@
"dependencies": { "dependencies": {
"@element-plus/icons-vue": "^2.3.2", "@element-plus/icons-vue": "^2.3.2",
"@stomp/stompjs": "^7.2.1", "@stomp/stompjs": "^7.2.1",
"axios": "^1.7.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"element-plus": "^2.12.0", "element-plus": "^2.12.0",
"express": "^4.18.2", "express": "^4.18.2",

View File

@@ -113,11 +113,17 @@ export default defineConfig({
strictPort: true, strictPort: true,
host: true, host: true,
cors: true, cors: true,
// HTTPS 配置(使用 mkcert 生成的本地开发证书 // HTTPS 配置(本地开发用,可选
https: { https: (() => {
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'), try {
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem') return {
}, key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
}
} catch {
return undefined
}
})(),
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
@@ -129,11 +135,6 @@ export default defineConfig({
port: 7000, port: 7000,
host: true, host: true,
cors: true, cors: true,
// HTTPS 配置(使用 mkcert 生成的本地开发证书)
https: {
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
},
headers: { headers: {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',