liudong0763

3793 经验值

Jelly 你视频里的delete方法,后端删除的数据和前端删除的数据不一致

好的,我试试,非常感谢大神的解答

老师,整个APP开发系列么,嘿嘿

2laravel.dev/api/todo/8/completed:1 PATCH http://laravel.dev/api/todo/8/completed 
:8080/#/:1 XMLHttpRequest cannot load http://laravel.dev/api/todo/8/completed. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 429.
createError.js?f777:15 Uncaught (in promise) Error: Network Error(…)

老师,在我点complete按钮的时候,一般点前几次都没什么问题,但是点多几次就会在控制台报出这样的错误提示,不明白

//正确写法:
toggleComplete(todo){
                this.axios.patch('http://laravel.dev/api/todo/'+todo.id+'/completed').then(response=>{
                    console.log(response.data)
                    todo.completed = ! todo.completed
                })
            }
//可是为什么这样写就不正确呢
toggleComplete(todo){
                this.axios.patch('http://laravel.dev/api/todo/'+todo.id+'/completed').then(response=>{
                    console.log(response.data)
                    todo = response.data
                })
            }