在看黑马vue教学做项目视频的时候,遇到了一个这个报错,现在解决了,分享给大家。
vue.runtime.esm.js:4448 [Vue warn]: Error in v-on handler (Promise/async): "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'platform' cannot be null"
found in
---> <LoginPage> at src/views/login/index.vue
<App> at src/App.vue
<Root>
vue.runtime.esm.js:2956 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'platform' cannot be null
具体的错误原因是尝试将NULL值插入到不允许为空(NOT NULL约束)的platform列中。
所以在创建axios实例对象的时候把请求头加上就没问题啦