mirror of
https://gitee.com/bootx/dax-pay-h5
synced 2026-08-04 20:46:23 +08:00
refactor(h5): 对齐后端 Result 契约 (ResultEnum SUCCESS=0/ERROR=1, Result.data)
- ResultEnum.SUCCESS 200→0、ERROR 300→1, 与后端 CommonCode 一致 - Result 接口字段 result→data, 与后端 Result 结构及现有 axios 解构对齐
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
* @description: 请求结果集
|
||||
*/
|
||||
export enum ResultEnum {
|
||||
SUCCESS = 200,
|
||||
ERROR = 300,
|
||||
// 与后端 CommonCode 对齐:成功 0、失败 1
|
||||
SUCCESS = 0,
|
||||
ERROR = 1,
|
||||
TIMEOUT = 10042,
|
||||
TYPE = 'success',
|
||||
}
|
||||
|
||||
@@ -57,9 +57,10 @@ export interface RequestOptions {
|
||||
withToken?: boolean
|
||||
}
|
||||
|
||||
// 与后端 cn.daxpay.open.platform.core.rest.result.Result 对齐
|
||||
export interface Result<T = any> {
|
||||
code: number
|
||||
type?: 'success' | 'error' | 'warning'
|
||||
message: string
|
||||
result?: T
|
||||
data?: T
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user