Replies: 1 comment 3 replies
-
|
对于1,不建议,还有很多与method相关的参数。退一步说,假如实现了你提出的需求,这时如果想要指定 对于2,可以在 我个人会习惯将所有的 method 重新用函数包装一次,这样恰好能实现你提到的需求: async function addUser(username: string) {
return Apis.user.add({
data: {
username
},
transform: data => data.data
})
}这样的好处是不失去灵活性。 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
目前遇到两个问题,是否能实现呢
因为我方系统统一了规范,例如post只会有body,每次都要套一个data过于重复
目前结果都统一了结构,直接在responsed拦截了异常的情况,希望返回时会直接拿结果中的data
Beta Was this translation helpful? Give feedback.
All reactions