diff --git a/db.sql b/db.sql index 774d113..ec2cc82 100644 --- a/db.sql +++ b/db.sql @@ -28,7 +28,7 @@ create table article( comment_count int default 0, status tinyint(1) default 1 -- 状态 1标识草稿 2表示已发布 0表示已删除 ); -INSERT INTO article(title,publish_time,description,content,category) VALUES('测试1','2022-05-10 16:52:09','测试测试','测试测试测试测试','默认'); +INSERT INTO article(title,publish_time,description,content,category,cover) VALUES('测试1','2022-05-10 16:52:09','测试测试','测试测试测试测试','默认','https://www.liulinblog.com/wp-content/uploads/2022/05/1652233699-97014b5f43a5d59-300x200.webp'); INSERT INTO article(title,publish_time,description,content,category) VALUES('测试2','2022-05-10 16:52:09','测试测试','测试测试测试测试','默认'); INSERT INTO article(title,publish_time,description,content,category) VALUES('测试3','2022-05-10 16:52:09','测试测试','测试测试测试测试','默认'); INSERT INTO article(title,publish_time,description,content,category) VALUES('测试4','2022-05-10 16:52:09','测试测试','测试测试测试测试','默认'); @@ -38,6 +38,7 @@ INSERT INTO article(title,publish_time,description,content,category) VALUES('测 update article set cover = 'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png' +where cover is null; -- 评论表: 评论ID、文章ID、评论内容、发布时间、评论者IP create table comment ( diff --git a/public/index.html b/public/index.html index 13e1929..8e8db84 100644 --- a/public/index.html +++ b/public/index.html @@ -36,6 +36,7 @@ .container { width: 900px; + max-width: 90%; margin: auto; } @@ -109,34 +110,46 @@
request('http://localhost:3000/aricle/detail?id=1').then()...
- * request('http://localhost:3000/aricle/detail',{id:1}).then()...GET=>request('http://localhost:3000/aricle/detail?id=1').then()...
+ *GET=>request('http://localhost:3000/aricle/detail',{id:1}).then()...
* request('http://localhost:3000/aricle/detail',{id:1},'POST').then()...