Created
September 28, 2020 02:42
-
-
Save ThaddeusJiang/412b5691d274aad112bf54b100e7d95c to your computer and use it in GitHub Desktop.
过度设计:API 返回的数据结构像俄罗斯套娃
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// response | |
// { | |
// code: string | |
// msg: string | |
// data: any | |
// } | |
export const spreadResponse = (res) => { | |
const { | |
data: { data }, | |
} = res | |
return data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment