1 没给变化过的数据库表生成文件
主要是给taco_order表添加字段user_id 和 创建user表,类型我就瞎写了些,如下:
create table if not exists user (
id identity,
username varchar(50) not null,
fullname varchar(50) not null,
password varchar(500) not null,
street varchar(50) not null,
city varchar(50) not null,
state varchar(2) not null,
zip varchar(10) not null,
phone_number varchar(50) not null
);
2 因为原来的design视图的form没有th:action属性,导致403错误
给这个form添加
<input type="hidden" name="_csrf" th:value="${_csrf.token}">
其他的form有th:action属性,就不需要自己添加这个隐藏域了,Spring Security已经自动添加了。
因为这个防止CSRF,所以我们已经没法用http://localhost:8080/h2-console登录H2数据库了。。。坑呀,它自己的登录界面没有_csrf字段。。。