This commit is contained in:
路 范
2021-09-24 14:33:10 +08:00
parent 0e82fb3156
commit c03092bc0c
432 changed files with 57806 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
import { api } from 'common/api'
api.apiName(params)
.then(res => {
/* ... */
})
.catch(error => {
/* catch */
})
.finally(() => {
/* finally */
})
// 或者采用异步
async function foo() {
try {
const res = await api.apiName(params)
/* ... */
} catch (error) {
/* catch */
} finally {
/* finally */
}
}