10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
由于 restful api 一般会复用 http 状态码作为响应代码,建议添加自定义 http status code 的功能。 例如: 使用一个类似 _status 的保留属性作为可选的自定义状态码
Mock.mock('/api/demo', 'DELETE', (request) => { const items = JSON.parse(request.body ?? '[]'); if (items.length) { return { code: 200, message: '删除成功', _status: 204 }; } return { code: 400, message: '参数不能为空', _status: 400 }; });
返回值读取自定义状态码并删除该 8A4D 性
const result = mocked.convert(this.custom.template, this.custom.options); this.status = result._status ?? 200; delete result._status;
以上 谢谢
The text was updated successfully, but these errors were encountered:
可以考虑,随后支持
Sorry, something went wrong.
No branches or pull requests
由于 restful api 一般会复用 http 状态码作为响应代码,建议添加自定义 http status code 的功能。
例如:
使用一个类似 _status 的保留属性作为可选的自定义状态码
返回值读取自定义状态码并删除该 8A4D 性
以上
谢谢
The text was updated successfully, but these errors were encountered: