Browse Source

fix some bug

relver
zhaohe 7 months ago
parent
commit
ba9d827830
  1. 11
      components.d.ts
  2. 2
      src/utils/axios.ts
  3. 1
      src/utils/getServerInfo.ts
  4. 2
      tsconfig.app.tsbuildinfo
  5. 2
      tsconfig.node.tsbuildinfo

11
components.d.ts

@ -7,6 +7,14 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ElButton: typeof import('element-plus/es')['ElButton']
ElCol: typeof import('element-plus/es')['ElCol']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElRow: typeof import('element-plus/es')['ElRow']
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']
@ -14,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/axios.ts

@ -10,7 +10,7 @@ const serverInfo = getServerInfo()
// 创建 Axios 实例
const apiClient: AxiosInstance = axios.create({
baseURL: serverInfo.httpUrl, // 设置请求的根路径
timeout: 10000,
timeout: 30000,
headers: {
'Content-Type': 'application/json',
},

1
src/utils/getServerInfo.ts

@ -6,6 +6,7 @@ export function getServerInfo(wsPath: string = '/api/v1/app/ws/state') {
// 获取主机名(IP 或域名)和端口号
// const host = url.hostname // 例如: "192.168.1.100" 或 "localhost"
const host = window.location.hostname;
// const host = "127.0.0.1";
// const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082
const port = "80"
// 构建 WebSocket URL

2
tsconfig.app.tsbuildinfo
File diff suppressed because it is too large
View File

2
tsconfig.node.tsbuildinfo
File diff suppressed because it is too large
View File

Loading…
Cancel
Save