fujinshui

266 经验值

addTodo(newTodo){

            this.axios.post('http://192.168.0.168/tp5/public/index.php/admin/Todos/create',{title:this.newTodo.title}).then(response=>{
                console.log(response.data)
                //this.todos.push(response.data);
            })
            this.newTodo={id:null,title:''};
        },后台接受值为空

XMLHttpRequest cannot load http://192.168.0.168/tp5/public/index.php/admin/Todos/create. Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.