You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
/*
|
|
* @Author: donghao donghao@supervision.ltd
|
|
* @Date: 2024-01-24 15:08:23
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
* @LastEditTime: 2024-01-24 17:00:49
|
|
* @FilePath: \general-ai-platform-web\mock\utils\apiMock.ts
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
|
|
import { failMockApiProps, successMockApiProps } from '../typing';
|
|
export function fetchMockSuccessFullByOther({ data, msg }): successMockApiProps {
|
|
return {
|
|
code: 0, // 0 成功
|
|
success: true, // true 成功
|
|
data: data || null, // mock业务层数据
|
|
msg: msg | 'ok', // 成功提示
|
|
isMock: true, // true 标识当前是模拟数据
|
|
} as successMockApiProps;
|
|
}
|
|
|
|
export function fetchMockFailFullByOther({ data, msg }): failMockApiProps {
|
|
return {
|
|
code: 599, // 0 成功
|
|
success: true, // true 成功
|
|
data: data || null, // mock业务层数据
|
|
msg: msg | 'fail', // 成功提示
|
|
isMock: true, // true 标识当前是模拟数据
|
|
} as failMockApiProps;
|
|
}
|