Skip to content

Backend Integration

Confirm the data structure type of the backend return result

The default is as follows:


type Response<T = unknown> = {
  /** Business status code */
  code: string;
  /** Response message */
  msg: string;
  /** Response data */
  data: T;

Please modify according to the data type returned by your own backend

Configure the success code of backend request

Change the configuration VITE_SERVICE_SUCCESS_CODE in .env

The configuration loaded by the environment file is of string type. If the code returned by the backend is of numeric type, it needs to be converted to the same type for comparison.

Refer to the configuration items in the request introduction

Publish under the MIT license