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'
}
`