Browse Source

优化

master
LiLongLong 4 months ago
parent
commit
3e3e610104
  1. 7
      components.d.ts
  2. 2
      src/utils/getServerInfo.ts
  3. 2
      vite.config.ts

7
components.d.ts

@ -10,11 +10,11 @@ declare module 'vue' {
Confirm: typeof import('./src/components/Confirm.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ErrorModal: typeof import('./src/components/dialogs/ErrorModal.vue')['default']
Keyboard: typeof import('./src/components/Keyboard.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
@ -22,4 +22,7 @@ declare module 'vue' {
SimpleKeyboard: typeof import('./src/components/SimpleKeyboard.vue')['default']
StackInfoModal: typeof import('./src/components/dialogs/StackInfoModal.vue')['default']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}

2
src/utils/getServerInfo.ts

@ -8,7 +8,7 @@ export function getServerInfo(wsPath: string = '/api/v1/app/ws/state') {
const host = window.location.hostname;
// const host = "192.168.1.119";
// const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
const port = "80"
const port = "8888"
// 构建 WebSocket URL
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
const wsUrl = `${wsProtocol}//${host}:${port}${wsPath}`

2
vite.config.ts

@ -35,7 +35,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost',
target: 'http://localhost:8888',
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),
},

Loading…
Cancel
Save