xiaozhi-esp32-server/main/manager-mobile/src/http
lapy 2be70e8e6c feat(manager-mobile): westernize H5 app, copy, and shared crypto
- English locale defaults; remove duplicate zh-only locale files

- SM2 utility sharing with the web client where applicable
2026-04-25 17:05:15 +01:00
..
request feat(manager-mobile): westernize H5 app, copy, and shared crypto 2026-04-25 17:05:15 +01:00
README.md feat(manager-mobile): westernize H5 app, copy, and shared crypto 2026-04-25 17:05:15 +01:00

Request Library

The current project uses Alova as the only HTTP request library:

Usage

  • Alova HTTP: Path (src/http/request/alova.ts)
  • Example code: src/api/foo-alova.ts and src/api/foo.ts
  • API documentation: https://alova.js.org/

Configuration

Alova instance is configured:

  • Automatic Token authentication and refresh
  • Unified error handling and prompts
  • Support dynamic domain switching
  • Built-in request/response interceptors

Usage Examples

import { http } from '@/http/request/alova'

// GET request
http.Get<ResponseType>('/api/path', {
  params: { id: 1 },
  headers: { 'Custom-Header': 'value' },
  meta: { toast: false } // Disable error prompts
})

// POST request  
http.Post<ResponseType>('/api/path', data, {
  params: { query: 'param' },
  headers: { 'Content-Type': 'application/json' }
})