Hi,本地开发调试,怎么让ajax延迟1s,模拟loading
docikaci opened this issue · 6 comments
docikaci commented
如题, 非常感谢
chemdemo commented
修改server/routes.js
文件,假设你的ajax url是/api/ajax
router.get('/api/ajax', function* () {
let self = this
setTimeout(() => {
self.body = {code: 200, data: 'xxx'}
}, 1000)
})
也就是返回前延迟1s
docikaci commented
chemdemo commented
你的node是什么版本 要更新到最新稳定版本哦
docikaci commented
docikaci commented
docikaci commented
jonasli rtx