报错:Integrity constraint violation: 1048 Column ‘platform‘ cannot be null

[Vue warn]: Error in v-on handler (Promise/async): "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'platform' cannot be null" found in ---> <LoginIndex> <App> at src/App.vue <Root>

vue.runtime.esm.js:2956 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'platform' cannot be null

错误信息 "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'platform' cannot be null" 指出在尝试将数据插入数据库时遇到了完整性约束违规。具体来说,是因为 platform 这一列不能被设置为 NULL,但是你尝试插入的数据中 platform 列的值就是 NULL

在数据库中,完整性约束是用来确保数据准确性和一致性的规则。其中,NOT NULL 约束用来确保某列不能有 NULL 值。在你的数据库表中,platform 列很可能被设置为了 NOT NULL,这意味着在插入新记录时,你必须为 platform 列提供一个非 NULL 的值。

const instance = axios.create({
  baseURL: 'http://smart-shop.itheima.net/index.php?s=/api',
  timeout: 5000,
  headers: {
    platform: 'H5'
  }
})

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值