diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/Blog.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/Blog.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..77a528834b40ee19e169ef99c239d8d9b8a81fbf Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/Blog.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/bank/transfer.html" "b/\346\242\201\345\233\275\347\201\257/20210301/bank/transfer.html" new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/bank/transfer.html" @@ -0,0 +1 @@ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/bank/wallet.html" "b/\346\242\201\345\233\275\347\201\257/20210301/bank/wallet.html" new file mode 100644 index 0000000000000000000000000000000000000000..2cb15eb956493935f0d9defe6a94c4f596357bee --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/bank/wallet.html" @@ -0,0 +1,8 @@ + + + + + + + hello world! + diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/git\347\211\210\346\234\254\344\277\241\346\201\257.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/git\347\211\210\346\234\254\344\277\241\346\201\257.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..636b823cc00375732885aeb63b88cd0ccb85a177 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/git\347\211\210\346\234\254\344\277\241\346\201\257.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\210\235\345\247\213\345\214\226bank.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\210\235\345\247\213\345\214\226bank.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..29ff36d8e0cbc57c07b492dc36301b473a66a23a Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\210\235\345\247\213\345\214\226bank.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\234\250wallet.html\344\270\255\345\242\236\345\212\240\344\272\206\345\206\205\345\256\271.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\234\250wallet.html\344\270\255\345\242\236\345\212\240\344\272\206\345\206\205\345\256\271.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..ca046b542540e3bce9bdedc1c4e730b0d8204b4d Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\234\250wallet.html\344\270\255\345\242\236\345\212\240\344\272\206\345\206\205\345\256\271.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240index.html.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240index.html.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..f15f45a76ab958b75fb1dab0c1cabd09051080ec Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240index.html.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_detail.html.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_detail.html.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..158fb9db5d64cba1ffde436ee1455c8c28fe76c0 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_detail.html.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_list.html.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_list.html.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..44a7026677d5733cc3903ee75b40a70feec00f62 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240student_list.html.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240transfer.html.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240transfer.html.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..9d014095dc300f057e2e4a10d86839731d064739 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240transfer.html.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240wallet.html.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240wallet.html.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e3148e8566a37178ad6bde3c6a9cecb05e9dfd30 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\242\236\345\212\240wallet.html.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237.jpg" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..a4f3956557eab175118214c4f76fb3e14e537517 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/index.html" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/index.html" @@ -0,0 +1 @@ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_detail.html" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_detail.html" @@ -0,0 +1 @@ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_list.html" "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237/student_list.html" @@ -0,0 +1 @@ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210301/\350\257\276\345\240\202\347\273\203\344\271\240.txt" "b/\346\242\201\345\233\275\347\201\257/20210301/\350\257\276\345\240\202\347\273\203\344\271\240.txt" new file mode 100644 index 0000000000000000000000000000000000000000..64db15b8378417f1000810536fd5dd07f42cd323 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210301/\350\257\276\345\240\202\347\273\203\344\271\240.txt" @@ -0,0 +1,10 @@ +1. 林纳斯·托瓦兹为什么决定自己写一个版本管理软件,说下你的理解。 +原先合作的BitKeeper收回了Linux内核免费使用BitKeeper的权力。 + +2. 开源软件和闭源软件是什么?他们之间各有什么优缺点? +开源:开发者将某款软件或操作系统的源代码公开,允许任何人使用甚至修改,且不收取费用 + 优点:节省开发成本 + 缺点:安全性低,维护成本高 +闭源:开发者不将某款软件或操作系统的源代码公开,要使用这些软件或操作系统需要支付一定的费用,且不允许修改 + 优点:安全性强,维护成本低 + 缺点:需要支付费用使开发成本变高 diff --git "a/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..252668759f10de71aadb15d9f26e8715d72c435a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/css/main.css" @@ -0,0 +1,61 @@ +* { + padding: 0; + margin: 0; + user-select: none; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 280px; + height: 250px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; +} +.info input[type="text"], +.info input[type="password"] { + width: 100%; + height: 25px; + padding: 5px 0; + margin: 15px 0; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +/* 记住我 */ +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/index.html" "b/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..92c231569d315c88fde82529ab730638ecf4a09c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210302/\347\231\273\345\275\225\351\241\265\351\235\242/index.html" @@ -0,0 +1,25 @@ + + + + + + + 登录 + + + +
+ 员工OA系统 + + 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..c429f98b9b88ba6acc1a516effa534cc58371ffe --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/css/main.css" @@ -0,0 +1,56 @@ +* { + padding: 0; + margin: 0; + user-select: none; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 280px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + height: 25px; + padding: 5px 0; + margin: 15px 0; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/index.html" "b/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..ccac200a65021f3c4963c3eb5098d8275d93d377 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210303/\346\263\250\345\206\214\351\241\265\351\235\242/index.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 员工OA系统 + + 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245MySQL.jpg" "b/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245MySQL.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..3bfae45035f2b5f1667f3bebe4c4265ca02c1beb Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245MySQL.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245SQL Server.jpg" "b/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245SQL Server.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..c982537a77ae011d56da3ab5ac50c7b35a45bc6a Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210308/Navicat\350\277\236\346\216\245SQL Server.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210308/\345\273\272\345\272\223\343\200\201\345\210\240\345\272\223\346\223\215\344\275\234.jpg" "b/\346\242\201\345\233\275\347\201\257/20210308/\345\273\272\345\272\223\343\200\201\345\210\240\345\272\223\346\223\215\344\275\234.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..c96deef42e3b9353ab02341da5697e9a1030e0ec Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210308/\345\273\272\345\272\223\343\200\201\345\210\240\345\272\223\346\223\215\344\275\234.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210308/\350\257\276\345\240\202\347\273\203\344\271\240.txt" "b/\346\242\201\345\233\275\347\201\257/20210308/\350\257\276\345\240\202\347\273\203\344\271\240.txt" new file mode 100644 index 0000000000000000000000000000000000000000..edffa4b24a3f29d03796a6e9275644d31e42f31b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210308/\350\257\276\345\240\202\347\273\203\344\271\240.txt" @@ -0,0 +1,13 @@ +1. 登录阿里云平台,比较相同配置下:mysql服务器和sql server服务器的价格差距。 +2核8g: + MySQL: 10404元/年(85折) + SQL Server: 52244元/年(85折) + SQL Server价格约为MySQL的5倍多 +8核32g: + MySQL: 34884元/年(85折) + SQL Server: 205142元/年(85折) + SQL Server价格接近MySQL的6倍 +16核64g: + MySQL: 67524元/年(85折) + SQL Server: 409142元/年(85折) + SQL Server价格约为MySQL的6倍多 diff --git "a/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\345\255\227\346\256\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\345\255\227\346\256\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..65dbf7aaef950fd93a1b696a04a96bec677463b3 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\345\255\227\346\256\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\350\241\250\345\220\215.jpg" "b/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\350\241\250\345\220\215.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c160b700ca15d3cdd93eebb9845ba282377143a Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210309/\344\277\256\346\224\271\350\241\250\345\220\215.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210309/\345\273\272\350\241\250.jpg" "b/\346\242\201\345\233\275\347\201\257/20210309/\345\273\272\350\241\250.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..cbb843679ecc592666ef55df5e2c882c1731335c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210309/\345\273\272\350\241\250.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210309/\346\267\273\345\212\240\345\255\227\346\256\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210309/\346\267\273\345\212\240\345\255\227\346\256\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..67bf6cb9374c3629797d1c8e5fa1b16436702a0b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210309/\346\267\273\345\212\240\345\255\227\346\256\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210309/\350\257\276\345\240\202\347\273\203\344\271\240.txt" "b/\346\242\201\345\233\275\347\201\257/20210309/\350\257\276\345\240\202\347\273\203\344\271\240.txt" new file mode 100644 index 0000000000000000000000000000000000000000..3a854238cff9fdf9618d7876d48281c5d3b7133e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210309/\350\257\276\345\240\202\347\273\203\344\271\240.txt" @@ -0,0 +1,32 @@ +1、创建员工信息表employee,表引擎为innodb,表字符集为utf8mb4。 +字段名称 数据类型 其他要求 备注 +id INT(ll) 无符号,自增,不允许为空 员工编号 +name VARCHAR(25) 不允许为空 员工名称 +deptId INT(ll) 无符号,不允许为空,默认值为0 所在部门编号 +salary FLOAT(11,2) 无符号,不允许为空,默认值为0 工资 +update_time int(11) 无符号,不允许为空 修改时间 +add_time int(11) 无符号,不允许为空 增加时间 + +2、创建部门信息表department,表引擎为innodb,表字符集为utf8mb4。 +字段名称 数据类型 其他要求 备注 +deptId INT(ll) 无符号,自增,不允许为空 部门编号 +name VARCHAR(25) 不允许为空 部门名称 +level int(11) 无符号,不允许为空,默认值为0 部门等级 +parentDeptId INT(ll) 无符号,不允许为空, 默认值为0 上级部门编号 +deptLeader INT(ll) 无符号,不允许为空, 默认值为0 部门领导 +update_time int(11) 无符号,不允许为空 修改时间 +add_time int(11) 无符号,不允许为空 增加时间 + +1、根据前面创建表,需改表名: + 1. 修改 employee 表名为 employee_info。 + 2. 修改 department 表名为 department_info。 + +1、员工信息表增加如下字段: +字段名称 数据类型 其他要求 备注 +sex tinyint(3) 无符号,默认值为3 员工性别:1男2女3保密 +address VARCHAR(100) 不允许为空,默认值空字符串 住址 +join_time int(11) 不允许为空 入职时间 + +1、员工信息表工资salary字段进行修改: +字段名称 数据类型 其他要求 备注 +salary decimal(11,2) 无符号,不允许为空,默认值为0 工资 \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\345\225\206\345\223\201\350\241\250.jpg" "b/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\345\225\206\345\223\201\350\241\250.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..9daeb0b411e5f4cb4868b9a4c85e0515060142f9 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\345\225\206\345\223\201\350\241\250.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\350\264\255\347\211\251\350\275\246\350\241\250.jpg" "b/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\350\264\255\347\211\251\350\275\246\350\241\250.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..fcefc60db526f95db7f6f06046f8fcb6993524cc Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210310/\346\217\222\345\205\245\350\264\255\347\211\251\350\275\246\350\241\250.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210310/\350\257\276\345\240\202\347\273\203\344\271\240-\345\242\236\345\212\240\343\200\201\345\210\240\351\231\244\343\200\201\346\237\245\350\257\242.sql" "b/\346\242\201\345\233\275\347\201\257/20210310/\350\257\276\345\240\202\347\273\203\344\271\240-\345\242\236\345\212\240\343\200\201\345\210\240\351\231\244\343\200\201\346\237\245\350\257\242.sql" new file mode 100644 index 0000000000000000000000000000000000000000..01f7dc005c4b6d72081c62871c454bcdcc58b0ec --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210310/\350\257\276\345\240\202\347\273\203\344\271\240-\345\242\236\345\212\240\343\200\201\345\210\240\351\231\244\343\200\201\346\237\245\350\257\242.sql" @@ -0,0 +1,113 @@ +-- 创建库 +-- 创建电子商务数据库,eshop +CREATE DATABASE IF NOT EXISTS eshop + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +USE eshop; +-- 创建商品表item +CREATE TABLE `item` ( + `item_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品id', + `item_name` varchar(100) NOT NULL COMMENT '商品名称', + `item_price` decimal(10,2) NOT NULL COMMENT '商品价格', + PRIMARY KEY (`item_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表'; +-- 创建购物车表cart +CREATE TABLE `cart` ( + `cart_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(11) unsigned NOT NULL COMMENT '用户id', + `item_id` int(11) unsigned NOT NULL COMMENT '商品id', + `item_num` int(11) unsigned NOT NULL DEFAULT '1' COMMENT '商品数量', + `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '加入时间', + PRIMARY KEY (`cart_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +-- 插入数据 + +-- --------------------------------------商品表--------------------------------------------------------------- +-- 商品名 价格 +-- 小米全面屏电视 43英寸 E43K 全高清 DTS-HD 震撼音效 1GB+8GB 智能网络液晶平板电视 L43M5-EK 1349 +-- TCL 55L8 55英寸 4K超高清电视 智慧语音 超薄机身 杜比+DTS双解码 网络教育 智能液晶平板电视机 2199 +-- 海信 VIDAA 43V1F-R 43英寸 全高清 海信电视 全面屏电视 智慧屏 1G+8G 教育电视 人工智能液晶平板电视 1349 +-- 海信(Hisense)60E3F 60英寸 4K超高清 智慧语音 超薄悬浮全面屏大屏精致圆角液晶电视机 教育电视 人工智能 2699 +-- TCL 50L8 50英寸 4K超高清电视 智慧语音 超薄机身 杜比+DTS双解码 网络教育 智能液晶平板电视机 1999 +-- 长虹 55D4P 55英寸超薄无边全面屏 4K超高清 手机投屏 智能网络 教育电视 平板液晶电视机(黑色) 2099 +INSERT INTO item ( item_name, item_price ) +VALUES + ( '小米全面屏电视 43英寸 E43K 全高清 DTS-HD 震撼音效 1GB+8GB 智能网络液晶平板电视 L43M5-EK', 1349 ), + ( 'TCL 55L8 55英寸 4K超高清电视 智慧语音 超薄机身 杜比+DTS双解码 网络教育 智能液晶平板电视机', 2199 ), + ( '海信 VIDAA 43V1F-R 43英寸 全高清 海信电视 全面屏电视 智慧屏 1G+8G 教育电视 人工智能液晶平板电视', 1349 ), + ( '海信(Hisense)60E3F 60英寸 4K超高清 智慧语音 超薄悬浮全面屏大屏精致圆角液晶电视机 教育电视 人工智能', 2699 ), + ( 'TCL 50L8 50英寸 4K超高清电视 智慧语音 超薄机身 杜比+DTS双解码 网络教育 智能液晶平板电视机', 1999 ), + ( '长虹 55D4P 55英寸超薄无边全面屏 4K超高清 手机投屏 智能网络 教育电视 平板液晶电视机(黑色)', 2099 ); +-- --------------------------------------购物车--------------------------------------------------------------- +-- 用户id 商品id 商品数量 +-- 1 1 1 +-- 2 2 2 +-- 3 4 1 +-- 3 5 1 +-- 4 1 2 +INSERT INTO cart(user_id, item_id, item_num) +VALUES + (1, 1, 1), + (2, 2, 2), + (3, 4, 1), + (3, 5, 1), + (4, 1, 3); + +-- 查询练习 +-- 查询商品表所有数据。 +SELECT * FROM item; + +-- 查询价格小于2000的商品。 +SELECT * FROM item WHERE item_price < 2000; + +-- 查询名称中包含 海信 的商品。 +SELECT * from item WHERE item_name LIKE '%海信%'; + +-- 查询商品表,假设每页3条记录,查询第1页的数据。 +SELECT * FROM item LIMIT 3; + +-- 查询商品表,假设每页3条记录,查询第2页的数据。 +SELECT * FROM item LIMIT 3 OFFSET 3; + +-- 查询所有商品,按照价格进行升序排序。 +SELECT * FROM item ORDER BY item_price ASC; + +-- 查询价格小于2000的商品总数。 +SELECT COUNT(*) AS '价格小于2000的商品总数' FROM item WHERE item_price < 2000; + +-- 查询购物车中所有数据。 +SELECT * FROM cart; + +-- 查询每个用户加入购物车的商品总数。 +SELECT user_id, SUM(item_num) AS '商品总数' FROM cart GROUP BY user_id; + +-- 查询加入购物车的商品总数小于2的用户。 +SELECT user_id, SUM(item_num) AS '商品总数' FROM cart + GROUP BY user_id HAVING COUNT(*) < 2; + +-- 查询有加入购物车的商品。 +SELECT DISTINCT item.* FROM cart + INNER JOIN item ON cart.item_id = item.item_id; + +-- 查询没有加入购物车的商品。 +SELECT item.* FROM cart + RIGHT JOIN item ON cart.item_id = item.item_id + WHERE cart_id IS NULL; + +-- 删除数据 +-- 用户4将将商品1从购物车中移除。 +DELETE FROM cart WHERE user_id = 4 AND item_id = 1; +SELECT * FROM cart; + +-- 用户3清空购物车。 +DELETE FROM cart WHERE user_id = 3; + +-- 移除购物车中的所有数据: +-- 使用delete进行删除 +DELETE FROM cart; +-- 使用truncate进行删除 +TRUNCATE TABLE cart; +-- 对比delete和truncate的差别 +使用DELETE能仅删除一部分数据,而使用TRUNCATE则只能删除表中所有数据 +使用DELETE不会影响自增累计,使用TRUNCATE会使自增重新开始 +TRUNCATE删除效率比DELETE要高 \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\211\215\345\217\260\351\241\265\351\235\242.png" "b/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\211\215\345\217\260\351\241\265\351\235\242.png" new file mode 100644 index 0000000000000000000000000000000000000000..8af4682254fb75bc332b6e7707f7967564bdc6a6 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\211\215\345\217\260\351\241\265\351\235\242.png" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\220\216\345\217\260\347\225\214\351\235\242.png" "b/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\220\216\345\217\260\347\225\214\351\235\242.png" new file mode 100644 index 0000000000000000000000000000000000000000..45b4ff512a48bdff9f92b71b619bd13d6d8498c9 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210315/wordpress\345\220\216\345\217\260\347\225\214\351\235\242.png" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210315/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210315/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..7dad01a68a9ce09a8f16cc668f7d76163bd174e1 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210315/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\273\272\345\272\223sql.sql" "b/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\273\272\345\272\223sql.sql" new file mode 100644 index 0000000000000000000000000000000000000000..f92d67c49415630540b55cc88afc5087b0b517b9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210316/\345\215\232\345\256\242\345\273\272\345\272\223sql.sql" @@ -0,0 +1,29 @@ +-- 博客数据库 +CREATE DATABASE blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; + +USE blog; +-- 分类表 +CREATE TABLE `category` +( + category_id INT AUTO_INCREMENT COMMENT '分类id', + category_name VARCHAR(20) NOT NULL COMMENT '分类名称', + category_desc VARCHAR(200) NOT NULL COMMENT '分类描述', + update_time INT(11) NOT NULL COMMENT '修改时间', + add_time INT(11) NOT NULL COMMENT '增加时间', + PRIMARY KEY(category_id) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; + +-- 文章表 +CREATE TABLE `article` +( + article_id INT AUTO_INCREMENT COMMENT '文章id', + article_title VARCHAR(50) NOT NULL COMMENT '文章标题', + category_id INT NOT NULL COMMENT '文章所属分类', + article_author VARCHAR(20) DEFAULT '佚名', + article_content VARCHAR(10000) NOT NULL COMMENT '文章内容', + update_time INT(11) NOT NULL COMMENT '修改时间', + add_time INT(11) NOT NULL COMMENT '增加时间', + PRIMARY KEY (article_id) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; diff --git "a/\346\242\201\345\233\275\347\201\257/20210316/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210316/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a41963da44aff48882e3fe8f1bffa153680837d3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210316/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,17 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/admin-index.html" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/admin-index.html" new file mode 100644 index 0000000000000000000000000000000000000000..64c89f749cad58dd45e8f488c81b374a574a7d72 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/admin-index.html" @@ -0,0 +1,66 @@ + + + + + 后台首页 + + + +
+
+

博客管理系统

+
+ 欢迎你:admin + 退出登录 +
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
ID标题分类简介发布时间修改时间操作
1Vue新手入门指南web前端vue入门指南,适合刚接触vue的用户2021-0103 20:21:002021-0103 20:21:00编辑
+
+
+
+
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/backstage-detail.html" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/backstage-detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..029594cb6c352f22b206ff261b7172d469c5ede5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/backstage-detail.html" @@ -0,0 +1,72 @@ + + + + + 后台详情页 + + + +
+
+

博客管理系统

+
+ 欢迎你:admin + 退出登录 +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
新闻id:
新闻标题:
新闻分类: + +
新闻内容
+ + +
+
+
+
+
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/css/backstage.css" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/css/backstage.css" new file mode 100644 index 0000000000000000000000000000000000000000..2aebdeca58c2d2fdc3ea8d7b482f561eafc3ade8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/css/backstage.css" @@ -0,0 +1,138 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; +} +#content { + /* width: 1600px; */ + width: 100vw; + height: 100vh; + margin: auto; + background-color: white; +} +#info { + width: 100%; + height: 50px; + background-color: #336caf; + line-height: 50px; +} +#info .system { + width: 190px; + height: 100%; + background-color: #2e5f9a; + color: white; + float: left; + padding-left: 15px; +} +#info .user { + height: 100%; + float: right; + color: #ebf9ff; + margin-right: 10px; +} +#info .user a { + color: #bbe3ff; +} +#banner { + width: 205px; + height: 220px; + background-color: white; + float: left; +} +#banner .box { + width: 189px; + height: 100px; + background-color: white; + padding: 5px 0 0 15px; + border-right: 1px solid #d9d9d9; +} +#banner .box a { + width: 65px; + display: block; + color: black; + margin: 10px 0; +} +#banner .box a.selected { + color: #6B80A8; + text-decoration: underline; +} +#panel { + width: 1205px; + height: 220px; + background-color: white; + float: left; + padding-left: 15px; +} +#panel a { + color: #6B80A8; +} +#panel .path { + width: 100%; + margin: 15px 0; +} +#panel .task .functions { + margin: 15px 0; +} +#panel .task .functions button { + padding: 5px 8px; + background-color: #F0EEEF; + outline: none; + border: none; + border-radius: 2px; +} +#panel .task .functions button:hover { + cursor: pointer; + box-shadow: 0 0 3px #CCCCCC; +} +#panel .task .functions a:last-child { + text-align: right; + float: right; +} +#panel .task table { + border-collapse: collapse; + width: 100%; + text-align: center; +} +#panel .task table tr td { + border: 1px solid #DFDFDF; + padding: 5px 10px; +} +#panel .task.list table tr:first-child td { + font-weight: 700; +} +#panel .task.detail table { + text-align: left; +} +#panel .task.detail table tr td:first-child { + text-align: right; +} +#panel .task.detail table tr td input { + width: 300px; + height: 30px; + border: 1px solid #DFDFDF; + outline: none; + font-size: 16px; +} +#panel .task.detail table tr td select { + width: 100px; + height: 30px; + border: 1px solid #DFDFDF; + outline: none; +} +#panel .task.detail table tr td textarea { + border: 1px solid #DFDFDF; +} +#panel .task.detail table tr td button { + padding: 8px 11px; + background-color: #f0eeef; + outline: none; + border: none; + margin-right: 10px; + border-radius: 3px; +} +#panel .task.detail table tr td button:hover { + cursor: pointer; + box-shadow: 0 0 5px #CCCCCC; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..627191539d4609a01e7c641199f2f61176a0d09b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/css/main.css" @@ -0,0 +1,115 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#content { + width: 800px; + height: 745px; + background-color: skyblue; + margin: 10px auto; +} +#header { + width: 100%; + height: 200px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 50px; + padding: 60px 0 0 50px; +} +#header h1 + span { + margin-left: 120px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; +} +#banner li:first-child { + margin-left: 35px; +} +#banner li { + color: #FFFFFF; + list-style: none; + float: left; + margin: 10px; +} +#banner li:hover { + color: #E7FAA9; + cursor: pointer; +} +#banner li.action { + color: #4B3D2C; +} +#article-list { + width: 100%; + height: 500px; + background-color: white; +} +/* .article存在于#article-list中,为了兼容页面因而#article-list省略 */ +.article:first-child { + padding-top: 20px; +} +.article { + width: 770px; + height: 135px; + background-color: white; + margin-bottom: 10px; + padding-left: 30px; +} +.article.detail { + height: 520px; +} +.article .article-title { + color: #51432f; + width: 730px; + height: 35px; + border-bottom: 1px solid #E4F2C8; + margin-bottom: 10px; +} +.article .article-title h2 { + margin-left: 5px; +} +.article .article-title .time { + color: #6B6B69; + font-size: 13px; + display: block; + margin: -18px 0 0 155px; +} +.article .article-intro { + margin-left: 10px; + width: 700px; + background-color: white; + font-size: 15px; + margin-bottom: 15px; +} +.article a { + width: 100px; + height: 30px; + background-color: #FAF7F5; + text-decoration: none; + color: #977C57; + border: 1px solid #EEE8E1; + padding: 6px 8px; + margin-left: 8px; +} +#page { + width: 236px; + margin: auto; +} +#page a { + margin-left: 8px; + color: #977C57; + text-decoration: none; + user-select: none; +} +#copyright { + margin-top: 20px; + text-align: center; + margin-bottom: 10px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..d4e30bacc214f69c42f6b911d80bf9fba249a2b9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/detail.html" @@ -0,0 +1,53 @@ + + + + + 详情页 + + + +
+ + +
+
+

vue入门介绍

+ 2021-03-16 15:00:00 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+
+ +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210317/blog/img/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210317/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210317/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..27edd399038c9fafdd03f784a6f20e4f1c50d324 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210317/blog/index.html" @@ -0,0 +1,64 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-16 15:00:00 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-16 15:00:00 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-16 15:00:00 +
+
+ Vue(读音/vju:/,类似于view)是一套用于构建用户界面的渐进式JavaScript框架。与其它大型框架不同的是,Vue被设计为可自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方或既有项目整合。 +
+ 阅读全文 +
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..b4bb1b993b7a7fce3d50cc081aa243cf716a7417 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add.php" @@ -0,0 +1,74 @@ + + + + + 增加文章 + + + + +
+ +
+ +
+ + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..b9fd0c8a10c27d762d647d5341fc2ece0cadf7c6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_add_check.php" @@ -0,0 +1,18 @@ +query("set names utf8"); +$category_name = $_POST['category_name']; +$category_desc = $_POST['category_desc']; +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$category_name}', '{$category_desc}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'yes'; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..35ae2448c03427f70bd28119667ce596d45560f2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_delete.php" @@ -0,0 +1,15 @@ +query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "yes"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..eafb514f093702a91b732c35c1c2e354f80c3935 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit.php" @@ -0,0 +1,89 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ +
+ +
+ + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5424129df2c388767c08bca1778ac681c3876cc7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_edit_check.php" @@ -0,0 +1,18 @@ +query("set names utf8"); +$category_id = $_POST['category_id']; +$category_name = $_POST['category_name']; +$category_desc = $_POST['category_desc']; +$sql = "UPDATE category SET category_name = '{$category_name}', category_desc = '{$category_desc}' WHERE category_id = {$category_id}"; +$result = $db->exec($sql); +if ($result) { + echo 'yes'; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..1ea308792e813467a0b6d7e2734c0b34e3fb07b1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/admin/category_list.php" @@ -0,0 +1,91 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ +
+ +
+ +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..ead6165710e313522246e7d5742843a6d089d859 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..6b52c81a4a12693d47be91d184befdf835b880be --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/css/main.css" @@ -0,0 +1,109 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: 24px auto; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..1f29a0a2953af4ea68869e8d82c4689f72848810 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,31 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" new file mode 100644 index 0000000000000000000000000000000000000000..7a4e966017a239e6197898efd12615afd6a1843e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" @@ -0,0 +1,27 @@ +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())) + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a41963da44aff48882e3fe8f1bffa153680837d3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/doc/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,17 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..47168a858876bb7c326de3af4a61dbb9d97c7ade --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a:nth-of-type(2) { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210321/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..e1c679a1bee181c3f3ccef8e030e832a669a4cd9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add.php" @@ -0,0 +1,106 @@ +query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..9c2a31fc887b6426efe9c5faac98fb75e0279f10 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_add_check.php" @@ -0,0 +1,23 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +$sql = "INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$articleAuthor}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..2598722543149e0145c73c6337b2e9c8d392956d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_delete.php" @@ -0,0 +1,18 @@ +query("set names utf8"); + +$articleId = $_POST['article_id']; + +$sql = "DELETE FROM article WHERE article_id = {$articleId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { +echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..21d4997b2633aa95c3213d19dbf59a20ba8a5c86 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit.php" @@ -0,0 +1,122 @@ +query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..cf7a0725cd5ef6aeca8884642de3f1876646ad8e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_edit_check.php" @@ -0,0 +1,32 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; +$articleId = $_POST['article_id']; + +$sql = + "UPDATE article + SET + article_title = '{$articleTitle}', + article_intro = '{$articleIntro}', + article_author = '{$articleAuthor}', + category_id = '{$categoryId}', + article_content = '{$articleContent}', + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..14761591b1ab4771e975d2ae0a9cb616ceee544d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/article_list.php" @@ -0,0 +1,108 @@ +query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..6b6e45341beb22687388b148b6289156a4a306a2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add.php" @@ -0,0 +1,74 @@ + + + + + 增加文章 + + + + +
+ + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..ae845a975efc5ecb783af71be7d6662435c27511 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_add_check.php" @@ -0,0 +1,20 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..33c91c16573a9ab0ca1d7c2fcf54c00ec7f0a26d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_delete.php" @@ -0,0 +1,25 @@ +query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); +} +$sql = "DELETE FROM category WHERE category_id = {$_POST['category_id']}"; +$db->query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..322506c24ae2f5b514642da295254f2d7d2fbd92 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit.php" @@ -0,0 +1,91 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..a2c09ff8a49403d726502d44a6bd7d26dbb4668d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_edit_check.php" @@ -0,0 +1,25 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; +$categoryId = $_POST['category_id']; + +$sql = "UPDATE category + SET + category_name = '{$categoryName}', + category_desc = '{$categoryDesc}', + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..bc255020213c3df8b060877ce52ecde0a3f58302 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/admin/category_list.php" @@ -0,0 +1,91 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..ead6165710e313522246e7d5742843a6d089d859 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..de8d057bcf8954863162bba32de29576d192cc2f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,31 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" new file mode 100644 index 0000000000000000000000000000000000000000..7a4e966017a239e6197898efd12615afd6a1843e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" @@ -0,0 +1,27 @@ +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())) + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a41963da44aff48882e3fe8f1bffa153680837d3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/doc/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,17 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210322/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..87a8b36a0d2cf911d92f09121fcb799a2632b12f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add.php" @@ -0,0 +1,112 @@ +query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..f8971ce2f61cc5907fc8b6911b60a8ebe588ff84 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_add_check.php" @@ -0,0 +1,36 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}';"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 1) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$articleAuthor}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..f77d5e5ffbaa446b73087f3708285804bdce7127 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_delete.php" @@ -0,0 +1,23 @@ +query("set names utf8"); + +$articleId = $_POST['article_id']; + +$sql = "DELETE FROM article WHERE article_id = {$articleId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { +echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..bb2dd9bdb3d786b8d19483e95b125bdee3a92fad --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit.php" @@ -0,0 +1,128 @@ +query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..12c70c96e12c1a304b3854c880838f083be8a581 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_edit_check.php" @@ -0,0 +1,37 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; +$articleId = $_POST['article_id']; + +$sql = + "UPDATE article + SET + article_title = '{$articleTitle}', + article_intro = '{$articleIntro}', + article_author = '{$articleAuthor}', + category_id = '{$categoryId}', + article_content = '{$articleContent}', + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..d8ee340949f5774812187f51bd07ebe9fc967ac1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/article_list.php" @@ -0,0 +1,130 @@ +query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..7c581e580aae1b7e9c3a3e70540b280b935ce9dc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add.php" @@ -0,0 +1,82 @@ + + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..97985c321e241df2fcd22700a527c073a13f8a20 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_add_check.php" @@ -0,0 +1,31 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}';"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 1) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..a59e25119ca9a41cd89c90c678589120851dd0fb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_delete.php" @@ -0,0 +1,30 @@ +query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); +} +$sql = "DELETE FROM category WHERE category_id = {$_POST['category_id']}"; +$db->query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..f5b942f419d6dcfc6289b0978e6b04c18cd4a641 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit.php" @@ -0,0 +1,97 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..797300f93866ac20ecb5ddc22a3e2105edab9082 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_edit_check.php" @@ -0,0 +1,30 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; +$categoryId = $_POST['category_id']; + +$sql = "UPDATE category + SET + category_name = '{$categoryName}', + category_desc = '{$categoryDesc}', + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..84e6da4825a7922c0553c33d0fd2ee325bb95e8a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/category_list.php" @@ -0,0 +1,100 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..1f6d93407cc59283b1d9d79e750b84c458cdf706 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login.php" @@ -0,0 +1,51 @@ + + + + + + + 登录 + + + + +
+ 博客系统 +
+ +
+ 新用户?创建账号 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..db247034d2a9ddbf7f40ad4ccacc0a00aa96eb3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/login_check.php" @@ -0,0 +1,26 @@ +query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminPassword = $_POST['admin_password']; + +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +$password = $adminInfo['admin_password']; +if ($adminInfo) { + if ($adminPassword === $password) { + setcookie('admin_name', $adminName); + echo "ok"; + } else { + echo "密码错误,请检查后再试"; + } +} else { + echo "用户名不存在,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..7f8162729fb3684a888a0f42fc40c3bb628325a2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/logout.php" @@ -0,0 +1,10 @@ + + + + + + + 注册 + + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..c1b2b04241543ecfb25ebdd6447cb10086e9fd4b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/admin/register_check.php" @@ -0,0 +1,46 @@ +query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 检查数据库中是否已存在用户名 +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}';"; +$result = $db->query($sql); +$nameFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($nameFlag) { + echo "该用户名已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}'"; +$result = $db->query($sql); +$emailFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($emailFlag) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..ead6165710e313522246e7d5742843a6d089d859 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..29d37b8a6db8eeea31e621fc1f9303d4e075606c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/login.css" @@ -0,0 +1,82 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 280px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 220px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..ddb10bec44105fa831539451a13a2ee6739e9b2c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..c7d54f41b1ed4b2d87029f88a9c1484d188ca6b4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,42 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(30) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(11) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" new file mode 100644 index 0000000000000000000000000000000000000000..d1d49dd1cd2bb397d91092a6c33678ab4e1ed4f8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" @@ -0,0 +1,31 @@ +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time) +VALUES ('小红', '123456789@qq.com', '123456', UNIX_TIMESTAMP(now())); + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..afdc4ca055ca86bf13619e1321d3bc8ae94e439b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/doc/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,23 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(30) ǿ + Ա ַ(10) ǿ + Աעʱ int(11) ʱ ǿ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..953e941e767fcf0642d247c883c7995e697f6764 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/js/admin-main.js" @@ -0,0 +1,84 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + $('.check-box').prop('checked', true); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + 'del=1&category_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + 'del=1&article_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..33bc02845e1613c15e2179687163e0b52c05b190 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/login.css" @@ -0,0 +1,80 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 280px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + border: none; + font-size: 16px; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210323/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..845a9793010dbe2fd5b177d0b8b4aa0aee3c773f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add.php" @@ -0,0 +1,113 @@ +query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..3e28c9fca8a5ce829c181b3eded7ec36881b8a76 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_add_check.php" @@ -0,0 +1,36 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}';"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 1) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$articleAuthor}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..ec1299b6206f4d5ce21396a987e1e5083e50bbfd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_delete.php" @@ -0,0 +1,23 @@ +query("set names utf8"); + +$articleId = $_POST['article_id']; + +$sql = "DELETE FROM article WHERE article_id = {$articleId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { +echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..c93481e496b7aab8f4dbca9b17a3460b185a21ac --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit.php" @@ -0,0 +1,129 @@ +query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..0a9fc91b78026f36a03640fbdb24bcb228d9bb7b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_edit_check.php" @@ -0,0 +1,37 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; +$articleId = $_POST['article_id']; + +$sql = + "UPDATE article + SET + article_title = '{$articleTitle}', + article_intro = '{$articleIntro}', + article_author = '{$articleAuthor}', + category_id = '{$categoryId}', + article_content = '{$articleContent}', + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..2adf98e47084aa3ff6fe08d6db986e6d73480c91 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/article_list.php" @@ -0,0 +1,116 @@ +query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..c5714b1bd9be6a57043ccd06356635590e1beeba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add.php" @@ -0,0 +1,83 @@ + + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..7bba46a34e363954d5dc216f67974002cb4cafce --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_add_check.php" @@ -0,0 +1,31 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}';"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 1) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..dd39f3b54a7435ffb8e1660eeb9a25eb5d0737a3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_delete.php" @@ -0,0 +1,31 @@ +query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); +} +$sql = "DELETE FROM category WHERE category_id = {$_POST['category_id']}"; +$db->query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..d5557fab0b86853ce5564bf84d3adcf669b10b71 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit.php" @@ -0,0 +1,98 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..1412234f697d65c96c4db447c727886210e183cf --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_edit_check.php" @@ -0,0 +1,31 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; +$categoryId = $_POST['category_id']; + +$sql = "UPDATE category + SET + category_name = '{$categoryName}', + category_desc = '{$categoryDesc}', + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..537165b85e791a7dffe2af452892a454643c8e3b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/category_list.php" @@ -0,0 +1,101 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..1f6d93407cc59283b1d9d79e750b84c458cdf706 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login.php" @@ -0,0 +1,51 @@ + + + + + + + 登录 + + + + +
+ 博客系统 +
+ +
+ 新用户?创建账号 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5fe8a63ee60f5fec95c768d366967d778591212d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/login_check.php" @@ -0,0 +1,33 @@ +query("set names utf8"); + + +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $password = $adminInfo['admin_password']; + if ($adminPassword === $password) { + session_start(); + $_SESSION['adminName'] = $adminName; + echo "ok"; + } else { + echo "密码错误,请检查后再试"; + } +} else { + echo "用户名不存在,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..1d47c00141d814c500f992dd1a4132a1c47e07cc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/logout.php" @@ -0,0 +1,12 @@ + + + + + + + 注册 + + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..a8b8fb2f77fba72f8b00ca724eddfaa07da4822f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/admin/register_check.php" @@ -0,0 +1,63 @@ +query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 密码长度验证 +if (mb_strlen(trim($adminPassword)) < 6) { + exit('密码至少为6位'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}';"; +$result = $db->query($sql); +$nameFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($nameFlag) { + echo "该用户名已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}'"; +$result = $db->query($sql); +$emailFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($emailFlag) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..82695234b0223f4fef9eda778b630043e199e620 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/admin-main.css" @@ -0,0 +1,119 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..5c7b45866eb7701217dc546e9d981fecbd5db455 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; + } +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 220px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..fa1a32c793871ecfcd72c81cd21623af347912da Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..c7d54f41b1ed4b2d87029f88a9c1484d188ca6b4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,42 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(30) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(11) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" new file mode 100644 index 0000000000000000000000000000000000000000..d1d49dd1cd2bb397d91092a6c33678ab4e1ed4f8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" @@ -0,0 +1,31 @@ +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time) +VALUES ('小红', '123456789@qq.com', '123456', UNIX_TIMESTAMP(now())); + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..afdc4ca055ca86bf13619e1321d3bc8ae94e439b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/doc/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,23 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(30) ǿ + Ա ַ(10) ǿ + Աעʱ int(11) ʱ ǿ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..953e941e767fcf0642d247c883c7995e697f6764 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/js/admin-main.js" @@ -0,0 +1,84 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + $('.check-box').prop('checked', true); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + 'del=1&category_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + 'del=1&article_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/lib/form_check.php" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/lib/form_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..beceef79b8e45828eff70a4606e6a0472d188bd2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/lib/form_check.php" @@ -0,0 +1,7 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210324/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..d687f3282c987c4722927f53e4d69bd242bbb718 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add.php" @@ -0,0 +1,116 @@ +query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..576b5cb17467da3bfc7a3a65d160f5ded83a0081 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_add_check.php" @@ -0,0 +1,56 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 表单验证 +include_once "../lib/form_check.php"; +// 空值验证 +nullCheck($articleTitle, '文章标题不能为空'); +nullCheck($articleContent, '文章内容不能为空'); + +// 长度验证 +lenCheck($articleTitle, 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($articleIntro) > 0) { + lenCheck($articleIntro, 5, 50, '文章简介长度为5~50个字'); +} else { + $articleIntro = "这个作者很懒,什么都没有写"; +} +if (mb_strlen($articleAuthor) > 0) { + lenCheck($articleAuthor, 2, 10, '作者名称长度为2~10个字'); +} else { + $articleAuthor = "佚名"; +} +lenCheck($articleContent, 20, 8000, '文章内容长度为20~800个字'); + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}';"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 1) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$articleAuthor}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..82e110b22ea699ab4ef0dbbd964fd4e4ae3a20dc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_delete.php" @@ -0,0 +1,23 @@ +query("set names utf8"); + +$articleId = $_POST['article_id']; + +$sql = "DELETE FROM article WHERE article_id = {$articleId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { +echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..a3888d4818024084f87149cde02d0542db4c2dd3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit.php" @@ -0,0 +1,131 @@ +query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..ba3d079237e3e2d76ccbff225a0aee46b91ea8df --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_edit_check.php" @@ -0,0 +1,37 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; +$articleId = $_POST['article_id']; + +$sql = + "UPDATE article + SET + article_title = '{$articleTitle}', + article_intro = '{$articleIntro}', + article_author = '{$articleAuthor}', + category_id = '{$categoryId}', + article_content = '{$articleContent}', + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..aae272f0accf9aa0d0bfe9f88e8e92b71f14a8ae --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/article_list.php" @@ -0,0 +1,119 @@ +query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..2e4ad781468f6220eda2d2490ac698e8c1a8ede5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add.php" @@ -0,0 +1,86 @@ + + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5ed81febe0968921e6751f3a3a2d1bc7bbb45e76 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_add_check.php" @@ -0,0 +1,42 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($categoryName, '分类名称不能为空'); +nullCheck($categoryDesc, '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($categoryName, 2, 15, '分类名称长度为2~15个字'); +lenCheck($categoryDesc, 10, 100, '分类描述长度为10~100个字'); + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}';"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 1) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..28091d0d06c29ad3a36c79fa1cfe68152dd9182b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_delete.php" @@ -0,0 +1,31 @@ +query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); +} +$sql = "DELETE FROM category WHERE category_id = {$_POST['category_id']}"; +$db->query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..10b990a82b9dfb9116e7a7540a8a41f0b4cafe87 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit.php" @@ -0,0 +1,100 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..012dbced0b476dd3b8b9b59d499dcf57ce484202 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_edit_check.php" @@ -0,0 +1,40 @@ +query("set names utf8"); + +$categoryName = $_REQUEST['category_name']; +$categoryDesc = $_POST['category_desc']; +$categoryId = $_POST['category_id']; +$sql = "UPDATE category + SET + category_name = '{$categoryName}', + category_desc = '{$categoryDesc}', + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..3f3a183bf1f6c5987627eca4caf060ba498ce40d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/category_list.php" @@ -0,0 +1,104 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..ad0aa226d827d9809b9cc3084ebcde04e2e3290c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login.php" @@ -0,0 +1,60 @@ +alert('您已登录,正在跳转主页');location.assign('article_list.php');"; + exit(); +} +?> + + + + + + + 登录 + + + + +
+ 博客系统 +
+ +
+ 新用户?创建账号 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5fe8a63ee60f5fec95c768d366967d778591212d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/login_check.php" @@ -0,0 +1,33 @@ +query("set names utf8"); + + +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $password = $adminInfo['admin_password']; + if ($adminPassword === $password) { + session_start(); + $_SESSION['adminName'] = $adminName; + echo "ok"; + } else { + echo "密码错误,请检查后再试"; + } +} else { + echo "用户名不存在,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..1d47c00141d814c500f992dd1a4132a1c47e07cc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/logout.php" @@ -0,0 +1,12 @@ + + + + + + + 注册 + + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..987fc5fdf638b2ecda279ec8e6824d3ee212bf61 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/admin/register_check.php" @@ -0,0 +1,62 @@ +query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 长度验证 +lenCheck($adminName, 1, 10, '用户名长度为 1~10个字'); +lenCheck($adminPassword, 6, 12, '密码长度为6~12个字'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}';"; +$result = $db->query($sql); +$nameFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($nameFlag) { + echo "该用户名已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}'"; +$result = $db->query($sql); +$emailFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($emailFlag) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..df71dc76ba679d9356e631c695cea71863c5c51b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/admin-main.css" @@ -0,0 +1,120 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; + font-weight: 700; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..5c7b45866eb7701217dc546e9d981fecbd5db455 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; + } +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 220px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..8849268d2c7812cd90e7377908b73f2dedcc332c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..c7d54f41b1ed4b2d87029f88a9c1484d188ca6b4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,42 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(30) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(11) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..46efc51790191b474e35c77e50fa643abe707f24 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" new file mode 100644 index 0000000000000000000000000000000000000000..d788b350a296e26f0c96b58a9c1d0117df370057 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\346\265\213\350\257\225\344\277\241\346\201\257.sql" @@ -0,0 +1,32 @@ +USE blog; +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time) +VALUES ('小红', '123456789@qq.com', '123456', UNIX_TIMESTAMP(now())); + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..afdc4ca055ca86bf13619e1321d3bc8ae94e439b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/doc/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,23 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(30) ǿ + Ա ַ(10) ǿ + Աעʱ int(11) ʱ ǿ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..953e941e767fcf0642d247c883c7995e697f6764 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/js/admin-main.js" @@ -0,0 +1,84 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + $('.check-box').prop('checked', true); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + 'del=1&category_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + 'del=1&article_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/lib/form_check.php" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/lib/form_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..c5556c8b41e7ac316b3c8d2a3a53e7e6277d04d6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/lib/form_check.php" @@ -0,0 +1,12 @@ + $maxLen) { + exit($tip); + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210325/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie.md" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie.md" new file mode 100644 index 0000000000000000000000000000000000000000..5661430abfcb23a78755878eea55d18f6f6b4911 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie.md" @@ -0,0 +1,131 @@ +## 本节目标 + +1. 了解cookie概念 +2. 熟悉cookie的设置、获取和删除 + +## 什么是cookie + +cookie 常用于识别用户。**cookie 是一种服务器留在用户计算机上的小文件**。 + +每当同一台计算机通过浏览器请求页面时,这台计算机将会发送 cookie。 + +通过 PHP,您能够创建并取回 cookie 的值。 + +### cookie的流程 + +![](01_cookie_files/1.jpg) + +1. 请求服务端,服务端设置cookie到http返回头。 +2. 客户端接收到cookie信息,在本地保存cookie。 +3. 客户端再次请求服务端,会带上cookie信息。 + +## 设置cookie + +php中使用 setcookie() 函数设置 cookie,cookie是一个键值对的数据。 + +语法: + + setcookie($name, $value, $expire, $path, $domain); + +参数说明: + + $name 表示键。 + $value 表示值。 + $expire 表示过期时间,是一个时间戳。 + $path 表示作用路径。 + $domain 表示作用域名。 + +返回值: + + 返回布尔值,设置成功返回 true,设置失败返回 false。 + +示例1,在下面的例子中,我们将创建名为 "userId" 的 cookie,并为它赋值 1,在一小时后过期: + +```php +setcookie("userId", 1, time() + 3600); +``` + +请求页面,查看http响应头,可以看到返回了刚才创建的cookie。 + +![](01_cookie_files/2.jpg) + +示例2,设置用户名 "userName" 的 cookie,并赋值为:上帝打手,并且永不过期: + +```php +setrawcookie("userName", "上帝打手"); +``` + +![](01_cookie_files/3.jpg) + +这边%开头的字符,是对上帝打手的转义,可以不管。 + +大家可以看下这边设置userName和前面设置userId有什么不一样的地方? + + ## 获取cookie + +cookie 设置好了之后,怎么获取cookie呢?PHP 的 $_COOKIE 变量用于取回 cookie 的值。 + +示例1,获取刚刚设置的名为 "userId" 的cookie,并把它显示在了页面上: + +```php +// 输出 cookie 值 +echo $_COOKIE["userId"]; + +// 查看所有 cookie +print_r($_COOKIE); +``` + +查看http请求头,可以看到浏览器带上了cookie信息: + +![](01_cookie_files/4.jpg) + +示例2,我们使用 empty() 函数来确认是否已设置了名称为 "userName" 的 cookie: + +```html + + + +cookie获取测试 + + + +"; +else + echo "普通访客!
"; +?> + + + +``` + +## 删除cookie + +php中没有直接删除cookie得函数,但是通过设置过期时间可以变相实现。 + +示例1,删除名称为 "userName" 的 cookie,使过期日期变更为过去的时间点: + +```php +// 设置 cookie 过期时间为过去 1 小时 +setcookie("userName", "", time()-3600); +``` + +运行代码查看http响应头,可以发现名称为 "userName" 的 cookie被删除了: + +![](01_cookie_files/5.jpg) + +大家可以看下是否还能取到userName这个cookie? + +## 总结 + +本章主要就是讲解cookie的操作: + + 1. 设置cookie,使用setcookie()函数。 + 2. 获取cookie,使用$_COOKIE超全局变量。 + 3. 删除cookie,设置cookie时间过期即可。 + +## 练习 + +1. 完成课堂上讲解的习题,并通过浏览器调试工具进行观察。 +2. 设计一个程序,当用户登录成功后,记录下用户登录的时间,并显示在页面。 \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/1.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/1.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..d4d93ec51278b33b36200aa38f45a93644733cf9 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/1.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/2.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/2.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..84c5038dfb5c8aad11ba8ebf993f0dd9166318bb Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/2.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/3.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/3.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..95d155581e116a414580d8ff68aeb9ee65dfd16a Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/3.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/4.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/4.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..c394916b193510886d37bc1e06ecf9b67e34cffe Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/4.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/5.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/5.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..0447514848dab5313ec86de7e79e19c2e9e4ecbc Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/01_cookie_files/5.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session.md" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session.md" new file mode 100644 index 0000000000000000000000000000000000000000..cf1901c270432ee77202bb6c53518b0c3dde45e2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session.md" @@ -0,0 +1,118 @@ +## 本节目标 + +1. 了解session概念 +2. 熟悉session的设置、获取和删除 + +## 什么是session + +您在计算机上操作某个应用程序时,您打开它,做些更改,然后关闭它,这很像一次对话(session)。 + +计算机知道您是谁,它清楚您在何时打开和关闭应用程序。 + +然而,在因特网上问题出现了:由于 HTTP 地址无法保持状态,Web 服务器并不知道您是谁以及您做了什么。 + +PHP session 解决了这个问题,它通过在服务器上存储用户信息以便随后使用(比如用户名称、购买商品等)。 + +然而,会话信息是临时的,在用户离开网站后将被删除。如果您需要永久存储信息,可以把数据存储在数据库中。 + +session 的工作机制是:为每个访客创建一个唯一的 id (PHPSESSID),并基于这个 PHPSESSID 来存储变量。 + +PHPSESSID 存储在 cookie 中,或者通过 URL 进行传导。 + +## 开启session + +在使用session前,首先必须启动会话: + +```php +session_start(); +``` + +上面的代码会向服务器注册用户的会话,以便您可以开始保存用户信息,同时会为用户会话分配一个 PHPSESSID。 + +![](02_session_files/1.jpg) + +## 设置session + +session开启之后就可以使用了,直接使用全局变量 $_SESSION 设置就可以了。 + +示例1,设置名称为 userId 的值为 1: + +```php +$_SESSION['userId'] = 1; +``` + +示例2,设置名称为 userName 的值为 上帝打手: + +```php +$_SESSION['userName'] = "上帝打手"; +``` + +## 获取session值 + +和设置类似,直接使用 $_SESSION 获取就可以了: + +```html + + + + + cookie获取测试 + + + +"; +else + echo "普通访客!
"; +?> + + + +``` + +## 删除session + +### 使用unset()删除单个session + +示例1,使用unset()删除userId: + +```php +unset($_SESSION['userId']); +``` + +### 使用session_destroy()删除所有session + +```php +session_destroy(); +``` + +## 查看session信息 + +通过phpinfo可以查看session信息: + +![](02_session_files/2.jpg) + +其中: + + session.name 上面cookie的名字。 + session.save_path 表示session存储的目录。 + +上例 session.save_path 为空,一般window默认在:C:\Windows\Temp目录。 + +## 总结 + +本章主要就是讲解session的操作: + + 1. 设置session,使用 $_SESSION 超全局变量。 + 2. 获取session,使用 $_SESSION 超全局变量。 + 3. 删除session,使用unset()或者session_destroy()删除。 + +## 练习 + +1. 完成课堂上讲解的习题,并通过浏览器调试工具进行观察。 +2. 设计一个程序,可以记录每个用户访问页面的次数,每个用户分别记录。 + 1. 例如用户1第一次访问index.php页面,那么次数为1,再次访问那么为2。 + 2. 用户2和用户1的访问次数分开计算。 diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/1.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/1.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..8715b7112f55e6cd98184e49d21f39bc50c00c9b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/1.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/2.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/2.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..a5fab5cf595c1549ed98ac48f8415e1900d25427 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/02_session_files/2.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230.md" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230.md" new file mode 100644 index 0000000000000000000000000000000000000000..dd4081d9bc81afc2b9e2bf31fa3ca585ae8e0763 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230.md" @@ -0,0 +1,25 @@ +## 素材准备 + +练习题是从上个版本继续迭代开发,素材参考:03_练习题模板素材 目录 + +## 课堂练习 + +1. 博客后台管理系统的增加登录功能,使用session实现。 + 1. 需求分析,并画出原型图。 + 2. 管理员列表 + 3. 管理员增加 + 4. 管理员编辑 + 5. 管理员登录 + 6. 管理员登出 + 2. ui设计参考附录图片 + 3. 设计数据表结构 + 4. 设计代码结构 + 5. 功能开发: + 1. 静态页面编写。 + 2. 管理员相关功能实现。 + 6. 测试。 + 7. 部署上线。 + +## 附录UI设计 + +![](03_练习题_files/1.jpg) \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230_files/1.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230_files/1.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..d4a0881fefbc5f22930837fd8513c603ca804dcb Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230_files/1.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/blog.sql" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/blog.sql" new file mode 100644 index 0000000000000000000000000000000000000000..847f44c04fe7105f9f01c19d42e222169d58111c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/blog.sql" @@ -0,0 +1,54 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50730 +Source Host : 127.0.0.1:3306 +Source Database : blog + +Target Server Type : MYSQL +Target Server Version : 50730 +File Encoding : 65001 + +Date: 2021-03-22 15:49:57 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for article +-- ---------------------------- +DROP TABLE IF EXISTS `article`; +CREATE TABLE `article` ( + `article_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `category_id` int(11) NOT NULL COMMENT '所属分类', + `article_title` varchar(45) NOT NULL COMMENT '标题', + `intro` varchar(200) NOT NULL comment '文章简介', + `content` longtext NOT NULL COMMENT '文章内容', + `update_time` int(11) NOT NULL COMMENT '更新时间', + `add_time` int(11) NOT NULL COMMENT '增加时间', + PRIMARY KEY (`article_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; + +-- ---------------------------- +-- Records of article +-- ---------------------------- +INSERT INTO `article` VALUES ('1', '1', 'mysql索引', 'mysql索引介绍', 'mysql索引语法', '1616399101', '1616399101'); + +-- ---------------------------- +-- Table structure for category +-- ---------------------------- +DROP TABLE IF EXISTS `category`; +CREATE TABLE `category` ( + `category_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `category_name` varchar(45) NOT NULL COMMENT '分类名称', + `category_desc` varchar(255) NOT NULL COMMENT '分类描述', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '记录更新时间', + `add_time` int(11) NOT NULL COMMENT '记录增加时间', + PRIMARY KEY (`category_id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='分类表'; +-- ---------------------------- +-- Records of category +-- ---------------------------- +INSERT INTO `category` VALUES ('1', 'mysql', 'mysql基础知识', '1616397910', '1616394376'); +INSERT INTO `category` VALUES ('7', 'html&css', 'html和css基础知识', '1616396857', '1616396857'); diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/\345\215\232\345\256\242.rp" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/\345\215\232\345\256\242.rp" new file mode 100644 index 0000000000000000000000000000000000000000..69c35c6a34d0cc2f758bcad068da5da00cb24691 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/docs/\345\215\232\345\256\242.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..3ccd5e2b2a1ec701af0c80215cef2b3282825401 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add.php" @@ -0,0 +1,86 @@ +query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add_save.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add_save.php" new file mode 100644 index 0000000000000000000000000000000000000000..74d7a512b8ea1f3199a807e6db29a38a8c3e7c69 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_add_save.php" @@ -0,0 +1,50 @@ + 50) { + echo '文章标题限制5~50个字'; + echo '返回上一页'; + exit(); +} +// 10~100 +if (mb_strlen($intro) < 10 || mb_strlen($intro) > 100) { + echo '简介限制10~100个字'; + echo '返回上一页'; + exit(); +} +// 10~8000 +if (mb_strlen($content) < 10 || mb_strlen($content) > 8000) { + echo '文章内容10~8000个字。'; + echo '返回上一页'; + exit(); +} +if (empty($categoryId)) { + echo '需要选择文章分类。'; + echo '返回上一页'; + exit(); +} + +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +$addTime = time(); +$updateTime = $addTime; + +$sql = "insert into article (article_title, category_id, intro, content, add_time, update_time) + values ('$articleTitle', '$categoryId', '$intro', '$content', '$addTime', '$updateTime')"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "插入成功。返回列表页"; + exit(); +} else { + echo "插入失败,错误信息:" . $db->errorInfo()[2] . ",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..8876f430c147b5f7955669603edb6a3a4db497b7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_delete.php" @@ -0,0 +1,27 @@ +返回上一页'; + exit(); +} +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +$sql = "delete from article where article_id='$articleId'"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "删除成功。返回列表页"; + exit(); +} else { + echo "删除失败,错误信息:" . $db->errorInfo()[2].",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..24113a4cbefb4d1dd66eb2f49e8dcba1214c9948 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit.php" @@ -0,0 +1,95 @@ +exec("set names utf8mb4"); + +// 查询分类列表 +$sql = "SELECT * FROM category order by category_id desc"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); + +// 查询文章详情 +$sql = "SELECT * FROM article where article_id='$articleId'"; +$result = $db->query($sql); +$article = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit_save.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit_save.php" new file mode 100644 index 0000000000000000000000000000000000000000..cb1af6f9100aac4abdea2e82e35ffd4424cd912c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_edit_save.php" @@ -0,0 +1,58 @@ +返回上一页'; + exit(); +} +if (mb_strlen($articleTitle) < 5 || mb_strlen($articleTitle) > 50) { + echo '文章标题限制5~50个字'; + echo '返回上一页'; + exit(); +} +// 10~100 +if (mb_strlen($intro) < 10 || mb_strlen($intro) > 100) { + echo '简介限制10~100个字'; + echo '返回上一页'; + exit(); +} +// 10~8000 +if (mb_strlen($content) < 10 || mb_strlen($content) > 8000) { + echo '文章内容10~8000个字。'; + echo '返回上一页'; + exit(); +} +if (empty($categoryId)) { + echo '需要选择文章分类。'; + echo '返回上一页'; + exit(); +} +// array_diff + +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +$updateTime = time(); + +$sql = "update article set article_title='$articleTitle', + category_id='$categoryId', intro='$intro', content='$content', + update_time='$updateTime' + where article_id='$articleId'"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "修改成功。返回列表页"; + exit(); +} else { + echo "修改失败,错误信息:" . $db->errorInfo()[2] . ",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..efd08b443c616ff0d74b89b6fa7b731e1a8e26b5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/article_list.php" @@ -0,0 +1,86 @@ +exec("set names utf8mb4"); + +$sql = "SELECT * FROM article order by article_id desc"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +//var_dump($articleList); +?> + + + + + + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..0b75331ab8076fe917c5a4065f58221b79f1aa8f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add.php" @@ -0,0 +1,62 @@ + + + + + + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add_save.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add_save.php" new file mode 100644 index 0000000000000000000000000000000000000000..ab934be69fac86b56f5512e8758ee80d15a08d95 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_add_save.php" @@ -0,0 +1,44 @@ + 45) { + echo '分类名称2~45个字符。'; + echo '返回上一页'; + exit(); +} +// 10~255 +if (mb_strlen($categoryDesc) < 10 || mb_strlen($categoryDesc) > 255) { + echo '分类描述10~255个字符。'; + echo '返回上一页'; + exit(); +} + +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +// 判断是否有同名称的分类? + +$addTime = time(); +$updateTime = $addTime; + +$sql = "insert into category (category_name, category_desc, add_time, update_time) + values ('$categoryName', '$categoryDesc', '$addTime', '$updateTime')"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "插入成功。返回列表页"; + exit(); +} else { + echo "插入失败,错误信息:" . $db->errorInfo()[2].",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..90cf4987cdea07a2813e717db380c4c04c047f9a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_delete.php" @@ -0,0 +1,39 @@ +返回上一页'; + exit(); +} + +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +$existSql = "select * from article where category_id='$categoryId' limit 1"; +$existResult = $db->query($existSql); +$articleResult = $existResult->fetchAll(); +if ($articleResult) { + echo '分类下有文章,请先删除相关文章。'; + echo '返回上一页'; + exit(); +} + +$sql = "delete from category where category_id='$categoryId'"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "删除成功。返回列表页"; + exit(); +} else { + echo "删除失败,错误信息:" . $db->errorInfo()[2].",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..4bdde4e01b1de3b9414e2c22affac431d2a96107 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit.php" @@ -0,0 +1,76 @@ +exec("set names utf8mb4"); + +$sql = "select * from category where category_id='$categoryId'"; +$result = $db->query($sql); +$category = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + + + + + +
+ + + +
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit_save.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit_save.php" new file mode 100644 index 0000000000000000000000000000000000000000..a822ec118b1b56f62d02a9e2db6bd3ddd5b7cf28 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_edit_save.php" @@ -0,0 +1,50 @@ +返回上一页'; + exit(); +} + +// 2~45 +if (mb_strlen($categoryName) < 2 || mb_strlen($categoryName) > 45) { + echo '分类名称2~45个字符。'; + echo '返回上一页'; + exit(); +} +// 10~255 +if (mb_strlen($categoryDesc) < 10 || mb_strlen($categoryDesc) > 255) { + echo '分类描述10~255个字符。'; + echo '返回上一页'; + exit(); +} + +// 保存到数据库 +date_default_timezone_set("PRC"); + +$dsn = "mysql:host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, "root", "123456"); +$db->exec("set names utf8mb4"); + +// 判断是否有同名称的分类? + +$updateTime = time(); + +$sql = "update category set category_name='$categoryName', category_desc='$categoryDesc', update_time='$updateTime' + where category_id='$categoryId'"; +$result = $db->exec($sql); +//var_dump($db->errorInfo()); +if ($result) { + echo "修改成功。返回列表页"; + exit(); +} else { + echo "修改失败,错误信息:" . $db->errorInfo()[2].",请联系管理员:303410541@qq.com"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..4619267accca4d9adb3dec3a50d83cc8ed9998c5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/category_list.php" @@ -0,0 +1,72 @@ +query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..5e18d1fa7a28ef93ac981cce4fd4d909144cf649 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/src/admin/css/main.css" @@ -0,0 +1,154 @@ +* { + margin: 0; + padding: 0; +} + +body { + font-size: 1rem; + color: #28313b; +} + +ul { + list-style-type: none; +} + +a { + color: #346cb0; + text-decoration: none; +} + +a:hover { + color: #234875; + text-decoration: underline; +} + + +table { + width: 100%; + border-collapse: collapse; + border: 1px solid #ddd; +} + +table tr th, +table tr td { + padding: 5px 0; +} + +.btn { + padding: 8px 10px; + border: 0; + background-color: #EFF0EB; + border-radius: 4px; +} + +#container { + min-width: 960px; +} + +#header { + width: 100%; + height: 60px; + background-color: #336CAF; +} + +#header h1 { + color: white; + background-color: #2E5F9A; + width: 225px; + height: 60px; + font-size: 24px; + padding: 0 0 0 15px; + line-height: 60px; + display: inline-block; +} + +#header #admin-info { + float: right; + color: white; + height: 60px; + line-height: 60px; + padding: 0 10px 0 0; +} + +#header #admin-info a { + color: #8DC1E8; +} + +#left { + position: fixed; + width: 204px; + border-right: 1px solid #CDCDCD; + padding: 20px 18px; +} + +#left ul li { + margin: 0 0 10px 0; +} + +#left ul li a { + color: #28313b; +} + +#left ul li a:hover { + color: #346cb0; +} + +#right { + padding: 0 0 0 240px; + font-size: 14px; +} + +#right-content { + padding: 15px; +} + +#breadcrumb-nav { + line-height: 40px; +} + + + +#add-article { + float: right; +} + +#table-menu { + line-height: 40px; +} + +#table-list { + margin: 8px 0 0 0 ; +} + +#table-list table { + text-align: center; +} + +#table-add table tr td:first-child { + text-align: right; +} + +#table-add table tr td { + padding: 10px; +} + +#table-add input[type=text] { + width: 300px; + height: 30px; + border: 1px solid #ddd; + border-radius: 4px; +} + +#table-add select { + width: 100px; + height: 30px; + border: 1px solid #ddd; + border-radius: 4px; +} + +#table-add textarea { + width: 460px; + height: 230px; + border: 1px solid #ddd; + border-radius: 4px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/add.html" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/add.html" new file mode 100644 index 0000000000000000000000000000000000000000..af4ee4eabca2f7225d3911c855509e63ccb5274a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/add.html" @@ -0,0 +1,67 @@ + + + + + + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..5e18d1fa7a28ef93ac981cce4fd4d909144cf649 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/css/main.css" @@ -0,0 +1,154 @@ +* { + margin: 0; + padding: 0; +} + +body { + font-size: 1rem; + color: #28313b; +} + +ul { + list-style-type: none; +} + +a { + color: #346cb0; + text-decoration: none; +} + +a:hover { + color: #234875; + text-decoration: underline; +} + + +table { + width: 100%; + border-collapse: collapse; + border: 1px solid #ddd; +} + +table tr th, +table tr td { + padding: 5px 0; +} + +.btn { + padding: 8px 10px; + border: 0; + background-color: #EFF0EB; + border-radius: 4px; +} + +#container { + min-width: 960px; +} + +#header { + width: 100%; + height: 60px; + background-color: #336CAF; +} + +#header h1 { + color: white; + background-color: #2E5F9A; + width: 225px; + height: 60px; + font-size: 24px; + padding: 0 0 0 15px; + line-height: 60px; + display: inline-block; +} + +#header #admin-info { + float: right; + color: white; + height: 60px; + line-height: 60px; + padding: 0 10px 0 0; +} + +#header #admin-info a { + color: #8DC1E8; +} + +#left { + position: fixed; + width: 204px; + border-right: 1px solid #CDCDCD; + padding: 20px 18px; +} + +#left ul li { + margin: 0 0 10px 0; +} + +#left ul li a { + color: #28313b; +} + +#left ul li a:hover { + color: #346cb0; +} + +#right { + padding: 0 0 0 240px; + font-size: 14px; +} + +#right-content { + padding: 15px; +} + +#breadcrumb-nav { + line-height: 40px; +} + + + +#add-article { + float: right; +} + +#table-menu { + line-height: 40px; +} + +#table-list { + margin: 8px 0 0 0 ; +} + +#table-list table { + text-align: center; +} + +#table-add table tr td:first-child { + text-align: right; +} + +#table-add table tr td { + padding: 10px; +} + +#table-add input[type=text] { + width: 300px; + height: 30px; + border: 1px solid #ddd; + border-radius: 4px; +} + +#table-add select { + width: 100px; + height: 30px; + border: 1px solid #ddd; + border-radius: 4px; +} + +#table-add textarea { + width: 460px; + height: 230px; + border: 1px solid #ddd; + border-radius: 4px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..0752b9e66d4576bca24d0ba440288572a68da502 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/php\351\253\230\347\272\247_03_cookie\345\222\214session/03_\347\273\203\344\271\240\351\242\230\346\250\241\346\235\277\347\264\240\346\235\220/ui/index.html" @@ -0,0 +1,61 @@ + + + + + + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/\350\257\276\345\240\202\347\273\203\344\271\240.txt" "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/\350\257\276\345\240\202\347\273\203\344\271\240.txt" new file mode 100644 index 0000000000000000000000000000000000000000..16390acb996bb6dea08b9a103c062234ea2401ee --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/2019\347\272\247\350\256\241\345\272\224\347\217\255_php\351\253\230\347\272\247_20210326/\350\257\276\345\240\202\347\273\203\344\271\240.txt" @@ -0,0 +1,5 @@ +1. php߼_03_cookiesession/03_ϰ.md ̨¼ԭͼ +1Ҫɣύơ + +2. ¼ҳδ html+css дģд +3. Ըĵݱṹʹṹ \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..d064d62c39d316c15a02ec09a0d19e52983243b4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_delete.php" @@ -0,0 +1,29 @@ +query("set names utf8"); + +$adminId = $_POST['admin_id']; + +// 删除日志 +$sql = "DELETE FROM admin_log WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if (!$result) { + exit('删除日志失败,请联系管理员'); +} + +$sql = "DELETE FROM admin WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if ($result) { +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..e8a1f4f112365d9233b6681ff96d2d2ed02726a5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_edit.php" @@ -0,0 +1,77 @@ +query("set names utf8"); +$sql = "SELECT * FROM admin WHERE admin_id = {$id}"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..7d9c2083cbab4dcde995eeefc72277bbf911debd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_list.php" @@ -0,0 +1,117 @@ +query("set names utf8"); +$sql = + "SELECT + admin.admin_id, + admin_name, + admin_email, + admin_password, + register_time, + login_time + FROM admin + LEFT JOIN admin_log ON admin.admin_id = admin_log.admin_id + ORDER BY login_time DESC"; +$result = $db->query($sql); +$adminList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..676cacce346f26aa73b0beedc24b4dbe8471ed01 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register.php" @@ -0,0 +1,98 @@ + + + + + + 注册管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..b2e585734faac4378079072d329f542616cacbb4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/admin_register_check.php" @@ -0,0 +1,62 @@ +query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 长度验证 +lenCheck($adminName, 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($adminPassword, 6, 12, '密码长度为6~12个字'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}';"; +$result = $db->query($sql); +$nameFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($nameFlag) { + echo "该管理员名称已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}'"; +$result = $db->query($sql); +$emailFlag = $result->fetch(PDO::FETCH_ASSOC); +if ($emailFlag) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..50f5d85c2247cc4933ae033bb1ad81867a18146c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add.php" @@ -0,0 +1,116 @@ +query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..576b5cb17467da3bfc7a3a65d160f5ded83a0081 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_add_check.php" @@ -0,0 +1,56 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 表单验证 +include_once "../lib/form_check.php"; +// 空值验证 +nullCheck($articleTitle, '文章标题不能为空'); +nullCheck($articleContent, '文章内容不能为空'); + +// 长度验证 +lenCheck($articleTitle, 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($articleIntro) > 0) { + lenCheck($articleIntro, 5, 50, '文章简介长度为5~50个字'); +} else { + $articleIntro = "这个作者很懒,什么都没有写"; +} +if (mb_strlen($articleAuthor) > 0) { + lenCheck($articleAuthor, 2, 10, '作者名称长度为2~10个字'); +} else { + $articleAuthor = "佚名"; +} +lenCheck($articleContent, 20, 8000, '文章内容长度为20~800个字'); + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}';"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 1) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$articleAuthor}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..82e110b22ea699ab4ef0dbbd964fd4e4ae3a20dc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_delete.php" @@ -0,0 +1,23 @@ +query("set names utf8"); + +$articleId = $_POST['article_id']; + +$sql = "DELETE FROM article WHERE article_id = {$articleId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { +echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..3a4b2009b16772a32ec267f1b4d00c2bc54dd202 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit.php" @@ -0,0 +1,131 @@ +query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..f3966767c2cc34cb5abcbd20f700db1214257cb0 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_edit_check.php" @@ -0,0 +1,37 @@ +query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$articleAuthor = $_POST['article_author']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; +$articleId = $_POST['article_id']; + +$sql = + "UPDATE article + SET + article_title = '{$articleTitle}', + article_intro = '{$articleIntro}', + article_author = '{$articleAuthor}', + category_id = '{$categoryId}', + article_content = '{$articleContent}', + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..0d4d5b60a162b73753842db74fec3561ba78f3d4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/article_list.php" @@ -0,0 +1,118 @@ +query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 后台首页 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..6a1d9be381742eb38c000123d52a028337a43bda --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add.php" @@ -0,0 +1,86 @@ + + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5ed81febe0968921e6751f3a3a2d1bc7bbb45e76 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_add_check.php" @@ -0,0 +1,42 @@ +query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($categoryName, '分类名称不能为空'); +nullCheck($categoryDesc, '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($categoryName, 2, 15, '分类名称长度为2~15个字'); +lenCheck($categoryDesc, 10, 100, '分类描述长度为10~100个字'); + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}';"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 1) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..28091d0d06c29ad3a36c79fa1cfe68152dd9182b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_delete.php" @@ -0,0 +1,31 @@ +query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; +if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); +} +$sql = "DELETE FROM category WHERE category_id = {$_POST['category_id']}"; +$db->query("set names utf8"); +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo $db->errorInfo()[2]; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..1d3111b0633ced6eb9298fa4e63860113c693300 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit.php" @@ -0,0 +1,100 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..038c516569dcf396047f8a4b70695efb6c2d6894 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_edit_check.php" @@ -0,0 +1,40 @@ +query("set names utf8"); + +$categoryId = $_POST['category_id']; +$sql = "UPDATE category + SET + category_name = '{$categoryName}', + category_desc = '{$categoryDesc}', + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..c9892d006c5d0f22c7de45e4d95766db05c8acd9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/category_list.php" @@ -0,0 +1,104 @@ +query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..c55a40a21e3f4d7fcf9dab07161cc2e1a5046aa3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login.php" @@ -0,0 +1,60 @@ +alert('您已登录,正在跳转主页');location.assign('article_list.php');"; + exit(); +} +?> + + + + + + + 登录 + + + + +
+ 博客系统 +
+ +
+ +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..5a1411eb521772b026b282ae7e3b82336ad9ee88 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/login_check.php" @@ -0,0 +1,40 @@ +query("set names utf8"); + +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $adminId = $adminInfo['admin_id']; + $password = $adminInfo['admin_password']; + if ($adminPassword === $password) { + $sql = "INSERT INTO admin_log (admin_id, login_time) + VALUES ({$adminId}, ". time() ." );"; + $result = $db->exec($sql); + if ($result) { + session_start(); + $_SESSION['adminName'] = $adminName; + echo "ok"; + } else { + echo "登录时发生了错误,错误信息:". $db->errorInfo()[2] ."请联系管理员"; + } + } else { + echo "密码错误,请检查后再试"; + } +} else { + echo "用户名不存在,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..cc4d98e1211fdbef7194739a71376fe76ae155d8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/admin/logout.php" @@ -0,0 +1,12 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..8849268d2c7812cd90e7377908b73f2dedcc332c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..466885cde9ad323ef3e33e8c278fd892e0bb6ddb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,51 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(30) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(11) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; + +-- 创建管理员日志表 +CREATE TABLE `admin_log` +( + `admin_id` INT UNSIGNED COMMENT '管理员编号', + `login_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员登录时间', + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员日志表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..429f67d689c4555f974fd3af6cee77fc093bd968 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" new file mode 100644 index 0000000000000000000000000000000000000000..5ebbf9909cca26bf0017f93b1b6881cf40490faa --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" @@ -0,0 +1,35 @@ +USE blog; +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time) +VALUES ('小红', '123456789@qq.com', '123456', UNIX_TIMESTAMP(now())); + +-- 插入管理员日志数据 +INSERT INTO admin_log (admin_id, login_time) +VALUES (1, UNIX_TIMESTAMP(now())); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..df84b6781343f6a9eb5a783344868414d96787b6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/docs/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,26 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(30) ǿ + Ա ַ(10) ǿ + Աעʱ int(11) ʱ ǿ + +Ա־ + Ա int ԱĹԱid + Ա¼ʱ int(11) ʱ ǿ \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/index.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..953e941e767fcf0642d247c883c7995e697f6764 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/js/admin-main.js" @@ -0,0 +1,84 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + $('.check-box').prop('checked', true); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + 'del=1&category_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + 'del=1&article_id='+ arr.join(','), + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/lib/form_check.php" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/lib/form_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..c5556c8b41e7ac316b3c8d2a3a53e7e6277d04d6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/lib/form_check.php" @@ -0,0 +1,12 @@ + $maxLen) { + exit($tip); + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..6467ebf5634606a633bcc9dff867e12b1ae17eff --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210326/blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..57e16d0fb26efc73bb9b3bcf312ce6fa33fe3e43 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_delete.php" @@ -0,0 +1,33 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +if ($_POST['del'] !== '1') { + header('location: admin_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$adminId = $_POST['admin_id']; + +// 删除日志 +$sql = "DELETE FROM admin_log WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if (!$result) { + exit('删除日志失败,请联系管理员'); +} + +$sql = "DELETE FROM admin WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if ($result) { +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..28b5a9c01199c8ada888f60e58e1b66fe0b3af15 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_edit.php" @@ -0,0 +1,82 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: admin_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); +$sql = "SELECT * FROM admin WHERE admin_id = {$id}"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..1006a57338df90afea193a4276982caec325c96c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_list.php" @@ -0,0 +1,123 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; +$adminName = $_SESSION['adminName']; +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); +$sql = + "SELECT + admin.admin_id, + admin_name, + admin_email, + admin_password, + register_time, + MAX(login_time) AS last_login_time + FROM admin + LEFT JOIN admin_log ON admin.admin_id = admin_log.admin_id + GROUP BY admin_id + ORDER BY last_login_time DESC"; +$result = $db->query($sql); +$adminList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..c958ef55ce0dedcb9db3f74c0e03d87f49cfe911 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register.php" @@ -0,0 +1,102 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; +?> + + + + + 注册管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..a193235617f2be668acf479e28abcaf2d70360e4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/admin_register_check.php" @@ -0,0 +1,73 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +if ($_POST['re'] !== '1') { + header('location: admin_register.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 长度验证 +lenCheck($adminName, 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($adminPassword, 6, 12, '密码长度为6~12个字'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT COUNT(*) AS admin_num FROM admin WHERE admin_name = '{$adminName}' LIMIT 1;"; +$result = $db->query($sql); +$nameNum = (int)$result->fetch(PDO::FETCH_ASSOC)['admin_num']; +if ($nameNum > 0) { + echo "该管理员名称已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT COUNT(*) AS email_num FROM admin WHERE admin_email = '{$adminEmail}' LIMIT 1"; +$result = $db->query($sql); +$emailNum = (int)$result->fetch(PDO::FETCH_ASSOC)['email_num']; +if ($emailNum > 0) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..a092bccf6f7fa4aa0d3c25b98c2ce66c44e4fd4a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add.php" @@ -0,0 +1,118 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..4eceddf4bb482cb43f30b31d932282ffb09bdbf8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_add_check.php" @@ -0,0 +1,60 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; +if ($_POST['add'] !== '1') { + header('location: article_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 表单验证 +include_once "../lib/form_check.php"; +// 空值验证 +nullCheck($articleTitle, '文章标题不能为空'); +if (!$categoryId) { + echo '请选择文章分类'; + exit(); +} +nullCheck($articleContent, '文章内容不能为空'); + +// 长度验证 +lenCheck($articleTitle, 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($articleIntro) > 0) { + lenCheck($articleIntro, 5, 50, '文章简介长度为5~50个字'); +} else { + $articleIntro = "这个作者很懒,什么都没有写"; +} +lenCheck($articleContent, 20, 8000, '文章内容长度为20~800个字'); + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}' LIMIT 1;"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); + +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..495908b5037a6a8d7688df34c79a43d5e1e70d76 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_delete.php" @@ -0,0 +1,44 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); +$articleId = $_POST['article_id']; + +if (@$_POST['del']) { + // 删除一个 + $sql = "DELETE FROM article WHERE article_id = {$articleId}"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM article WHERE article_id IN ({$articleId})"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; + } +} else { + echo "参数错误,请联系管理员"; + exit(); +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..52f07ffe7efaae095682f42aa226fc760af8f8cb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit.php" @@ -0,0 +1,154 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧数据 +$articleTitle = $articleInfo['article_title']; +$articleIntro = $articleInfo['article_intro']; +$categoryId = $articleInfo['category_id']; +$articleContent = $articleInfo['article_content']; + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..78b64987c5e4542b4cc53c941edfc5dccb4d92d9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_edit_check.php" @@ -0,0 +1,87 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +if ($_POST['edit'] !== '1') { + header('location: article_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$articleId = $_POST['article_id']; +// 旧数据 +$oldData = []; +$oldData['article_title'] = $_POST['old_title']; +$oldData['article_intro'] = $_POST['old_intro']; +$oldData['category_id'] = $_POST['old_category_id']; +$oldData['article_content'] = $_POST['old_content']; + +// 新数据 +$newData = []; +$newData['article_title'] = $_POST['article_title']; +$newData['article_intro'] = $_POST['article_intro']; +$newData['category_id'] = $_POST['category_id']; +$newData['article_content'] = $_POST['article_content']; + +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo "修改失败,原因:数据未更改"; + exit(); +} +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($newData['article_title'], '文章标题不能为空'); +if (!$newData['category_id']) { + echo '请选择文章分类'; + exit(); +} +nullCheck($newData['article_content'], '文章内容不能为空'); + +// 长度验证 +lenCheck($newData['article_title'], 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($newData['article_intro']) > 0) { + lenCheck($newData['article_intro'], 5, 50, '文章简介长度为5~50个字'); +} else { + $newData['article_intro'] = "这个作者很懒,什么都没有写"; +} +lenCheck($newData['article_content'], 20, 8000, '文章内容长度为20~800个字'); + +if (isset($diff['article_title'])) { + // 文章标题存在修改,验证新的标题是否重复 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$diff['article_title']}' LIMIT 1"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo '该文章标题已经存在,请更换后再试'; + exit(); + } +} + +// 生成sql +$updateData = ""; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$sql = + "UPDATE article + SET + {$updateData} + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..325a02c6613803efaf2a18826b71567e9ecbe7e5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/article_list.php" @@ -0,0 +1,121 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 文章列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..e76738eda1a0b5ab62f6f3e1eaa16dd715b177a4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add.php" @@ -0,0 +1,90 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; +?> + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..2140d839e1d31317d4253dbc8cae3571a0545603 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_add_check.php" @@ -0,0 +1,48 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +if ($_POST['add'] !== '1') { + header('location: category_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($categoryName, '分类名称不能为空'); +nullCheck($categoryDesc, '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($categoryName, 2, 15, '分类名称长度为2~15个字'); +lenCheck($categoryDesc, 10, 100, '分类描述长度为10~100个字'); + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}' LIMIT 1;"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 0) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..7da2d85ab28d77a1c864628669f595bd7074bc92 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_delete.php" @@ -0,0 +1,52 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + + + +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$categoryId = $_POST['category_id']; +// 删除 +if (@$_POST['del']) { + // 删除前检查列表下有没有文章 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE category_id = {$categoryId}"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); + } + $sql = "DELETE FROM category WHERE category_id = {$categoryId}"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo $db->errorInfo()[2]; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM category WHERE category_id IN ({$categoryId})"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo $db->errorInfo()[2]; + } +} else { + echo "参数错误,请联系管理员"; + exit(); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..354b05241c890a97dbca43be54eeec4caf0a22c1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit.php" @@ -0,0 +1,118 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=localhost;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$sql = "SELECT * FROM category WHERE category_id = {$id}"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧的数据 +$oldCategoryName = $categoryInfo['category_name']; +$oldCategoryDesc = $categoryInfo['category_desc']; +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..3109a506b3191fa0e536d39d09285a56c6c871ef --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_edit_check.php" @@ -0,0 +1,73 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +if ($_POST['edit'] !== '1') { + header('location: category_edit.php'); + exit(); +} + +// 旧数据 +$oldData = []; +$oldData['category_name'] = $_POST['old_category_name']; +$oldData['category_desc'] = $_POST['old_category_desc']; +// 新数据 +$newData = []; +$newData['category_name'] = $_POST['category_name']; +$newData['category_desc'] = $_POST['category_desc']; +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo '修改失败,原因:未修改数据'; + exit(); +} + +include_once "../lib/form_check.php"; +// 表单验证 +nullCheck($newData['category_name'], '分类名称不能为空'); +nullCheck($newData['category_desc'], '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($newData['category_name'], 2, 15, '分类名称长度为2~15个字'); +lenCheck($newData['category_desc'], 10, 100, '分类描述长度为10~100个字'); + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +if (isset($diff['category_name'])) { + // 分类名存在修改,验证该分类名是否已经存在 + $sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$diff['category_name']}' LIMIT 1"; + $result = $db->query($sql); + $categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; + if ($categoryNum > 0) { + echo '该分类名称已经存在,请更换后再试'; + exit(); + } +} +// 生成sql +$updateData = ''; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$categoryId = $_POST['category_id']; +$sql = "UPDATE category + SET + {$updateData} + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误信息:". $db->errorInfo()[2] .",请联系管理员"; +} +?> \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..a467e9d5bad58668ecd41cbf0bfeb7e84c449c43 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/category_list.php" @@ -0,0 +1,109 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['adminName']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$sql = "SELECT * FROM category ORDER BY category_id DESC;"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..ba41632562a901bbc5c6dbfab16765c64fcb2a12 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login.php" @@ -0,0 +1,62 @@ +alert('您已登录,正在跳转主页');location.assign('article_list.php');"; + exit(); + } +} +?> + + + + + + + 登录 + + + + +
+ 博客系统 +
+ +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..f10b29e01e39573fa72a1aeacb2242543982dec3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/login_check.php" @@ -0,0 +1,40 @@ +location.assign('login.php');"; + exit(); +} + +// 表单验证 +$adminName = $_POST['admin_name']; +$adminPassword = $_POST['admin_password']; +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能空'); +nullCheck($adminPassword, '密码不能为空'); + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root','123456'); +$db->query("set names utf8"); + +$sql = "SELECT * FROM admin WHERE admin_name = '{$adminName}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $adminId = $adminInfo['admin_id']; + $password = $adminInfo['admin_password']; + if ($adminPassword === $password) { + $sql = "INSERT INTO admin_log (admin_id, login_time) + VALUES ({$adminId}, ". time() ." );"; + $result = $db->exec($sql); + if ($result) { + session_start(); + $_SESSION['adminName'] = $adminName; + echo "ok"; + } else { + echo "登录时发生了错误,错误信息:". $db->errorInfo()[2] ."请联系管理员"; + } + } else { + echo "密码错误,请检查后再试"; + } +} else { + echo "用户名不存在,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..298e83c2fe2273b22c355b94a5753a62b2d9e4f7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/admin/logout.php" @@ -0,0 +1,12 @@ +location.assign('login.php');"; + exit(); +} +session_destroy(); +if (setcookie('PHPSESSID', '', time() - 3600, '/')) { + echo "ok"; +} else { + echo "退出登录失败,请联系管理员"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/category.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/category.php" new file mode 100644 index 0000000000000000000000000000000000000000..98615de917155a5789e2c46ee33a6bad76874f73 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/category.php" @@ -0,0 +1,82 @@ +query('set names utf8'); + +$categoryId = $_GET['category_id'] ?? ''; +$categoryName = $_GET['category_name'] ?? ''; +if (empty($categoryId || $categoryName)) { + header('location: index.php'); + exit(); +} + +$sql = "SELECT * FROM article WHERE category_id = {$categoryId} ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$pageNum = ceil($articleNum / 10); +$page = 1; +$nowArticleList = array_slice($articleList, 0, 10); + +if (@$_GET['page']) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * 10, 10); +} + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + <?php echo $categoryName; ?> + + + +
+ + +
+ + +
+
+

+ +
+
+ +
+ 阅读全文 +
+ + 该分类下暂时还没有文章

"; ?> + +
+
+ + 上一页 + + + > + + + 下一页 + +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..d8256a786cc8f472b91b0a8cda7e021618f570cf --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/admin-main.css" @@ -0,0 +1,125 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; + font-size:14px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; + width: 200px; + font-weight: 700; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td .readonly { + background-color: #DDD; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..148d71d3b33144d5786b3c426b32b11079e5387d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/login.css" @@ -0,0 +1,84 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; + } +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 220px; +} +.info input[type="text"], +.info input[type="password"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..1e3023efd04823ac6cef217dfa0d235708ee463b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/css/main.css" @@ -0,0 +1,123 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; + height: 98vh; +} +#container { + width: 960px; + background-color: white; + margin: 42px auto auto auto; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; + cursor: default; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + margin: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: 24px auto auto auto; +} +#article-list .article.detail { + padding-bottom: 40px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list p { + margin-top: 10px; + text-align: center; +} +#article-list .article a { + font-size: 14px; + width: 65px; + height: 28px; + line-height: 28px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + margin: 20px 7px; + color: #97c5a4; +} +#page a.page-action { + text-decoration: underline; + color: #51a5ff; +} +#page a:hover { + color: #51a5ff; + text-shadow: 0 3px 3px #CCC; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/detail.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/detail.php" new file mode 100644 index 0000000000000000000000000000000000000000..292ab4d60c08d72aff481535d8f8253932e82b6a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/detail.php" @@ -0,0 +1,54 @@ +query('set names utf8'); + +$articleId = $_GET['article_id'] ?? ''; +if (empty($articleId)) { + header('location: index.php'); + exit(); +} +@$categoryId = $_GET['category_id']; +$sql = "SELECT * FROM article WHERE article_id = {$articleId}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 详情页 + + + +
+ + +
+
+
+

+ +
+
+ ', $articleInfo['article_content']); ?> +
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..923fc7f162bacee617428f7e60a64d43fc708698 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..466885cde9ad323ef3e33e8c278fd892e0bb6ddb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,51 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '这个作者很懒,什么都没有写' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(30) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(11) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; + +-- 创建管理员日志表 +CREATE TABLE `admin_log` +( + `admin_id` INT UNSIGNED COMMENT '管理员编号', + `login_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员登录时间', + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员日志表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/data_add_multi.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/data_add_multi.php" new file mode 100644 index 0000000000000000000000000000000000000000..7b53b0f2f919df5282c66866b531b6d2caf056fb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/data_add_multi.php" @@ -0,0 +1,41 @@ +exec($sql); +//if (!$result) { +// echo 'category failed'; +// exit(); +//} +echo 'category success'; +$data = ""; +// 文章 +$sql = "INSERT INTO article(article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES "; +$time = time(); +for ($i = 1000; $i < 5000; $i++) { + for ($c = 1; $c < 10; $c++) { + $data .= "('{$c}_{$i}_title', {$i}_intro', {$c}, '{$i}_content', {$time}, {$time}),"; + } + $sql .= $data; +} + +exit($data); +$data = rtrim($data, ','); +$sql .= $data; + +exit($sql); +$result = $db->exec($sql); +if (!$result) { + echo 'article failed'; + exit(); +} +echo 'article success'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..429f67d689c4555f974fd3af6cee77fc093bd968 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" new file mode 100644 index 0000000000000000000000000000000000000000..c33ac0a2cd035836cf8d012f00b70755bd078752 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" @@ -0,0 +1,35 @@ +USE blog; +-- 查询文章列表信息 +SELECT + article_id, + article_title, + category_name, + article_author, + article_intro, + article.add_time, + article.update_time + FROM category + INNER JOIN article ON category.category_id = article.category_id + ORDER BY article_id DESC; + +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES ('web前端', 'html,css,js,vue等', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 1, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 再次插入分类测试数据 +INSERT INTO `category` (category_name, category_desc, update_time, add_time) +VALUES + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time) +VALUES ('root', '123456789@qq.com', '123456', UNIX_TIMESTAMP(now())); + +-- 插入管理员日志数据 +INSERT INTO admin_log (admin_id, login_time) +VALUES (1, UNIX_TIMESTAMP(now())); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..df84b6781343f6a9eb5a783344868414d96787b6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,26 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(30) ǿ + Ա ַ(10) ǿ + Աעʱ int(11) ʱ ǿ + +Ա־ + Ա int ԱĹԱid + Ա¼ʱ int(11) ʱ ǿ \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/index.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..2da7efc7f7c6c1eb58beacdcf6e8057a920aa0a1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/index.php" @@ -0,0 +1,74 @@ +query('set names utf8'); + +$sql = "SELECT * FROM article ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$pageNum = ceil($articleNum / 10); +$page = 1; +$nowArticleList = array_slice($articleList, 0, 10); + +if (@$_GET['page']) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * 10, 10); +} + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + + 首页 + + + +
+ + +
+ +
+
+

+ +
+
+ +
+ 阅读全文 +
+ +
+
+ + 上一页 + + + > + + + 下一页 + +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..664d9d5ff487569df0f38028c3acf6e917933002 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/admin-main.js" @@ -0,0 +1,90 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + $('.check-box').prop('checked', true); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + { + del_multi: 1, + category_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + { + del_multi: 1, + article_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/lib/form_check.php" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/lib/form_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..c5556c8b41e7ac316b3c8d2a3a53e7e6277d04d6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/lib/form_check.php" @@ -0,0 +1,12 @@ + $maxLen) { + exit($tip); + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..b1e42d42a75de02fb675db3114a9db443a820fef --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210329/Blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..f75f5af2bff9a2fbd443488f36ae6eeb4494fe79 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,52 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '暂无简介' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE IF NOT EXISTS `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(50) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(32) NOT NULL COMMENT '管理员密码', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员信息修改时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; + +-- 创建管理员日志表 +CREATE TABLE IF NOT EXISTS `admin_log` +( + `admin_id` INT UNSIGNED COMMENT '管理员编号', + `login_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员登录时间', + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员日志表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..327b1a426d9d4eee7ea0f28fafa7b04a25cb91b5 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/data_add_multi.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/data_add_multi.php" new file mode 100644 index 0000000000000000000000000000000000000000..7b53b0f2f919df5282c66866b531b6d2caf056fb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/data_add_multi.php" @@ -0,0 +1,41 @@ +exec($sql); +//if (!$result) { +// echo 'category failed'; +// exit(); +//} +echo 'category success'; +$data = ""; +// 文章 +$sql = "INSERT INTO article(article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES "; +$time = time(); +for ($i = 1000; $i < 5000; $i++) { + for ($c = 1; $c < 10; $c++) { + $data .= "('{$c}_{$i}_title', {$i}_intro', {$c}, '{$i}_content', {$time}, {$time}),"; + } + $sql .= $data; +} + +exit($data); +$data = rtrim($data, ','); +$sql .= $data; + +exit($sql); +$result = $db->exec($sql); +if (!$result) { + echo 'article failed'; + exit(); +} +echo 'article success'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..059e37b03b7153539ec56621fdd966cd94a26a4f Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" new file mode 100644 index 0000000000000000000000000000000000000000..ecf55e71ac689c39158a65c9206a5ffcb4791e05 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" @@ -0,0 +1,39 @@ +USE blog; +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES + ('html&css', '编写静态网页的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript', '网页交互基础', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql ', 'mysql的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux', '认识Linux', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES + ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 2, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('sql server入门', '暂无简介' , '小红', 4, 'sql server入门 sql server入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('什么是数据库', '数据库的概念' , '小红', 5, '数据库的概念数据库的概念', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql入门', 'mysql入门基础知识' , '小红', 5, 'mysql入门mysql入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql优化', 'mysql优化' , '小红', 5, 'mysql优化mysql优化', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php基础入门', 'php入门基础' , '小红', 3, 'php基础入门php基础入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html入门指南', 'html基础入门' , '小红', 1, 'html入门指南', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html学习', 'html学习' , '小红', 1, 'html学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('css进阶学习', 'css进阶学习' , '小红', 1, 'css进阶学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识javascript', '认识javascript' , '小红', 2, '认识javascript', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('BOM、DOM介绍', 'BOM、DOM介绍' , '小红', 2, 'BOM、DOM介绍', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript实例', 'javascript实例' , '小红', 2, 'javascript实例javascript实例', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识jquery', '认识jquery' , '小红', 2, '认识jquery', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux入门', 'Linux入门' , '小红', 6, 'Linux入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux和Windows', 'Linux和Windows' , '小红', 6, 'Linux和Windows', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, register_time, update_time) +VALUES + ('root', '1622485026@qq.com', '123456', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('admin', '3341727374@qq.com', '123456', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())) + +-- 插入管理员日志数据 +INSERT INTO admin_log (admin_id, login_time) +VALUES (1, UNIX_TIMESTAMP(now())); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a8ff6d8cbd882a77abb1ea0c04b039d3e14bc3c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..0a7346bc6879fcc8201399b284f686fc5394714c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,27 @@ + + id int + ַ(20) ǿ + ַ(200) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +± + id int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ǿ + ʱ int(11) ʱ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(50) ǿ + Ա ַ(32) ǿ + Աעʱ int(11) ʱ ǿ + ԱϢ޸ʱ int(11) ʱ ǿ + +Ա־ + Ա int ԱĹԱid + Ա¼ʱ int(11) ʱ ǿ \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..d6a26b4d227e0d0e0680297c9bdd71978f19e8dc Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..f4418b4605f320c130aa2834b2fbf589491f2b03 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_delete.php" @@ -0,0 +1,33 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +if ($_POST['del'] !== '1') { + header('location: admin_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$adminId = $_POST['admin_id']; + +// 删除日志 +$sql = "DELETE FROM admin_log WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if (!$result) { + exit('删除日志失败,请联系管理员'); +} + +$sql = "DELETE FROM admin WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if ($result) { +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..ad309cf224379939a21208d577c4a4b6d86a3211 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit.php" @@ -0,0 +1,125 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: admin_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$sql = "SELECT * FROM admin WHERE admin_id = {$id}"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧数据 +$oldName = $adminInfo['admin_name']; +$adminEmail = $adminInfo['admin_email']; +$oldPassword = $adminInfo['admin_password']; +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..2ea6ec528eb2adf37d4c259d5d9d82876362da5f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_edit_check.php" @@ -0,0 +1,70 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['edit'] !== '1') { + header('location: admin_edit.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$adminId = $_POST['admin_id']; +// 旧数据 +$oldData = []; +$oldData['admin_name'] = $_POST['old_name']; +$oldData['admin_password'] = $_POST['old_password']; + +// 新数据 +$newData = []; +$newData['admin_name'] = $_POST['admin_name']; +$newData['admin_password'] = $_POST['admin_password']; + +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo "修改失败,原因:数据未修改"; + exit(); +} + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($newData['admin_name'], '用户名不能为空'); +nullCheck($newData['admin_password'], '密码不能为空'); + +// 长度验证 +lenCheck($newData['admin_name'], 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($newData['admin_password'], 6, 12, '密码长度为6~12个字'); + +if (isset($diff['admin_name'])) { + // 用户名存在修改,检查数据库中是否已存在用户名 + $sql = "SELECT COUNT(*) AS admin_num FROM admin WHERE admin_name = '{$newData['admin_name']}' LIMIT 1;"; + $result = $db->query($sql); + $nameNum = (int)$result->fetch(PDO::FETCH_ASSOC)['admin_num']; + if ($nameNum > 0) { + echo "该管理员名称已存在,请更换后再试"; + exit(); + } +} + +// 生成sql +$updateData = ""; +foreach ($diff as $key => $value) { + $updateData .= "{$key} = '{$value}',"; +} +$updateData = rtrim($updateData, ','); +$sql = "UPDATE admin SET {$updateData} WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if ($result) { + echo "ok"; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..518988f0c871c5b54deb5dbe9204c862f06fc8cd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_list.php" @@ -0,0 +1,122 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$sql = + "SELECT + admin.admin_id, + admin_name, + admin_email, + register_time, + update_time, + MAX(login_time) AS last_login_time + FROM admin + LEFT JOIN admin_log ON admin.admin_id = admin_log.admin_id + GROUP BY admin_id + ORDER BY last_login_time DESC"; +$result = $db->query($sql); +$adminList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..96432488431c306f65aeb37d39410e95368dd6eb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register.php" @@ -0,0 +1,102 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +?> + + + + + 注册管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..0d23a40c2c02f74631699ab588603eed762c42f1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/admin_register_check.php" @@ -0,0 +1,73 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['re'] !== '1') { + header('location: admin_register.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 长度验证 +lenCheck($adminName, 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($adminPassword, 6, 12, '密码长度为6~12个字'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT COUNT(*) AS admin_num FROM admin WHERE admin_name = '{$adminName}' LIMIT 1;"; +$result = $db->query($sql); +$nameNum = (int)$result->fetch(PDO::FETCH_ASSOC)['admin_num']; +if ($nameNum > 0) { + echo "该管理员名称已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT COUNT(*) AS email_num FROM admin WHERE admin_email = '{$adminEmail}' LIMIT 1"; +$result = $db->query($sql); +$emailNum = (int)$result->fetch(PDO::FETCH_ASSOC)['email_num']; +if ($emailNum > 0) { + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time, update_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .", ". time() .");"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..ffd7b72e7e65909b209285e0c331f53915e45572 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add.php" @@ -0,0 +1,118 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..dadb09e7832f451a5cbd36a93899d34c210918c6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_add_check.php" @@ -0,0 +1,60 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +if ($_POST['add'] !== '1') { + header('location: article_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 表单验证 +include_once "../lib/form_check.php"; +// 空值验证 +nullCheck($articleTitle, '文章标题不能为空'); +if (!$categoryId) { + echo '请选择文章分类'; + exit(); +} +nullCheck($articleContent, '文章内容不能为空'); + +// 长度验证 +lenCheck($articleTitle, 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($articleIntro) > 0) { + lenCheck($articleIntro, 5, 50, '文章简介长度为5~50个字'); +} else { + $articleIntro = "暂无简介"; +} +lenCheck($articleContent, 20, 8000, '文章内容长度为20~800个字'); + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}' LIMIT 1;"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); + +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..8293e86a084fdb70c6782106c4225c276a8dd2e2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_delete.php" @@ -0,0 +1,44 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$articleId = $_POST['article_id']; + +if (@$_POST['del']) { + // 删除一个 + $sql = "DELETE FROM article WHERE article_id = {$articleId}"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM article WHERE article_id IN ({$articleId})"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; + } +} else { + echo "参数错误,请联系管理员"; + exit(); +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..b5f3e7cd05a928450f3b28d53e95f21eeb2cf049 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit.php" @@ -0,0 +1,154 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧数据 +$articleTitle = $articleInfo['article_title']; +$articleIntro = $articleInfo['article_intro']; +$categoryId = $articleInfo['category_id']; +$articleContent = $articleInfo['article_content']; + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..f986c33e1905f0baeb6e7a1606185c6d318a1248 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_edit_check.php" @@ -0,0 +1,87 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['edit'] !== '1') { + header('location: article_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$articleId = $_POST['article_id']; +// 旧数据 +$oldData = []; +$oldData['article_title'] = $_POST['old_title']; +$oldData['article_intro'] = $_POST['old_intro']; +$oldData['category_id'] = $_POST['old_category_id']; +$oldData['article_content'] = $_POST['old_content']; + +// 新数据 +$newData = []; +$newData['article_title'] = $_POST['article_title']; +$newData['article_intro'] = $_POST['article_intro']; +$newData['category_id'] = $_POST['category_id']; +$newData['article_content'] = $_POST['article_content']; + +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo "修改失败,原因:数据未更改"; + exit(); +} +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($newData['article_title'], '文章标题不能为空'); +if (!$newData['category_id']) { + echo '请选择文章分类'; + exit(); +} +nullCheck($newData['article_content'], '文章内容不能为空'); + +// 长度验证 +lenCheck($newData['article_title'], 5, 20, '文章标题长度为5~20个字'); +if (mb_strlen($newData['article_intro']) > 0) { + lenCheck($newData['article_intro'], 5, 50, '文章简介长度为5~50个字'); +} else { + $newData['article_intro'] = "这个作者很懒,什么都没有写"; +} +lenCheck($newData['article_content'], 20, 8000, '文章内容长度为20~800个字'); + +if (isset($diff['article_title'])) { + // 文章标题存在修改,验证新的标题是否重复 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$diff['article_title']}' LIMIT 1"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo '该文章标题已经存在,请更换后再试'; + exit(); + } +} + +// 生成sql +$updateData = ""; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$sql = + "UPDATE article + SET + {$updateData} + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..74c16dbd973908c063e85d48c7c1c1b7c8a1ae4c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/article_list.php" @@ -0,0 +1,145 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); + +$articleNum = count($articleList); +$articleNumOfPage = 20; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page-1)*$articleNumOfPage, $articleNumOfPage); +} + +?> + + + + + 文章列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..2ee7be4ccdb0aa3eb15f903b703ccb08e73293ab --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add.php" @@ -0,0 +1,90 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +?> + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..1af79b6f1be2282305201666d958b25b8da725ad --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_add_check.php" @@ -0,0 +1,48 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['add'] !== '1') { + header('location: category_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($categoryName, '分类名称不能为空'); +nullCheck($categoryDesc, '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($categoryName, 2, 15, '分类名称长度为2~15个字'); +lenCheck($categoryDesc, 10, 100, '分类描述长度为10~100个字'); + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}' LIMIT 1;"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 0) { + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..cca93e42e62a25d15f4a837bb2d814f5b72cf16c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_delete.php" @@ -0,0 +1,52 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + + + +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = $db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); +$categoryId = $_POST['category_id']; +// 删除 +if (@$_POST['del']) { + // 删除前检查列表下有没有文章 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE category_id = {$categoryId}"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); + } + $sql = "DELETE FROM category WHERE category_id = {$categoryId}"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM category WHERE category_id IN ({$categoryId})"; + $result = $db->exec($sql); + if ($result) { + echo "ok"; + } else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; + } +} else { + echo "参数错误,请联系管理员"; + exit(); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..272d0028d4734797f610a5241e2710beac24dc99 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit.php" @@ -0,0 +1,118 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=localhost;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$sql = "SELECT * FROM category WHERE category_id = {$id}"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧的数据 +$oldCategoryName = $categoryInfo['category_name']; +$oldCategoryDesc = $categoryInfo['category_desc']; +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..6d30ed3902464e3b3bf7a36fffc5782bc2601821 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_edit_check.php" @@ -0,0 +1,73 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['edit'] !== '1') { + header('location: category_edit.php'); + exit(); +} + +// 旧数据 +$oldData = []; +$oldData['category_name'] = $_POST['old_category_name']; +$oldData['category_desc'] = $_POST['old_category_desc']; +// 新数据 +$newData = []; +$newData['category_name'] = $_POST['category_name']; +$newData['category_desc'] = $_POST['category_desc']; +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo '修改失败,原因:未修改数据'; + exit(); +} + +include_once "../lib/form_check.php"; +// 表单验证 +nullCheck($newData['category_name'], '分类名称不能为空'); +nullCheck($newData['category_desc'], '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($newData['category_name'], 2, 15, '分类名称长度为2~15个字'); +lenCheck($newData['category_desc'], 10, 100, '分类描述长度为10~100个字'); + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +if (isset($diff['category_name'])) { + // 分类名存在修改,验证该分类名是否已经存在 + $sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$diff['category_name']}' LIMIT 1"; + $result = $db->query($sql); + $categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; + if ($categoryNum > 0) { + echo '该分类名称已经存在,请更换后再试'; + exit(); + } +} +// 生成sql +$updateData = ''; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$categoryId = $_POST['category_id']; +$sql = "UPDATE category + SET + {$updateData} + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + echo 'ok'; +} else { + echo "发生了错误,错误代码:". $db->errorInfo()[1] .",请联系管理员:1622485026@qq.com"; +} +?> \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..ce19504c202855013c117426e6f147d461e0bf2b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/category_list.php" @@ -0,0 +1,109 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$sql = "SELECT * FROM category ORDER BY category_id DESC;"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/get_captcha.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/get_captcha.php" new file mode 100644 index 0000000000000000000000000000000000000000..9cd85b362cba21acb146353d2d7974c083f45991 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/get_captcha.php" @@ -0,0 +1,3 @@ +alert('您已登录,正在跳转主页');location.assign('article_list.php');"; + exit(); + } +} +?> + + + + + + + 登录 + + + + +
+
+

登录博客系统

+ +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..85387c8f71b182bb0c627984cb3da813190d5c49 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/login_check.php" @@ -0,0 +1,54 @@ +location.assign('login.php');"; + exit(); +} + +session_start(); +// 表单验证 +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$captcha = $_POST['captcha']; // 验证码 +$rememberMe = $_POST['remember']; + +include_once "../lib/form_check.php"; +nullCheck($adminEmail, '邮箱不能空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($captcha, '请输入验证码'); +// 验证码 +if (strcasecmp($captcha, $_SESSION['captcha']) !== 0) { + echo "验证码错误"; + exit(); +} + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', 'MySql.12345'); +$db->query("set names utf8"); + +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}'"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $adminId = $adminInfo['admin_id']; + $adminName = $adminInfo['admin_name']; + $password = $adminInfo['admin_password']; + if ($adminPassword === $password) { + $sql = "INSERT INTO admin_log (admin_id, login_time) + VALUES ({$adminId}, ". time() ." );"; + $result = $db->exec($sql); + if ($result) { + $_SESSION['admin_name'] = $adminName; + $_SESSION['adminEmail'] = $adminEmail; + if ($rememberMe === 'true') { + setcookie('PHPSESSID', session_id(), time() + 86400, '/'); + } + echo "ok"; + } else { + echo "登录时发生了错误,错误代码:". $db->errorInfo()[1] ."请联系管理员: 1622485026@qq.com"; + } + } else { + echo "邮箱和密码不匹配,请检查后再试"; + } +} else { + echo "邮箱和密码不匹配.,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..a6960e675472df16a436c15adaa05c8e43c4c7a5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/admin/logout.php" @@ -0,0 +1,13 @@ +location.assign('login.php');"; + exit(); +} +unset($_SESSION['admin_name']); +unset($_SESSION['adminEmail']); +if (setcookie('PHPSESSID', '', time() - 3600, '/')) { + echo "ok"; +} else { + echo "退出登录失败,请联系管理员: 1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/category.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/category.php" new file mode 100644 index 0000000000000000000000000000000000000000..96906498cc524e04520cd73f53c12e8d440b26c4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/category.php" @@ -0,0 +1,83 @@ +query('set names utf8'); + +$categoryId = $_GET['category_id'] ?? ''; +$categoryName = $_GET['category_name'] ?? ''; +if (empty($categoryId || $categoryName)) { + header('location: index.php'); + exit(); +} + +$sql = "SELECT * FROM article WHERE category_id = {$categoryId} ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + <?php echo $categoryName; ?> + + + +
+ + +
+ + +
+
+

+ +
+
+ +
+ 阅读全文 +
+ + 该分类下暂时还没有文章

"; ?> + +
+
+ + 上一页 + + + > + + + 下一页 + +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..35bd49d712ad98e17e06fc0ba755894f843b4c11 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/admin-main.css" @@ -0,0 +1,151 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; + font-size:14px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr:hover td { + background-color: #F1F3F4; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table tr td .me { + color: #5889ff; +} +#right table.add tr td:first-child { + text-align: right; + width: 200px; + font-weight: 700; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td .readonly { + background-color: #DDD; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; + font-size: 16px; +} +#page a { + display: inline-block; + margin: 20px 7px; + color: #346cb0; +} +#page a.page-action { + text-decoration: underline; + color: #9dc55e; +} +#page a:hover { + color: #51a5ff; + text-shadow: 0 3px 3px #CCC; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..3cc834277cf09ee5cba1f92831779c20514e2dfc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/login.css" @@ -0,0 +1,98 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; + } +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; + display: flex; + align-items: center; + justify-content: center; +} +.info { + width: 250px; + height: 300px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.info input[type="text"], +.info input[type="password"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +/* 验证码 */ +#captcha { + width: 150px; + position: absolute; + left: 0; +} +#captcha-img { + position: absolute; + right: 0; +} +#checkbox-remember { + margin-top: 60px; + text-align: left; + height: 30px; + line-height: 30px; + user-select: none; +} +#remember { + +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..417042e897dc88cdc3cfb03c09723af838bd63a0 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/css/main.css" @@ -0,0 +1,124 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; + height: 98vh; +} +#container { + width: 960px; + background-color: white; + margin: 42px auto auto auto; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; + cursor: default; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + margin: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; + padding-bottom: 10px; +} +#article-list .article { + width: 880px; + margin: 24px auto auto auto; +} +#article-list .article.detail { + padding-bottom: 40px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list p { + margin-top: 10px; + text-align: center; +} +#article-list .article a { + font-size: 14px; + width: 65px; + height: 28px; + line-height: 28px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + margin: 20px 7px; + color: #97c5a4; +} +#page a.page-action { + text-decoration: underline; + color: #51a5ff; +} +#page a:hover { + color: #51a5ff; + text-shadow: 0 3px 3px #CCC; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/detail.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/detail.php" new file mode 100644 index 0000000000000000000000000000000000000000..01bcf2817873bdcba9995764ff16c493a1e918e5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/detail.php" @@ -0,0 +1,54 @@ +query('set names utf8'); + +$articleId = $_GET['article_id'] ?? ''; +if (empty($articleId)) { + header('location: index.php'); + exit(); +} +@$categoryId = $_GET['category_id']; +$sql = "SELECT * FROM article WHERE article_id = {$articleId}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 详情页 + + + +
+ + +
+
+
+

+ +
+
+ ', $articleInfo['article_content']); ?> +
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/index.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..dc8063525aed5339385a57874287e435756a59d9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/index.php" @@ -0,0 +1,73 @@ +query('set names utf8'); + +$sql = "SELECT * FROM article ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +// 数组截取 +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + 首页 + + + +
+ + +
+ +
+
+

+ +
+
+ +
+ 阅读全文 +
+ +
+
+ + 上一页 + + + > + + + 下一页 + +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..54da868b49c1be88b9d6b523fcc411c3840657a9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/admin-main.js" @@ -0,0 +1,96 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + if ($(this).attr('cancel') === '1') { + $('.check-box').prop('checked', false); + $(this).attr('cancel', '0'); + return; + } + $('.check-box').prop('checked', true); + $(this).attr('cancel', '1'); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + { + del_multi: 1, + category_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + { + del_multi: 1, + article_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0query($sql); + return $GLOBALS['list'] = $result->fetchAll(PDO::FETCH_ASSOC); +} +function execute($sql) { + return $GLOBALS['result'] = $GLOBALS['db']->exec($sql); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/lib/form_check.php" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/lib/form_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..c5556c8b41e7ac316b3c8d2a3a53e7e6277d04d6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/src/lib/form_check.php" @@ -0,0 +1,12 @@ + $maxLen) { + exit($tip); + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..b1e42d42a75de02fb675db3114a9db443a820fef --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/Blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210330/gd/captcha.php" "b/\346\242\201\345\233\275\347\201\257/20210330/gd/captcha.php" new file mode 100644 index 0000000000000000000000000000000000000000..f0ed08445fcf6e4f77983ccfc8021220e110062d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210330/gd/captcha.php" @@ -0,0 +1,109 @@ ++~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 + + + + + Title + + + +
+ captcha
+ 请输入验证码: + +
+ + + + + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..5da2c9effeef2c544144981ceeed047fc24e53b3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\225\260\346\215\256\345\272\223\345\210\233\345\273\272.sql" @@ -0,0 +1,91 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +USE blog; +-- 分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '暂无简介' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 管理员表 +CREATE TABLE IF NOT EXISTS `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(50) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(32) NOT NULL COMMENT '管理员密码', + `admin_status` TINYINT(5) NOT NULL DEFAULT 1 COMMENT '管理员账号状态', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员信息修改时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; + +-- 管理员日志表 +CREATE TABLE IF NOT EXISTS `admin_login_log` +( + `admin_id` INT UNSIGNED COMMENT '管理员编号', + `login_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员登录时间', + `ip_address` VARCHAR(15) DEFAULT '0' NOT NULL COMMENT '登录系统的ip地址', + `session_id` VARCHAR(50) NOT NULL COMMENT '登录时使用的session_id', + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员登录日志表'; + +-- 管理员信息变更日志表 +CREATE TABLE `admin_update_log` +( + `admin_exec_id` INT UNSIGNED NOT NULL COMMENT '管理员编号', + `admin_update_id` INT UNSIGNED NOT NULL COMMENT '管理员信息变更编号', + `admin_update_info` VARCHAR(500) NOT NULL COMMENT '管理员变更信息', + `exec_time` INT(11) UNSIGNED NOT NULL, + FOREIGN KEY (`admin_exec_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT, + FOREIGN KEY (`admin_update_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员信息变更日志表'; +-- 分类日志表 +CREATE TABLE `category_log` +( + `category_id` INT UNSIGNED NOT NULL COMMENT '分类编号', + `admin_id` INT UNSIGNED NOT NULL COMMENT '管理员执行者编号', + `category_update_info` VARCHAR(500) NOT NULL COMMENT '分类变更信息', + `category_update_time` INT(11) COMMENT '分类变更时间', + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT, + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类信息变更日志表'; +-- 文章日志表 +CREATE TABLE `article_log` +( + `article_id` INT UNSIGNED NOT NULL COMMENT '文章编号', + `admin_id` INT UNSIGNED NOT NULL COMMENT '管理员执行者编号', + `article_update_info` VARCHAR(500) NOT NULL COMMENT '文章变更信息', + `article_update_time` INT(11) UNSIGNED NOT NULL, + FOREIGN KEY (`article_id`) REFERENCES `article`(`article_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT, + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章信息变更日志表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..327b1a426d9d4eee7ea0f28fafa7b04a25cb91b5 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/blog\345\210\233\345\273\272(\346\226\260).sql" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/blog\345\210\233\345\273\272(\346\226\260).sql" new file mode 100644 index 0000000000000000000000000000000000000000..fc8a52929298fe30c8fdfde58189c831fb095355 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/blog\345\210\233\345\273\272(\346\226\260).sql" @@ -0,0 +1,54 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +USE blog; +-- 分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '暂无简介' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 管理员表 +CREATE TABLE IF NOT EXISTS `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(50) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(32) NOT NULL COMMENT '管理员密码', + `admin_status` TINYINT(5) NOT NULL DEFAULT 1 COMMENT '管理员账号状态', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员信息修改时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; + +-- 管理员日志表 +CREATE TABLE IF NOT EXISTS `admin_login_log` +( + `admin_id` INT UNSIGNED COMMENT '管理员编号', + `login_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员登录时间', + `ip_address` VARCHAR(15) DEFAULT '0' NOT NULL COMMENT '登录系统的ip地址', + `session_id` VARCHAR(50) NOT NULL COMMENT '登录时使用的session_id', + FOREIGN KEY (`admin_id`) REFERENCES `admin`(`admin_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员登录日志表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/data_add_multi.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/data_add_multi.php" new file mode 100644 index 0000000000000000000000000000000000000000..7b53b0f2f919df5282c66866b531b6d2caf056fb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/data_add_multi.php" @@ -0,0 +1,41 @@ +exec($sql); +//if (!$result) { +// echo 'category failed'; +// exit(); +//} +echo 'category success'; +$data = ""; +// 文章 +$sql = "INSERT INTO article(article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES "; +$time = time(); +for ($i = 1000; $i < 5000; $i++) { + for ($c = 1; $c < 10; $c++) { + $data .= "('{$c}_{$i}_title', {$i}_intro', {$c}, '{$i}_content', {$time}, {$time}),"; + } + $sql .= $data; +} + +exit($data); +$data = rtrim($data, ','); +$sql .= $data; + +exit($sql); +$result = $db->exec($sql); +if (!$result) { + echo 'article failed'; + exit(); +} +echo 'article success'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..059e37b03b7153539ec56621fdd966cd94a26a4f Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" new file mode 100644 index 0000000000000000000000000000000000000000..4d5eb1f387e126ad153aa5684188b96378135ecd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" @@ -0,0 +1,15 @@ +## 2021-04-02 +### ݿ仯 +- Աֶ + * admin_statusԱ˺״̬ +- Ա־ΪԱ¼־ +- Ա¼־ֶ + * ip_address¼ip + * session_id¼ʱsession_id +- ӡԱϢ־ +- ӡϢ־ +- ӡϢ־ + +### ҳ仯 +* ޸ҳʽ +* ±༭ҳˡΪաѡѡὫΪֵ \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" new file mode 100644 index 0000000000000000000000000000000000000000..89885f37aca997fd165636a1193cb2eb30f1f904 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" @@ -0,0 +1,35 @@ +USE blog; +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES + ('html&css', '编写静态网页的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript', '网页交互基础', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql ', 'mysql的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux', '认识Linux', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES + ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 2, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('sql server入门', '暂无简介' , '小红', 4, 'sql server入门 sql server入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('什么是数据库', '数据库的概念' , '小红', 5, '数据库的概念数据库的概念', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql入门', 'mysql入门基础知识' , '小红', 5, 'mysql入门mysql入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql优化', 'mysql优化' , '小红', 5, 'mysql优化mysql优化', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php基础入门', 'php入门基础' , '小红', 3, 'php基础入门php基础入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html入门指南', 'html基础入门' , '小红', 1, 'html入门指南', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html学习', 'html学习' , '小红', 1, 'html学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('css进阶学习', 'css进阶学习' , '小红', 1, 'css进阶学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识javascript', '认识javascript' , '小红', 2, '认识javascript', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('BOM、DOM介绍', 'BOM、DOM介绍' , '小红', 2, 'BOM、DOM介绍', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript实例', 'javascript实例' , '小红', 2, 'javascript实例javascript实例', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识jquery', '认识jquery' , '小红', 2, '认识jquery', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux入门', 'Linux入门' , '小红', 6, 'Linux入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux和Windows', 'Linux和Windows' , '小红', 6, 'Linux和Windows', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, admin_status, register_time, update_time) +VALUES + ('root', '1622485026@qq.com', '123456', 1, UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('admin', '3341727374@qq.com', '123456', 1, UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a8ff6d8cbd882a77abb1ea0c04b039d3e14bc3c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..7a655df9e9cc4220a0e31b6578da5b58960780b7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,50 @@ + + int + ַ(20) ǿ + ַ(255) ǿ + ޸ʱ int(11) ʱ ޷ ǿ + ʱ int(11) ʱ ޷ ǿ + +± + ± int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ޷ ǿ + ʱ int(11) ʱ ޷ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(50) ǿ + Ա ַ(32) ǿ + Ա˺״̬ TINYINT(5) ĬΪ1() ޷ + ״̬У1() 2() 3(ע) + Աעʱ int(11) ʱ ޷ ǿ + ԱϢ޸ʱ int(11) ʱ ޷ ǿ + +Ա¼־ + Ա int ԱĹԱid ǿ + Ա¼ʱ int(11) ʱ ޷ ǿ + ¼ϵͳipַ ַ(15) ǿ + ¼ʱsession_id ַ(50) ǿ + +ԱϢ־ + Աִ߱ INT ԱĹԱŵ ǿ + ԱϢ INT ԱĹԱŵ ǿ + ԱϢ ַ(500) ǿ + ִʱ INT(11) ʱ ޷ ǿ + +Ϣ־ + INT ķŵ ǿ + Աִ߱ INT ԱĹԱŵ ǿ + Ϣ ַ(500) ǿ + ʱ INT(11) ʱ ޷ ǿ + +Ϣ־ + ± INT ±±ŵ ǿ + Աִ߱ INT ԱĹԱŵ ǿ + ±Ϣ ַ(500) ǿ + ±ʱ INT(11) ʱ ޷ ǿ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..d6a26b4d227e0d0e0680297c9bdd71978f19e8dc Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/blog.log" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/blog.log" new file mode 100644 index 0000000000000000000000000000000000000000..e5512563efc225c59acf8a548d270f55614dd875 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/blog.log" @@ -0,0 +1,50 @@ +{"action":"login","admin_name":"root","admin_email":"123456@qq.com","ip":"127.0.0.1","content":"后台登陆成功","time":"2021-04-06 06:44:58"}, +{"action":"login","admin_name":"root","admin_email":"123456@qq.com","ip":"127.0.0.1","content":"后台登陆成功","time":"2021-04-06 06:45:02"}, +{"action":"login","admin_name":"root","admin_email":"123456@qq.com","ip":"127.0.0.1","content":"后台登陆成功","time":"2021-04-06 06:47:40"}, +{"action":"login","admin_name":"admin","admin_email":"123456@qq.com","ip":"127.0.0.1","content":"登录","time":"2021-04-06 06:59:33"}, +{"action":"login","admin_name":"admin","admin_email":"123456@qq.com","ip":"127.0.0.1","content":"登录","time":"2021-04-06 06:59:56"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 07:06:04"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"172.16.20.127","content":"后台登录成功","time":"2021-04-06 07:07:49"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-06 07:19:40"}, +{"action":"login","admin_name":null,"admin_email":"16224850d26@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:20:41"}, +{"action":"login","admin_name":null,"admin_email":"16224850d2d6@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:21:41"}, +{"action":"login","admin_name":null,"admin_email":"162248d5026@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:22:27"}, +{"action":"login","admin_name":null,"admin_email":"dd","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:23:04"}, +{"action":"login","admin_name":null,"admin_email":"1622485d026@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:23:30"}, +{"action":"login","admin_name":null,"admin_email":"16224850d26@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:24:05"}, +{"action":"login","admin_name":"","admin_email":"1622485d026@qq.com","ip":"127.0.0.1","content":"后台登录失败,原因:邮箱不存在","time":"2021-04-06 07:25:41"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 07:28:35"}, +{"action":"add_article","article_title":"dddddddd","content":"增加文章成功","time":"2021-04-06 07:36:36"}, +{"action":"logout","admin_name":"root","admin_email":null,"ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:26:15"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:26:45"}, +{"action":"logout","admin_name":"root","admin_email":null,"ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:26:48"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:27:17"}, +{"action":"logout","admin_name":null,"admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:27:20"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:29:03"}, +{"action":"logout","admin_name":null,"admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:29:06"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:29:37"}, +{"action":"logout","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:29:40"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:30:18"}, +{"action":"logout","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:30:23"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:32:45"}, +{"action":"edit_article","article_title":null,"content":"增加文章失败,原因:文章标题已存在","time":"2021-04-06 09:32:57"}, +{"action":"add_article","article_title":"dddddddd","content":"增加文章失败,原因:文章标题已存在","time":"2021-04-06 09:34:56"}, +{"action":"add_article","article_title":"dddddddddd","content":"增加文章成功","time":"2021-04-06 09:34:59"}, +{"action":"edit_article","article_title":"dddddddddd","content":"编辑文章成功","time":"2021-04-06 09:35:07"}, +{"action":"edit_article","article_title":"dddddddddd","content":"编辑文章成功","time":"2021-04-06 09:35:14"}, +{"action":"delete_article","article_title":"","content":"删除文章失败,article_id:18","time":"2021-04-06 09:38:19"}, +{"action":"delete_article","article_title":"","content":"删除文章失败,article_id:18","time":"2021-04-06 09:38:27"}, +{"action":"delete_article","article_title":"","content":"删除文章失败,article_id:18,数据库错误信息:","time":"2021-04-06 09:41:45"}, +{"action":"delete_article","article_title":"","content":"删除文章成功","time":"2021-04-06 09:44:14"}, +{"action":"delete_article","article_title":"","content":"删除文章成功","time":"2021-04-06 09:44:18"}, +{"action":"delete_category","article_title":"1","content":"删除分类失败,原因:分类下还有文章","time":"2021-04-06 09:44:25"}, +{"action":"delete_category","article_title":"2","content":"删除分类失败,原因:分类下还有文章","time":"2021-04-06 09:44:33"}, +{"action":"delete_category","article_title":"1,2,3,4,5,6","content":"删除分类失败,数据库错误信息:1451","time":"2021-04-06 09:44:35"}, +{"action":"delete_article","article_title":"","content":"批量删除文章成功","time":"2021-04-06 09:44:49"}, +{"action":"delete_article","article_title":"","content":"删除文章成功","time":"2021-04-06 09:46:01"}, +{"action":"delete_article","article_title":"","content":"批量删除文章成功","time":"2021-04-06 09:46:07"}, +{"action":"delete_article","article_title":"2,14,15","content":"批量删除文章成功","time":"2021-04-06 09:47:10"}, +{"action":"delete_article","article_title":"20,21","content":"批量删除文章成功","time":"2021-04-06 09:47:39"}, +{"action":"edit_category","article_title":"html&css","content":"编辑分类成功","time":"2021-04-06 09:48:07"}, +{"action":"login","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"后台登录成功","time":"2021-04-06 09:59:01"}, +{"action":"logout","admin_name":"root","admin_email":"1622485026@qq.com","ip":"127.0.0.1","content":"退出登录成功","time":"2021-04-06 09:59:22"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/write_log.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/write_log.php" new file mode 100644 index 0000000000000000000000000000000000000000..f24e5d93487e7828670efd66cfb9d87ae7f6f779 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/logs/write_log.php" @@ -0,0 +1,50 @@ + 'login', + 'admin_name' => $adminName, + 'admin_email' => $adminEmail, + 'ip' => $_SERVER['REMOTE_ADDR'], + 'content' => $content, + 'time' => date('Y-m-d H:i:s') + ]; + // 将数组解析为json字符串 + $jsonStr = json_encode($log, JSON_UNESCAPED_UNICODE); + // 将json字符串写入日志文件中 + $result = file_put_contents('blog.log', $jsonStr.",". PHP_EOL, FILE_APPEND); + if ($result) { + return "写入日志成功"; + } else { + return "写入日志失败"; + } +} +var_dump(loginLog('root', '123456@qq.com', '后台登陆成功')); +// +//$file = fopen('login.log', 'a+'); +//if ($file) { +// $result = fwrite($file, $jsonStr . PHP_EOL); +// if ($result) { +// echo "写入文件成功"; +// } else { +// echo "写入文件失败"; +// } +// fclose($file); +//} else { +// echo "打开文件失败"; +//} +function writeLog($filename,$msg){ + $res = array(); + $res['msg'] = $msg; + $res['logtime'] = date("Y-m-d H:i:s",time()); + + //如果是新建的日志文件,去掉内容中的第一个字符逗号 + if(file_exists($filename)){ + $content = ",".json_encode($res).PHP_EOL; + }else{ + $content = json_encode($res); + } + + //往日志文件内容后面追加日志内容 + file_put_contents($filename, $content, FILE_APPEND); +} +//writeLog('login.log', '登录'); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..b40b9e9be49ce82a777d6ed4ab7186e043b451ed --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit.php" @@ -0,0 +1,134 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: admin_list.php'); + exit(); +} + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$sql = "SELECT * FROM admin WHERE admin_id = {$id}"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); + +// 保存旧数据 +$oldName = $adminInfo['admin_name']; +$adminEmail = $adminInfo['admin_email']; +$oldPassword = $adminInfo['admin_password']; + +// 防止强行访问 +if ($oldName == 'root' && $adminName != 'root') { + header('location: admin_list.php'); + exit(); +} +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..dd8ff7f49c7c0b5e27a50d3707aaf7088da31a5c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_edit_check.php" @@ -0,0 +1,75 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminExecName = $_SESSION['admin_name']; +$adminExecId = $_SESSION['admin_id']; + +if ($_POST['edit'] !== '1') { + header('location: admin_edit.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$adminId = $_POST['admin_id']; +// 旧数据 +$oldData = []; +$oldData['admin_name'] = $_POST['old_name']; +$oldData['admin_password'] = $_POST['old_password']; + +// 新数据 +$newData = []; +$newData['admin_name'] = $_POST['admin_name']; +$newData['admin_password'] = $_POST['admin_password']; + +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo "修改失败,原因:数据未修改"; + exit(); +} + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($newData['admin_name'], '用户名不能为空'); +nullCheck($newData['admin_password'], '密码不能为空'); + +// 长度验证 +lenCheck($newData['admin_name'], 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($newData['admin_password'], 6, 12, '密码长度为6~12个字'); + +if (isset($diff['admin_name'])) { + // 用户名存在修改,检查数据库中是否已存在用户名 + $sql = "SELECT COUNT(*) AS admin_num FROM admin WHERE admin_name = '{$newData['admin_name']}' LIMIT 1;"; + $result = $db->query($sql); + $nameNum = (int)$result->fetch(PDO::FETCH_ASSOC)['admin_num']; + if ($nameNum > 0) { + operationLog('edit_admin', $newData['admin_name'], '编辑管理员失败,原因:管理员名称已存在'); + echo "该管理员名称已存在,请更换后再试"; + exit(); + } +} + +// 生成sql +$updateData = ""; +foreach ($diff as $key => $value) { + $updateData .= "{$key} = '{$value}',"; +} +$updateData = rtrim($updateData, ','); +$sql = "UPDATE admin SET {$updateData} WHERE admin_id = {$adminId}"; +$result = $db->exec($sql); +if ($result) { + operationLog('edit_admin', $newData['admin_name'], '编辑管理员成功'); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog('edit_admin', $newData['admin_name'], "编辑管理员失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..28424b67a972b59609944dba8b71740068159a5f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_list.php" @@ -0,0 +1,138 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$sql = + "SELECT + admin.admin_id, + admin_name, + admin_email, + admin_status, + register_time, + admin.update_time, + MAX(login_time) AS last_login_time + FROM admin + LEFT JOIN admin_login_log ON admin.admin_id = admin_login_log.admin_id + GROUP BY admin.admin_id + ORDER BY MAX(login_time) DESC;"; +$result = $db->query($sql); +$adminList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..96432488431c306f65aeb37d39410e95368dd6eb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register.php" @@ -0,0 +1,102 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +?> + + + + + 注册管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..f501fc237ad3be97a71cd7d740fe899fdf0e1874 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/admin_register_check.php" @@ -0,0 +1,79 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminExecName = $_SESSION['admin_name']; +$adminExecId = $_SESSION['admin_id']; + +if ($_POST['re'] !== '1') { + header('location: admin_register.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$adminName = $_POST['admin_name']; +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$confirmPassword = $_POST['confirm_password']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($adminName, '用户名不能为空'); +nullCheck($adminEmail, '邮箱不能为空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($confirmPassword, '密码不能为空'); + +// 长度验证 +lenCheck($adminName, 1, 10, '管理员名称长度为 1~10个字'); +lenCheck($adminPassword, 6, 12, '密码长度为6~12个字'); + +// 邮箱验证(简单) +if (!preg_match("/.+@.+\..+/", $adminEmail)) { + exit('邮箱格式错误'); +} + +// 检查两次密码是否一致 +if ($adminPassword !== $confirmPassword) { + echo "两次输入的密码不一致,请检查后再试"; + exit(); +} + +// 检查数据库中是否已存在用户名 +$sql = "SELECT COUNT(*) AS admin_num FROM admin WHERE admin_name = '{$adminName}' LIMIT 1;"; +$result = $db->query($sql); +$nameNum = (int)$result->fetch(PDO::FETCH_ASSOC)['admin_num']; +if ($nameNum > 0) { + operationLog('register_admin', $adminName, '注册管理员失败,原因:管理员名称已存在'); + echo "该管理员名称已存在,请更换后再试"; + exit(); +} + +// 检查数据库中是否已存在邮箱 +$sql = "SELECT COUNT(*) AS email_num FROM admin WHERE admin_email = '{$adminEmail}' LIMIT 1"; +$result = $db->query($sql); +$emailNum = (int)$result->fetch(PDO::FETCH_ASSOC)['email_num']; +if ($emailNum > 0) { + operationLog('register_admin', $adminName, '注册管理员失败,原因:邮箱已存在'); + echo "该邮箱已存在,请更换后再试"; + exit(); +} + +$sql = "INSERT INTO admin (admin_name, admin_email, admin_password, register_time, update_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$confirmPassword}', ". time() .", ". time() .");"; +$result = $db->exec($sql); +if ($result) { + operationLog('register_admin', $adminName, '注册管理员成功'); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog("register_admin", $adminName, "注册管理员失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..b02b96a94cb574535ff795bbc066d7c42a661ff2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add.php" @@ -0,0 +1,131 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 增加文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..d40211427ba74f9e08f0d293e793e29f7ddc59e7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_add_check.php" @@ -0,0 +1,70 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +$adminId = $_SESSION['admin_id']; +if ($_POST['add'] !== '1') { + header('location: article_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$articleTitle = $_POST['article_title']; +$articleIntro = $_POST['article_intro']; +$nullIntro = $_POST['null_intro']; +$categoryId = $_POST['category_id']; +$articleContent = $_POST['article_content']; + +// 表单验证 +include_once "../lib/form_check.php"; +// 空值验证 +nullCheck($articleTitle, '文章标题不能为空'); +if (!$categoryId) { + echo '请选择文章分类'; + exit(); +} +nullCheck($articleContent, '文章内容不能为空'); + +// 长度验证 +lenCheck($articleTitle, 5, 20, '文章标题长度为5~20个字'); +if ($nullIntro == 'false') { + nullCheck($articleIntro, '文章简介不能为空;若需要为空,请勾选“简介为空”'); + lenCheck($articleIntro, 5, 50, '文章简介长度为5~50个字'); +} else { + $articleIntro = "暂无简介"; +} + + +lenCheck($articleContent, 20, 8000, '文章内容长度为20~800个字'); + +// 检查数据库中是否有相同标题的文章 +$sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$articleTitle}' LIMIT 1;"; +$result = $db->query($sql); +$articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + operationLog('add_article', $articleTitle, '增加文章失败,原因:文章标题已存在'); + echo "列表里已存在该标题的文章,请更换后再试"; + exit(); +} +$sql = "INSERT INTO article (article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$categoryId}', '{$articleContent}', ". time() .", ". time() ." );"; +$result = $db->exec($sql); + +if ($result) { + // 写入日志 + operationLog('add_article', $articleTitle, "增加文章成功"); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog('add_article', $articleTitle, "增加文章失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码{$errorInfo}请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..5e32dd9dd45d62787927afb8c64acb0f2ec87e67 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_delete.php" @@ -0,0 +1,52 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} + +include_once "../lib/form_check.php"; +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$articleId = $_POST['article_id']; + +if (@$_POST['del']) { + // 删除一个 + $sql = "DELETE FROM article WHERE article_id = {$articleId}"; + $result = $db->exec($sql); + if ($result) { + operationLog('delete_article', $articleId, "删除文章成功"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo()[1]; + operationLog('delete_article', '', "删除文章失败,article_id:{$articleId},数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM article WHERE article_id IN ({$articleId})"; + $result = $db->exec($sql); + if ($result) { + operationLog('delete_article', $articleId, "批量删除文章成功"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo()[1]; + operationLog('delete_article', '', "批量删除文章失败,article_id:{$articleId},数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; + } +} else { + operationLog('delete_article', '', '非法访问'); + echo "参数错误,请联系管理员"; + exit(); +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..6d0dc5bf31c81f716b7d0b825365b252c6868bcb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit.php" @@ -0,0 +1,169 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +// 查找文章信息 +$sql = "SELECT * FROM article WHERE article_id = {$id}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧数据 +$articleTitle = $articleInfo['article_title']; +$articleIntro = $articleInfo['article_intro']; +$categoryId = $articleInfo['category_id']; +$articleContent = $articleInfo['article_content']; + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 编辑文章 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..71093f35b0bc0369315d223c236656be1b81d279 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_edit_check.php" @@ -0,0 +1,99 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +$adminId = $_SESSION['admin_id']; + +if ($_POST['edit'] !== '1') { + header('location: article_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$articleId = $_POST['article_id']; +$nullIntro = $_POST['null_intro']; +// 旧数据 +$oldData = []; +$oldData['article_title'] = $_POST['old_title']; +$oldData['article_intro'] = $_POST['old_intro']; +$oldData['category_id'] = $_POST['old_category_id']; +$oldData['article_content'] = $_POST['old_content']; + +// 新数据 +$newData = []; +$newData['article_title'] = $_POST['article_title']; +$newData['article_intro'] = $_POST['article_intro']; +$newData['category_id'] = $_POST['category_id']; +$newData['article_content'] = $_POST['article_content']; + +if ($nullIntro == 'true') { + $newData['article_intro'] = "暂无简介"; +} + +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo "修改失败,原因:数据未更改"; + exit(); +} +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($newData['article_title'], '文章标题不能为空'); +if (!$newData['category_id']) { + echo '请选择文章分类'; + exit(); +} +nullCheck($newData['article_content'], '文章内容不能为空'); + +// 长度验证 +lenCheck($newData['article_title'], 5, 20, '文章标题长度为5~20个字'); +if ($nullIntro == 'false') { + nullCheck($newData['article_intro'], '文章简介不能为空;若需要为空,请勾选“简介为空”'); + lenCheck($newData['article_intro'], 5, 50, '文章简介长度为5~50个字'); +} else { + $newData['article_intro'] = "暂无简介"; +} +lenCheck($newData['article_content'], 20, 8000, '文章内容长度为20~800个字'); + +if (isset($diff['article_title'])) { + // 文章标题存在修改,验证新的标题是否重复 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE article_title = '{$diff['article_title']}' LIMIT 1"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + operationLog('edit_article', $diff['article_title'], '增加文章失败,原因:文章标题已存在'); + echo '该文章标题已经存在,请更换后再试'; + exit(); + } +} + +// 生成sql +$updateData = ""; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$sql = + "UPDATE article + SET + {$updateData} + update_time = '". time() ."' + WHERE article_id = {$articleId};"; +$result = $db->exec($sql); +if ($result) { + // 日志 + operationLog('edit_article', $newData['article_title'], "编辑文章成功"); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog('edit_article', $newData['article_title'], "编辑文章失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码{$errorInfo},请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..cf05283550698d561a7a37b96956c28706a6d7e1 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/article_list.php" @@ -0,0 +1,145 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$sql = + "SELECT + article_id, + article_title, + category_name, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article.update_time DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); + +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page-1)*$articleNumOfPage, $articleNumOfPage); +} + +?> + + + + + 文章列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..620c7ceacc7773787a82318b807db9e7c8d94350 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add.php" @@ -0,0 +1,90 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +?> + + + + + 增加文章 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..b8b197e80b9ab09a8e7b45cbac2b37e8d36bc97c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_add_check.php" @@ -0,0 +1,60 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +if ($_POST['add'] !== '1') { + header('location: category_add.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$sql = "SELECT COUNT(*) AS category_num FROM category"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum >= 10) { + exit('当前系统仅支持创建10个分类,若需增加请等待后续更新'); +} + +$categoryName = $_POST['category_name']; +$categoryDesc = $_POST['category_desc']; +$adminId = $_SESSION['admin_id']; + +// 表单验证 +include_once "../lib/form_check.php"; +nullCheck($categoryName, '分类名称不能为空'); +nullCheck($categoryDesc, '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($categoryName, 2, 15, '分类名称长度为2~15个字'); +lenCheck($categoryDesc, 10, 100, '分类描述长度为10~100个字'); + +// 检查数据库中是否有同名的分类 +$sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$categoryName}' LIMIT 1;"; +$result = $db->query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum > 0) { + operationLog('add_category', $categoryName, "增加分类失败,原因:分类名称已存在"); + echo '列表中已有同名的分类,请更换后再试'; + exit(); +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); +if ($result) { + operationLog('add_category', $categoryName, "增加分类成功"); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog('add_category', $categoryName, "增加分类失败, 数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_delete.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_delete.php" new file mode 100644 index 0000000000000000000000000000000000000000..3ba2dff58241d323076a8678ae15f7be3a468ff4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_delete.php" @@ -0,0 +1,58 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +include_once "../lib/form_check.php"; +if (@$_POST['del'] !== '1' && $_POST['del_multi'] !== '1') { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = $db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); +$categoryId = $_POST['category_id']; +// 删除 +if (@$_POST['del']) { + // 删除前检查列表下有没有文章 + $sql = "SELECT COUNT(*) AS article_num FROM article WHERE category_id = {$categoryId}"; + $result = $db->query($sql); + $articleNum = (int)$result->fetch(PDO::FETCH_ASSOC)['article_num']; + if ($articleNum > 0) { + operationLog('delete_category', $categoryId, "删除分类失败,原因:分类下还有文章"); + echo "该分类下还有文章,无法删除。若要删除该分类,请先删除该分类下所有文章"; + exit(); + } + $sql = "DELETE FROM category WHERE category_id = {$categoryId}"; + $result = $db->exec($sql); + if ($result) { + operationLog('delete_category', $categoryId, "删除分类成功"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo()[1]; + operationLog('delete_category', $categoryId, "删除分类失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; + } +} else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM category WHERE category_id IN ({$categoryId})"; + $result = $db->exec($sql); + if ($result) { + operationLog('delete_category', $categoryId, "删除分类成功"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo()[1]; + operationLog('delete_category', $categoryId, "删除分类失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; + } +} else { + operationLog('delete_category', '', "非法访问"); + echo "参数错误,请联系管理员"; + exit(); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..855bde70f19804e6f089d8fa3d626fb9c3d736b2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit.php" @@ -0,0 +1,118 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: category_list.php'); + exit(); +} +$dsn = "mysql: host=localhost;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$sql = "SELECT * FROM category WHERE category_id = {$id}"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); +// 保存旧的数据 +$oldCategoryName = $categoryInfo['category_name']; +$oldCategoryDesc = $categoryInfo['category_desc']; +?> + + + + + 编辑分类 + + + + +
+ + + + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..6a2d86323f8a0d7d27b9f249887acbc98fcfa845 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_edit_check.php" @@ -0,0 +1,76 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +$adminId = $_SESSION['admin_id']; + +if ($_POST['edit'] !== '1') { + header('location: category_edit.php'); + exit(); +} + +// 旧数据 +$oldData = []; +$oldData['category_name'] = $_POST['old_category_name']; +$oldData['category_desc'] = $_POST['old_category_desc']; +// 新数据 +$newData = []; +$newData['category_name'] = $_POST['category_name']; +$newData['category_desc'] = $_POST['category_desc']; +$diff = array_diff($newData, $oldData); +if (empty($diff)) { + echo '修改失败,原因:未修改数据'; + exit(); +} + +include_once "../lib/form_check.php"; +// 表单验证 +nullCheck($newData['category_name'], '分类名称不能为空'); +nullCheck($newData['category_desc'], '分类描述不能为空'); + +// 分类名称长度验证 +lenCheck($newData['category_name'], 2, 15, "分类名称长度为2~15个字"); +lenCheck($newData['category_desc'], 10, 150, '分类描述长度为10~150个字'); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +if (isset($diff['category_name'])) { + // 分类名存在修改,验证该分类名是否已经存在 + $sql = "SELECT COUNT(*) AS category_num FROM category WHERE category_name = '{$diff['category_name']}' LIMIT 1"; + $result = $db->query($sql); + $categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; + if ($categoryNum > 0) { + operationLog('edit_category', $newData['category_name'], "编辑分类失败,原因:分类名称已存在"); + echo '该分类名称已经存在,请更换后再试'; + exit(); + } +} +// 生成sql +$updateData = ''; +foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; +} + +$categoryId = $_POST['category_id']; +$sql = "UPDATE category + SET + {$updateData} + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; +$result = $db->exec($sql); +if ($result) { + operationLog('edit_category', $newData['category_name'], "编辑分类成功"); + echo 'ok'; +} else { + $errorInfo = $db->errorInfo()[1]; + operationLog('edit_category', $newData['category_name'], "编辑分类失败,数据库错误信息:{$errorInfo}"); + echo "发生了错误,错误代码:{$errorInfo},请联系管理员:1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..5e8bdf927e832626208f4ff3cdc4f7fb246e8d05 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/category_list.php" @@ -0,0 +1,109 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; + +date_default_timezone_set("PRC"); +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$sql = "SELECT * FROM category ORDER BY update_time DESC;"; +$db->query("set names utf8"); +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..6935100896c1491997d4539cf9b2a378e0c618d8 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login.php" @@ -0,0 +1,73 @@ +alert('您已登录,正在跳转主页');location.assign('article_list.php');"; + exit(); + } +} +?> + + + + + + + 登录 + + + + +
+
+

登录博客系统

+ +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login_check.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..b3d9d96d0658f42e1676accd277f40e1bf9ad3ba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/login_check.php" @@ -0,0 +1,56 @@ +location.assign('login.php');"; + exit(); +} + +session_start(); +// 表单验证 +$adminEmail = $_POST['admin_email']; +$adminPassword = $_POST['admin_password']; +$captcha = $_POST['captcha']; // 验证码 +$rememberMe = $_POST['remember']; + +include_once "../lib/form_check.php"; +nullCheck($adminEmail, '邮箱不能空'); +nullCheck($adminPassword, '密码不能为空'); +nullCheck($captcha, '请输入验证码'); +// 验证码 +if (strcasecmp($captcha, $_SESSION['captcha']) !== 0) { + echo "验证码错误"; + exit(); +} +$dsn = "mysql: host=127.0.0.1;dbname=blog"; +$db = new PDO($dsn, 'root', '123456'); +$db->query("set names utf8"); + +$sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}' AND admin_status = 1"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); +if ($adminInfo) { + $adminId = $adminInfo['admin_id']; + $adminName = $adminInfo['admin_name']; + $password = $adminInfo['admin_password']; + // 匹配密码 + if ($adminPassword === $password) { + // 将日志写入数据库 + $sql = "INSERT INTO admin_login_log (admin_id, login_time, ip_address, session_id) + VALUES ({$adminId}, ". time() .", '{$_SERVER['REMOTE_ADDR']}', '". session_id() ."' );"; + $db->exec($sql); + $_SESSION['admin_id'] = $adminId; + $_SESSION['admin_name'] = $adminName; + $_SESSION['admin_email'] = $adminEmail; + if ($rememberMe === 'true') { + setcookie('PHPSESSID', session_id(), time() + 86400, '/'); + } + // 将日志写入日志文件 + loginLog('login', $adminName, $adminEmail, '后台登录成功'); + echo "ok"; + } else { + loginLog('login', $adminName, $adminEmail, '后台登录失败,原因:邮箱与密码不匹配'); + echo "邮箱和密码不匹配,请检查后再试"; + } +} else { + loginLog('login', '', $adminEmail, '后台登录失败,原因:邮箱不存在'); + echo "邮箱和密码不匹配,请检查后再试"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..77a28994b9f81dbffcd5156050c756391c56925d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/admin/logout.php" @@ -0,0 +1,18 @@ +location.assign('login.php');"; + exit(); +} +$adminName = $_SESSION['admin_name']; +$adminEmail = $_SESSION['admin_email']; +unset($_SESSION['admin_name']); +unset($_SESSION['admin_email']); +include_once "../lib/form_check.php"; +if (setcookie('PHPSESSID', '', time() - 3600, '/')) { + loginLog('logout', $adminName, $adminEmail, '退出登录成功'); + echo "ok"; +} else { + loginLog('logout', $adminName, $adminEmail, '退出登录失败,原因:过期cookie失败'); + echo "退出登录失败,请联系管理员: 1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/category.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/category.php" new file mode 100644 index 0000000000000000000000000000000000000000..508dfa56aaa8f00708dc0930da07cc761977c093 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/category.php" @@ -0,0 +1,84 @@ +query('set names utf8'); + +$categoryId = $_GET['cid'] ?? ''; +$categoryName = $_GET['cna'] ?? ''; +if (empty($categoryId || $categoryName)) { + header('location: index.php'); + exit(); +} + +$sql = "SELECT * FROM article WHERE category_id = {$categoryId} ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + <?php echo $categoryName; ?> + + + +
+ + +
+ + +
+
+

+ +
+
+ +
+ 阅读全文 +
+ + 该分类下暂时还没有文章

"; ?> + +
+
+ + + + 1 && $i <= $pageNum; $i++): ?> + " > + + + + +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..167f6c901dc2f051db3726ffbe35f49eb393bc6e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/admin-main.css" @@ -0,0 +1,196 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; + height: 650px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; + font-size:14px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr:hover td { + background-color: #F1F3F4; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +/* 名称 */ +#right table tr td:nth-child(3) { + min-width: 130px; +} +/* 时间 */ +#right table tr td:nth-last-child(2), +#right table tr td:nth-last-child(3) { + min-width: 150px; +} +/* 操作 */ +#right table tr td:last-child { + min-width: 70px; +} +#right table tr td .me { + color: #5889ff; +} +/* 正常 */ +#right table tr td .normal { + color: #FF9812; +} +/* 冻结 */ +#right table tr td .frozen { + color: #d9b3ff; +} +/* 注销 */ +#right table tr td .logout { + color: #ff0000; +} +#right table tr td .null-status { + color: black; +} +#right table.add tr td:first-child { + text-align: right; + width: 200px; + font-weight: 700; +} +#right table.add tr td { + background-color: white; + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td #null-intro { + margin-left: 10px; + width: auto; + height: auto; +} +#right table.add tr td #null-intro + label { + user-select: none; +} +#right table.add tr td .readonly { + background-color: #DDD; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 16px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + width: 30px; + height: 30px; + line-height: 30px; + margin: 15px 3px; + color: #3951B1; + border-radius: 5px; + text-decoration: none; +} +#page .prev, #page .next { + width: 70px; +} +#page a.page-action, +#page a:hover { + color: #FFF; + background-color: #4E6EFE; +} +#article-num { + margin-top: 5px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..3cc834277cf09ee5cba1f92831779c20514e2dfc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/login.css" @@ -0,0 +1,98 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; + } +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; + display: flex; + align-items: center; + justify-content: center; +} +.info { + width: 250px; + height: 300px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.info input[type="text"], +.info input[type="password"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +/* 验证码 */ +#captcha { + width: 150px; + position: absolute; + left: 0; +} +#captcha-img { + position: absolute; + right: 0; +} +#checkbox-remember { + margin-top: 60px; + text-align: left; + height: 30px; + line-height: 30px; + user-select: none; +} +#remember { + +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..a65a4af314f0c605fe27659cec2a8faba453a483 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/css/main.css" @@ -0,0 +1,132 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; + height: 98vh; +} +#container { + width: 960px; + background-color: white; + margin: 42px auto auto auto; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; + cursor: default; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + margin: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; + padding-bottom: 10px; +} +#article-list .article { + width: 880px; + margin: 24px auto auto auto; +} +#article-list .article.detail { + padding-bottom: 40px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list p { + margin-top: 10px; + text-align: center; +} +#article-list .article a { + font-size: 14px; + width: 65px; + height: 28px; + line-height: 28px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + width: 38px; + height: 38px; + line-height: 38px; + margin: 15px 3px; + color: #cc9a6a; + border-radius: 5px; + text-decoration: none; +} +#page .prev, #page .next { + width: 80px; +} +#page a.page-action, +#page a:hover { + color: #FFF; + background-color: #cc9a6a; +} +#article-num { + margin-top: 5px; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/detail.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/detail.php" new file mode 100644 index 0000000000000000000000000000000000000000..fc9d00be71709ddf6fde157a03b3759a8a4b703d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/detail.php" @@ -0,0 +1,54 @@ +query('set names utf8'); + +$articleId = $_GET['p'] ?? ''; +if (empty($articleId)) { + header('location: index.php'); + exit(); +} +@$categoryId = $_GET['cid']; +$sql = "SELECT * FROM article WHERE article_id = {$articleId}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 详情页 + + + +
+ + +
+
+
+

+ +
+
+ ', $articleInfo['article_content']); ?> +
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/index.php" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..913bfcc2e86aa92f238fd3f9d4edd7d25bb6e577 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/index.php" @@ -0,0 +1,73 @@ +query('set names utf8'); + +$sql = "SELECT * FROM article ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +// 数组截取 +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + 首页 + + + +
+ + +
+ +
+
+

+ +
+
+ +
+ 阅读全文 +
+ +
+
+ + + + 1 && $i <= $pageNum; $i++): ?> + " > + + + + +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..54da868b49c1be88b9d6b523fcc411c3840657a9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/admin-main.js" @@ -0,0 +1,96 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'logout.php', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('login.php'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + if ($(this).attr('cancel') === '1') { + $('.check-box').prop('checked', false); + $(this).attr('cancel', '0'); + return; + } + $('.check-box').prop('checked', true); + $(this).attr('cancel', '1'); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'category_delete.php', + { + del_multi: 1, + category_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('category_list.php'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'article_delete.php', + { + del_multi: 1, + article_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('article_list.php'); + } else { + alert(result); + } + } + ); + } +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/src/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 $maxLen) { + exit("{$tip} ,当前长度为{$len}"); + } +} +// 写入登录日志 +function loginLog ($type, $adminName, $adminEmail, $content) { + $log = [ + 'action' => $type, + 'admin_name' => $adminName, + 'admin_email' => $adminEmail, + 'ip' => $_SERVER['REMOTE_ADDR'], + 'content' => $content, + 'time' => date('Y-m-d H:i:s') + ]; + // 将数组解析为json字符串 + $jsonStr = json_encode($log, JSON_UNESCAPED_UNICODE); + // 将json字符串写入日志文件中 + $result = file_put_contents('../../logs/blog.log', $jsonStr.",". PHP_EOL, FILE_APPEND); + if ($result) { + return "写入日志成功"; + } else { + return "写入日志失败"; + } +} +// 操作日志 +function operationLog($type, $head, $content) { + $log = [ + 'action' => $type, + 'article_title' => $head, + 'content' => $content, + 'time' => date('Y-m-d H:i:s') + ]; + // 将数组解析为json字符串 + $jsonStr = json_encode($log, JSON_UNESCAPED_UNICODE); + // 将json字符串写入日志文件中 + $result = file_put_contents('../../logs/blog.log', $jsonStr.",". PHP_EOL, FILE_APPEND); + if ($result) { + return "写入日志成功"; + } else { + return "写入日志失败"; + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..b1e42d42a75de02fb675db3114a9db443a820fef --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210406/Blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\345\210\233\345\273\272.sql" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\345\210\233\345\273\272.sql" new file mode 100644 index 0000000000000000000000000000000000000000..8a56a19b19b63445f0f667deb914e781b4e627a9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\345\210\233\345\273\272.sql" @@ -0,0 +1,45 @@ +-- 创建数据库blog +CREATE DATABASE IF NOT EXISTS blog + DEFAULT CHARACTER SET utf8mb4 + DEFAULT COLLATE utf8mb4_general_ci; +-- 使用数据库 +USE blog; +-- 创建分类表 +CREATE TABLE IF NOT EXISTS `category` +( + `category_id` INT UNSIGNED AUTO_INCREMENT COMMENT '分类id', + `category_name` VARCHAR(20) NOT NULL COMMENT '分类名称', + `category_desc` VARCHAR(200) NOT NULL COMMENT '分类描述', + `add_time` INT(11) NOT NULL COMMENT '分类增加时间', + `update_time` INT(11) NOT NULL COMMENT '分类修改时间', + PRIMARY KEY (`category_id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; +-- 创建文章表 +CREATE TABLE IF NOT EXISTS `article` +( + `article_id` INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '文章id', + `article_title` VARCHAR(50) NOT NULL COMMENT '文章标题', + `category_id` INT UNSIGNED NOT NULL COMMENT '文章所属分类', + `article_author` VARCHAR(20) DEFAULT '佚名' COMMENT '文章作者', + `article_intro` VARCHAR(100) DEFAULT '暂无简介' COMMENT '文章简介', + `article_content` VARCHAR(10000) NOT NULL COMMENT '文章内容', + `add_time` INT(11) UNSIGNED NOT NULL COMMENT '文章增加时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '文章修改时间', + PRIMARY KEY (`article_id`), + FOREIGN KEY (`category_id`) REFERENCES `category`(`category_id`) + ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='文章表'; +-- 创建管理员表 +CREATE TABLE IF NOT EXISTS `admin` +( + `admin_id` INT UNSIGNED AUTO_INCREMENT COMMENT '管理员编号', + `admin_name` VARCHAR(20) NOT NULL COMMENT '管理员名称', + `admin_email` VARCHAR(50) NOT NULL COMMENT '管理员邮箱', + `admin_password` VARCHAR(100) NOT NULL COMMENT '管理员密码', + `salt` VARCHAR(100) NOT NULL COMMENT '密码盐', + `admin_status` TINYINT(5) UNSIGNED DEFAULT 1 NOT NULL COMMENT '管理员账号状态', + `register_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员注册时间', + `update_time` INT(11) UNSIGNED NOT NULL COMMENT '管理员信息修改时间', + PRIMARY KEY (`admin_id`), + UNIQUE KEY (`admin_name`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='管理员表'; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" new file mode 100644 index 0000000000000000000000000000000000000000..327b1a426d9d4eee7ea0f28fafa7b04a25cb91b5 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/Blog\346\265\213\350\257\225\351\241\271\347\233\256.xmind" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..533969368427b69f4f7bdf882525e95424443aa7 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\350\257\246\346\203\205\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7c98813a8ae40b63b18651e98065c41686664731 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\211\215\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" new file mode 100644 index 0000000000000000000000000000000000000000..059e37b03b7153539ec56621fdd966cd94a26a4f Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\345\216\237\345\236\213\345\233\276.rp" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" new file mode 100644 index 0000000000000000000000000000000000000000..4881265102150f78d81ab406bf6c1b31d0764d36 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\215\232\345\256\242\346\227\245\345\277\227.md" @@ -0,0 +1,29 @@ +## 2021-04-02 +### ݿ仯 +- Աֶ + * admin_statusԱ˺״̬ +- Ա־ΪԱ¼־ +- Ա¼־ֶ + * ip_address¼ip + * session_id¼ʱsession_id +- ӡԱϢ־ +- ӡϢ־ +- ӡϢ־ + +### ҳ仯 +* ޸ҳʽ +* ±༭ҳˡΪաѡѡὫΪֵ + + +## 2021-04-10 +### ݿ仯 +- ȡ־صı +- Աֶ + * salt Σÿûһֵ +- ԹԱ˼ + +### ṹ仯 +- MVCģʽԴ˲ִļindex + +### +- logs־Ŀ¼ʹļ־ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a839cdd4c0d51c85a4a3f1070c432472cdd295b Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\345\242\236\345\212\240\351\241\265\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9bbffe50438a40393f5573ee0d59b4563a69 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\345\220\216\345\217\260\351\246\226\351\241\265.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" new file mode 100644 index 0000000000000000000000000000000000000000..e4ec1202cdbaf4aa5fd59321a4c6274f538467f6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\346\265\213\350\257\225\346\225\260\346\215\256.sql" @@ -0,0 +1,35 @@ +USE blog; +-- 插入分类测试数据 +INSERT INTO category(category_name, category_desc, add_time, update_time) +VALUES + ('html&css', '编写静态网页的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript', '网页交互基础', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php', 'php编程语言', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('SQL Server', 'MSSQL', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql ', 'mysql的基础知识', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux', '认识Linux', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入文章测试数据 +INSERT INTO article (article_title, article_intro, article_author, category_id, article_content, add_time, update_time) +VALUES + ('Vue新手入门指南', 'vue入门指南,适合刚接触vue的用户', '小红', 2, '这是vue的文章内容', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('sql server入门', '暂无简介' , '小红', 4, 'sql server入门 sql server入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('什么是数据库', '数据库的概念' , '小红', 5, '数据库的概念数据库的概念', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql入门', 'mysql入门基础知识' , '小红', 5, 'mysql入门mysql入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('mysql优化', 'mysql优化' , '小红', 5, 'mysql优化mysql优化', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('php基础入门', 'php入门基础' , '小红', 3, 'php基础入门php基础入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html入门指南', 'html基础入门' , '小红', 1, 'html入门指南', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('html学习', 'html学习' , '小红', 1, 'html学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('css进阶学习', 'css进阶学习' , '小红', 1, 'css进阶学习', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识javascript', '认识javascript' , '小红', 2, '认识javascript', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('BOM、DOM介绍', 'BOM、DOM介绍' , '小红', 2, 'BOM、DOM介绍', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('javascript实例', 'javascript实例' , '小红', 2, 'javascript实例javascript实例', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('认识jquery', '认识jquery' , '小红', 2, '认识jquery', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux入门', 'Linux入门' , '小红', 6, 'Linux入门', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('Linux和Windows', 'Linux和Windows' , '小红', 6, 'Linux和Windows', UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); + +-- 插入管理员测试数据 +INSERT INTO admin (admin_name, admin_email, admin_password, salt, admin_status, register_time, update_time) +VALUES + ('root', '1622485026@qq.com', '5c15a8a70348e99045c765e3f542b774', '4rLG;z4%8;L{MX!%9_aw)!NcS9Iq):qf#nu5TQEh&MDetd)&iY', 1, UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())), + ('admin', '3341727374@qq.com', '8456212ac689bbbbd676763381b14479', 'eo1v@)KR#clzv!KVr#sFEyjeFS_fIf9!Xy%C9MCi5tH_zIZqQY', 1, UNIX_TIMESTAMP(now()), UNIX_TIMESTAMP(now())); diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..7a8ff6d8cbd882a77abb1ea0c04b039d3e14bc3c Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\347\231\273\345\275\225\347\225\214\351\235\242.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" new file mode 100644 index 0000000000000000000000000000000000000000..7a655df9e9cc4220a0e31b6578da5b58960780b7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\350\241\250\347\273\223\346\236\204.txt" @@ -0,0 +1,50 @@ + + int + ַ(20) ǿ + ַ(255) ǿ + ޸ʱ int(11) ʱ ޷ ǿ + ʱ int(11) ʱ ޷ ǿ + +± + ± int + ± ַ(50) ǿ + int ķid ǿ + ַ(20) + ַ(10000) ǿ + ޸ʱ int(11) ʱ ޷ ǿ + ʱ int(11) ʱ ޷ ǿ + +Ա + Ա int + Ա ַ(20) ǿ + Ա ַ(50) ǿ + Ա ַ(32) ǿ + Ա˺״̬ TINYINT(5) ĬΪ1() ޷ + ״̬У1() 2() 3(ע) + Աעʱ int(11) ʱ ޷ ǿ + ԱϢ޸ʱ int(11) ʱ ޷ ǿ + +Ա¼־ + Ա int ԱĹԱid ǿ + Ա¼ʱ int(11) ʱ ޷ ǿ + ¼ϵͳipַ ַ(15) ǿ + ¼ʱsession_id ַ(50) ǿ + +ԱϢ־ + Աִ߱ INT ԱĹԱŵ ǿ + ԱϢ INT ԱĹԱŵ ǿ + ԱϢ ַ(500) ǿ + ִʱ INT(11) ʱ ޷ ǿ + +Ϣ־ + INT ķŵ ǿ + Աִ߱ INT ԱĹԱŵ ǿ + Ϣ ַ(500) ǿ + ʱ INT(11) ʱ ޷ ǿ + +Ϣ־ + ± INT ±±ŵ ǿ + Աִ߱ INT ԱĹԱŵ ǿ + ±Ϣ ַ(500) ǿ + ±ʱ INT(11) ʱ ޷ ǿ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..d6a26b4d227e0d0e0680297c9bdd71978f19e8dc Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/docs/\351\252\214\350\257\201\347\240\201-\345\256\236\344\276\213.jpg" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-08.log" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-08.log" new file mode 100644 index 0000000000000000000000000000000000000000..3a03c40c4808c8e2927da15ea1e372066eb38647 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-08.log" @@ -0,0 +1,49 @@ +{"action":"login","content":"后台登录成功","time":"2021-04-08 02:10:21","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-08 02:20:18","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 03:52:08","ip":"127.0.0.1","admin_email":null}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 03:52:19","ip":"127.0.0.1","admin_email":null}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 03:56:53","ip":"127.0.0.1","admin_email":null}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 03:58:18","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 03:58:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 04:00:49","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录失败,原因:邮箱与密码不匹配","time":"2021-04-08 08:59:00","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 09:03:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-08 09:06:07","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 17:06:18","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-08 09:12:53","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 17:13:17","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,原因:邮箱已存在","time":"2021-04-08 09:19:50","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功","time":"2021-04-08 09:20:00","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,标题:mysql入门d","time":"2021-04-08 09:30:28","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门d,新标题:mysql入门d","time":"2021-04-08 09:34:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门d,新标题:mysql入门d","time":"2021-04-08 09:35:07","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:27","time":"2021-04-08 09:35:22","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-08 09:39:01","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 17:40:06","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:1234567890@qq.com","time":"2021-04-08 17:40:47","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:mysql入门ss","time":"2021-04-08 17:41:15","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门ss,新标题:mysql入门ssss","time":"2021-04-08 17:41:21","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门ssss,新标题:mysql入门ssss","time":"2021-04-08 17:41:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门ssss,新标题:mysql入门ssss","time":"2021-04-08 17:41:36","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:28","time":"2021-04-08 17:41:44","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:23,18","time":"2021-04-08 17:41:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:Linux,新分类名称:Linux","time":"2021-04-08 17:43:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:Linux,新分类名称:Linux","time":"2021-04-08 17:44:39","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:Linux,新分类名称:Linux","time":"2021-04-08 17:44:49","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类失败,分类id:,原因:该分类下还有文章","time":"2021-04-08 17:46:13","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类失败,分类id:,原因:该分类下还有文章","time":"2021-04-08 17:46:18","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类失败,分类id:5,原因:该分类下还有文章","time":"2021-04-08 17:51:29","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类失败,分类id:4,原因:该分类下还有文章","time":"2021-04-08 17:51:34","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:6","time":"2021-04-08 17:51:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:4","time":"2021-04-08 17:52:03","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:3","time":"2021-04-08 17:52:15","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:10","time":"2021-04-08 17:52:34","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:MySql,新分类名称:MySql","time":"2021-04-08 17:52:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:11","time":"2021-04-08 17:53:04","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:php","time":"2021-04-08 17:53:20","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:13","time":"2021-04-08 17:54:33","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:php","time":"2021-04-08 17:54:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:25,26","time":"2021-04-08 17:55:49","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:7,8","time":"2021-04-08 17:55:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-08 18:57:44","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:21","time":"2021-04-08 19:01:09","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-09.log" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-09.log" new file mode 100644 index 0000000000000000000000000000000000000000..f9490f7c8dfafa1f313ed911a7348c40e9c1b4c2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-09.log" @@ -0,0 +1,61 @@ +{"action":"login","content":"后台登录成功","time":"2021-04-09 10:38:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 11:22:29","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 11:36:14","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:ffffffffffffffffffff","time":"2021-04-09 11:56:08","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:fffffffffffff","time":"2021-04-09 11:59:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:dddddddddddd","time":"2021-04-09 12:01:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:ffffffff","time":"2021-04-09 12:09:46","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:mysqldd","time":"2021-04-09 12:30:06","ip":"127.0.0.1","admin_email":null}, +{"action":"add_article","content":"增加文章失败,文章标题:ffffffff,原因:文章标题已存在","time":"2021-04-09 12:32:37","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:ffffffffdf","time":"2021-04-09 12:32:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:dsfdsafd","time":"2021-04-09 12:34:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 17:56:47","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:mysql入门d","time":"2021-04-09 18:01:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 19:17:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员失败,数据库错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update_time = '1617967146' WHERE admin_id = 4' at line 1","time":"2021-04-09 19:19:06","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 20:01:16","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 20:05:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,原因:管理员名称已存在","time":"2021-04-09 20:09:06","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,邮箱:1622485026@qq.com;原因:邮箱已存在","time":"2021-04-09 20:09:13","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,数据库错误信息:Field 'salt' doesn't have a default value","time":"2021-04-09 20:09:23","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:3341727374@qq.com","time":"2021-04-09 20:11:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 20:12:27","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, +{"action":"edit_admin","content":"编辑管理员失败,数据库错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update_time = '1617970391' WHERE admin_id = 2' at line 1","time":"2021-04-09 20:13:11","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员失败,数据库错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update_time = '1617970399' WHERE admin_id = 2' at line 1","time":"2021-04-09 20:13:19","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 20:17:43","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, +{"action":"edit_admin","content":"编辑管理员失败,数据库错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update_time = '1617971321' WHERE admin_id = 2' at line 1","time":"2021-04-09 20:28:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员失败,数据库错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update_time = '1617971442' WHERE admin_id = 2' at line 1","time":"2021-04-09 20:30:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:3341727374@qq.com","time":"2021-04-09 20:36:35","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 20:37:09","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:3341727374@qq.com","time":"2021-04-09 20:37:56","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:3341727374@qq.com","time":"2021-04-09 20:40:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:3341727374@qq.com","time":"2021-04-09 20:41:20","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 20:41:45","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-09 20:42:05","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysql入门d,新标题:地方烦烦烦烦烦烦烦烦烦","time":"2021-04-09 20:54:50","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:地方烦烦烦烦烦烦烦烦烦,新标题:地方烦烦烦烦烦烦烦烦烦","time":"2021-04-09 21:02:32","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:地方烦烦烦烦烦烦烦烦烦,新标题:地方烦烦烦烦烦烦烦烦烦d","time":"2021-04-09 21:04:35","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:地方烦烦烦烦烦烦烦烦烦d,新标题:地方烦烦烦烦烦烦烦烦烦ddsf","time":"2021-04-09 21:06:25","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:地方烦烦烦烦烦烦烦烦烦ddsf,新标题:mysqld","time":"2021-04-09 21:10:11","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:29","time":"2021-04-09 21:14:11","ip":"127.0.0.1","admin_email":null}, +{"action":"delete_article","content":"删除文章成功,文章id:24","time":"2021-04-09 21:15:32","ip":"127.0.0.1","admin_email":null}, +{"action":"delete_article","content":"删除文章失败,文章id:24,数据库错误信息:","time":"2021-04-09 21:16:08","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:8","time":"2021-04-09 21:16:19","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:9","time":"2021-04-09 21:16:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:15,16","time":"2021-04-09 21:18:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:14","time":"2021-04-09 21:19:23","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:22","time":"2021-04-09 21:24:01","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:19,20","time":"2021-04-09 21:24:10","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:mysqld","time":"2021-04-09 21:38:31","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:htmldfd","time":"2021-04-09 21:42:28","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:16","time":"2021-04-09 21:45:02","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:15","time":"2021-04-09 21:45:15","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:14","time":"2021-04-09 21:45:56","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类失败,分类id:4,5,数据库错误信息:Cannot delete or update a parent row: a foreign key constraint fails (`blog`.`article`, CONSTRAINT `article_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`))","time":"2021-04-09 21:46:02","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:Linux,新分类名称:Linux","time":"2021-04-09 23:03:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:1234567890@qq.com","time":"2021-04-09 23:17:49","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:1234567890@qq.com","time":"2021-04-09 23:31:13","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:1234567890@qq.com","time":"2021-04-09 23:31:38","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:1234567890@qq.com","time":"2021-04-09 23:31:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 23:35:01","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-09 23:35:20","ip":"127.0.0.1","admin_email":"3341727374@qq.com"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-10.log" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-10.log" new file mode 100644 index 0000000000000000000000000000000000000000..bcf242e490225b7a78192520a0a4ac56c8d76a92 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-10.log" @@ -0,0 +1,18 @@ +{"action":"login","content":"后台登录成功","time":"2021-04-10 09:18:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:Vue新手入门指南,新标题:Vue新手入门指南","time":"2021-04-10 09:22:38","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 10:43:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 11:55:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 19:49:34","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:17","time":"2021-04-10 19:54:25","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-10 19:57:05","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 19:57:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-10 19:57:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 19:59:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-10 19:59:33","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 20:00:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-10 20:00:33","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-10 20:09:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123456789@qq.com","time":"2021-04-10 20:10:12","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123456@qq.com","time":"2021-04-10 20:11:25","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123@qq.com","time":"2021-04-10 20:12:29","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-10 20:41:23","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-11.log" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-11.log" new file mode 100644 index 0000000000000000000000000000000000000000..749896d14615ae0ed37684490f4514f9bea3b752 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-11.log" @@ -0,0 +1,51 @@ +{"action":"login","content":"后台登录成功","time":"2021-04-11 11:17:53","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 11:20:16","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 11:21:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 16:35:32","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 16:36:53","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 16:37:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 17:10:02","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,原因:管理员名称已存在","time":"2021-04-11 17:32:32","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123@qq.com","time":"2021-04-11 17:32:35","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:mysql\t,新分类名称:mysql\t","time":"2021-04-11 17:40:56","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:sql","time":"2021-04-11 18:06:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:sql,新分类名称:sql","time":"2021-04-11 18:06:52","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:sql,新分类名称:sql","time":"2021-04-11 18:07:09","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:13","time":"2021-04-11 18:07:17","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test","time":"2021-04-11 18:07:36","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:14","time":"2021-04-11 18:07:40","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:html-test","time":"2021-04-11 18:08:28","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:html-test,新标题:html-test","time":"2021-04-11 18:08:35","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:html-testhtml-test","time":"2021-04-11 18:09:06","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:19,18","time":"2021-04-11 18:09:46","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:html-test","time":"2021-04-11 18:09:58","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:20","time":"2021-04-11 18:10:02","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,原因:管理员名称已存在","time":"2021-04-11 18:10:50","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123456@qq.com","time":"2021-04-11 18:10:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 21:21:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 21:51:40","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 21:54:31","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 22:02:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 22:03:04","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 22:03:17","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 22:05:05","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 22:06:11","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 22:06:21","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 22:06:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 22:09:09","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 22:10:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:addfff","time":"2021-04-11 22:25:59","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:sdfasfd","time":"2021-04-11 22:26:43","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:fffffffffffffdddd","time":"2021-04-11 22:28:07","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章失败,文章标题:fdsafdsafdsf;数据库错误信息:Incorrect integer value: '' for column 'category_id' at row 1","time":"2021-04-11 22:31:52","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:fdsffffffffffffffff","time":"2021-04-11 22:34:37","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:fdfffffffffff","time":"2021-04-11 22:35:10","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:ffffffffffffff","time":"2021-04-11 22:36:11","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:ffffffffffff","time":"2021-04-11 22:36:50","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:25","time":"2021-04-11 22:52:34","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:24","time":"2021-04-11 22:52:44","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文失败,文章标题:fffffffffffffdddd;原因:标题已存在","time":"2021-04-11 23:32:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文失败,文章标题:fffffffffffffdddd;原因:标题已存在","time":"2021-04-11 23:33:00","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:fffffffffffffddddd,新标题:fffffffffffffddddd","time":"2021-04-11 23:35:15","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-11 23:35:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-11 23:36:00","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-12.log" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-12.log" new file mode 100644 index 0000000000000000000000000000000000000000..8c94e99a88239183a25c2e5c704649d0de524d2f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/logs/2021-04-12.log" @@ -0,0 +1,61 @@ +{"action":"login","content":"后台登录成功","time":"2021-04-12 15:52:57","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:mysqld","time":"2021-04-12 15:54:16","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:mysqld,新标题:mysqld","time":"2021-04-12 15:54:28","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:16","time":"2021-04-12 15:54:31","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:mysqld","time":"2021-04-12 15:54:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:17","time":"2021-04-12 15:56:13","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类失败,分类名称:sql server,原因:分类名称已存在","time":"2021-04-12 15:56:37","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:sql serverd","time":"2021-04-12 15:56:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:sql serverd,新分类名称:sql serverd","time":"2021-04-12 16:00:08","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:java","time":"2021-04-12 16:00:21","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:java,新分类名称:java","time":"2021-04-12 16:00:27","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:8,7","time":"2021-04-12 16:00:33","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:mysqld","time":"2021-04-12 16:00:50","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:9","time":"2021-04-12 16:00:54","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,数据库错误信息:Field 'admin_status' doesn't have a default value","time":"2021-04-12 16:01:26","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,数据库错误信息:Field 'admin_status' doesn't have a default value","time":"2021-04-12 16:01:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,数据库错误信息:Field 'admin_status' doesn't have a default value","time":"2021-04-12 16:04:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123@qq.com","time":"2021-04-12 16:06:07","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:123@qq.com","time":"2021-04-12 16:06:19","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test1","time":"2021-04-12 16:15:40","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test2","time":"2021-04-12 16:15:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:8","time":"2021-04-12 16:17:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:7","time":"2021-04-12 16:18:15","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test","time":"2021-04-12 16:18:24","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:9","time":"2021-04-12 16:18:28","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test5","time":"2021-04-12 16:24:51","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:test5,新分类名称:test5","time":"2021-04-12 16:34:17","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:10","time":"2021-04-12 16:34:51","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123@qq.com","time":"2021-04-12 16:48:03","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:12345@qq.com","time":"2021-04-12 16:49:51","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123456@qq.com","time":"2021-04-12 16:51:43","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:abc@qq.com","time":"2021-04-12 16:52:13","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,原因:管理员名称已存在","time":"2021-04-12 16:59:04","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员失败,邮箱:123@qq.com;原因:邮箱已存在","time":"2021-04-12 16:59:09","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:1234567@qq.com","time":"2021-04-12 16:59:14","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:123@qq.com","time":"2021-04-12 17:08:40","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-12 19:34:49","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-12 19:41:21","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-12 19:42:56","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-12 19:57:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"login","content":"后台登录成功","time":"2021-04-12 19:58:04","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:22","time":"2021-04-12 20:10:37","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:21","time":"2021-04-12 20:11:41","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章失败,文章标题:mysql优化,原因:文章标题已存在","time":"2021-04-12 20:19:31","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章失败,文章标题:mysql优化,原因:文章标题已存在","time":"2021-04-12 20:26:11","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test","time":"2021-04-12 20:34:29","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:15","time":"2021-04-12 20:34:33","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类失败,分类id:5,数据库错误信息:Cannot delete or update a parent row: a foreign key constraint fails (`blog`.`article`, CONSTRAINT `article_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`))","time":"2021-04-12 20:34:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test","time":"2021-04-12 21:08:36","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_category","content":"编辑分类成功,原分类名称:test,新分类名称:testd","time":"2021-04-12 21:08:45","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_category","content":"删除分类成功,分类id:16","time":"2021-04-12 21:08:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_category","content":"增加分类成功,分类名称:test","time":"2021-04-12 21:08:55","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_category","content":"批量删除分类成功,分类id:17","time":"2021-04-12 21:08:59","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:testd","time":"2021-04-12 21:10:20","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_article","content":"编辑文章成功,原标题:testd,新标题:testdd","time":"2021-04-12 21:10:30","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"add_article","content":"增加文章成功,文章标题:testdsd","time":"2021-04-12 21:10:42","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"multi_delete_article","content":"批量删除文章成功,文章id:29","time":"2021-04-12 21:10:48","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"delete_article","content":"删除文章成功,文章id:28","time":"2021-04-12 21:10:52","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"register_admin","content":"注册管理员成功,邮箱:123@qq.com","time":"2021-04-12 21:12:32","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"edit_admin","content":"编辑管理员成功,被编辑管理员的邮箱:123@qq.com","time":"2021-04-12 21:13:19","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, +{"action":"logout","content":"退出登录成功","time":"2021-04-12 21:15:56","ip":"127.0.0.1","admin_email":"1622485026@qq.com"}, diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..87901994f692f57d5d83af1f96c446f4ff92bc00 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_edit.php" @@ -0,0 +1,85 @@ +errorInfo(); + writeLog("edit_admin", "编辑管理员失败,数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + exit(); +} + +// 参数验证 +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: index.php?c=admin_list'); + exit(); +} +// model +include_once APP_PATH . "./model/admin_edit.php"; + +// 保存旧数据 +$oldName = $adminInfo['admin_name']; +$adminEmail = $adminInfo['admin_email']; +$oldPassword = $adminInfo['admin_password']; + +// 防止强行访问 +if ($oldName == 'root' && $adminName != 'root') { + header('location: index.php?c=admin_list'); + exit(); +} +// view +include_once APP_PATH . "./view/admin_edit.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..ddc74c88659a4671b2ed5fa26989d33e48ddb6d4 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/admin_list.php" @@ -0,0 +1,14 @@ +errorInfo(); + writeLog("register_admin", "注册管理员失败,数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + exit(); +} +// view +include_once APP_PATH . "./view/admin_register.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..d07c8e5efb099f37411ab6db5d880ef7a017c515 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_add.php" @@ -0,0 +1,59 @@ +errorInfo(); + writeLog('add_article', "增加文章失败,文章标题:{$articleTitle};数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码{$errorInfo[1]}请联系管理员:1622485026@qq.com"; + } + exit(); +} +// model +include_once APP_PATH . "./model/article_add.php"; +// view +include_once APP_PATH . "./view/article_add.php"; diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..5d678a8ad05c2dff5fd0d7bfcc32f7e19d68af1d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_edit.php" @@ -0,0 +1,101 @@ +errorInfo(); + writeLog('edit_article', "编辑文章失败,原标题:{$oldData['article_title']},新标题:{$newData['article_title']};数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + exit(); +} + +// 验证参数 +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: index.php?c=article_list'); + exit(); +} + +include_once APP_PATH . "./model/article_edit.php"; +// 保存旧数据 +$articleTitle = $articleInfo['article_title']; +$articleIntro = $articleInfo['article_intro']; +$categoryId = $articleInfo['category_id']; +$articleContent = $articleInfo['article_content']; +include_once APP_PATH . "./view/article_edit.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..337e0246adf680ef72f5606f86f907f882324011 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/article_list.php" @@ -0,0 +1,56 @@ +errorInfo(); + writeLog('delete_article', "删除文章失败,文章id:{$articleId},数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + } else if (@$_POST['del_multi']) { + // 删除多个 + if ($result) { + writeLog('multi_delete_article', "批量删除文章成功,文章id:{$articleId}"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo(); + writeLog('multi_delete_article', "批量删除文章失败,文章id:{$articleId},数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + } else { + writeLog('delete_article', '非法访问'); + echo "参数错误,请联系管理员:1622485026@qq.com"; + } + exit(); +} +// model +include_once APP_PATH . "./model/article_list.php"; +// 分页信息 +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page-1)*$articleNumOfPage, $articleNumOfPage); +} + +// view +include_once APP_PATH . "./view/article_list.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..edfee1eaa4c136a37965ebaf0d5b6e39b85ccc62 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_add.php" @@ -0,0 +1,45 @@ += 10) { + echo "当前系统仅支持创建10个分类,若需增加请等待后续更新支持"; + exit(); + } + if ($category) { + writeLog('add_category', "增加分类失败,分类名称:{$categoryName},原因:分类名称已存在"); + echo '列表中已有同名的分类,请更换后再试'; + exit(); + } + + if ($result) { + writeLog('add_category', "增加分类成功,分类名称:{$categoryName}"); + echo 'ok'; + } else { + $errorInfo = $db->errorInfo(); + writeLog('add_category', "增加分类失败,分类名称:{$categoryName},数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + exit(); +} +// view +include_once APP_PATH . "./view/category_add.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..0e72813903d3c5c4ed1d750884b2c83b59f54167 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_edit.php" @@ -0,0 +1,73 @@ +errorInfo(); + writeLog('edit_category', "编辑分类失败,分类名称:{$oldData['category_name']},数据库信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + exit(); +} + +// 参数验证 +$id = $_GET['id'] ?? ''; +if (empty($id)) { + header('location: index.php?c=category_list'); + exit(); +} +// model +include_once APP_PATH . "./model/category_edit.php"; +// 保存旧的数据 +$oldCategoryName = $categoryInfo['category_name']; +$oldCategoryDesc = $categoryInfo['category_desc']; + +include_once APP_PATH . "./view/category_edit.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..1052f092f5602dfd2bbe84250e3426d0b8cb6988 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/category_list.php" @@ -0,0 +1,53 @@ +errorInfo(); + writeLog('delete_category', "删除分类失败,分类id:{$categoryId},数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + } else if (@$_POST['del_multi']) { + // 删除多个 + if ($result) { + writeLog('multi_delete_category', "批量删除分类成功,分类id:{$categoryId}"); + echo "ok"; + } else { + $errorInfo = $db->errorInfo(); + writeLog('multi_delete_category', "批量删除分类失败,分类id:{$categoryId},数据库错误信息:{$errorInfo[2]}"); + echo "发生了错误,错误代码:{$errorInfo[1]},请联系管理员:1622485026@qq.com"; + } + } else { + writeLog('delete_category', "非法访问"); + echo "参数错误,请联系管理员:1622485026@qq.com"; + exit(); + } + exit(); +} + +// model +include_once APP_PATH . "./model/category_list.php"; +// view +include_once APP_PATH . "./view/category_list.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..39e12368007502313a1b315e3a019d16d4a14b97 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login.php" @@ -0,0 +1,59 @@ +alert('您已登录,正在跳转主页');location.assign('index.php');"; + exit(); + } +} +// view +include_once APP_PATH . "./view/login.php"; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login_status_check.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login_status_check.php" new file mode 100644 index 0000000000000000000000000000000000000000..428b4e85a1d102cfb7b2a936fc0b6d8c8132e0cc --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/login_status_check.php" @@ -0,0 +1,18 @@ +alert('您当前的登录信息已过期,请重新登录');location.assign('index.php?c=login');"; + exit(); +} +$adminName = $_SESSION['admin_name']; \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/logout.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/logout.php" new file mode 100644 index 0000000000000000000000000000000000000000..25e865d40a261c53309fdcfd8ac204a06ba33e01 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/controller/logout.php" @@ -0,0 +1,22 @@ +location.assign('index.php?c=login');"; + exit(); +} +$adminEmail = $_SESSION['admin_email']; +date_default_timezone_set("PRC"); +unset($_SESSION['admin_name']); +unset($_SESSION['admin_email']); +include_once "../lib/form_check.php"; +if (setcookie('PHPSESSID', '', time() - 3600, '/')) { + writeLog('logout', '退出登录成功', $adminEmail); + echo "ok"; +} else { + writeLog('logout', '退出登录失败,原因:过期cookie失败', $adminEmail); + echo "退出登录失败,请联系管理员: 1622485026@qq.com"; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/index.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..efd610de239eacd9c680f4983a03a7a1aa7d416e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/index.php" @@ -0,0 +1,10 @@ +query($sql); + $adminInfo = $result->fetch(PDO::FETCH_ASSOC); + if ($adminInfo) { + return; + } + } + + if (isset($diff['admin_password'])) { + // 查询账号信息 + $sql = "SELECT * FROM admin WHERE admin_id = {$adminId}"; + $result = $db->query($sql); + $adminInfo = $result->fetch(PDO::FETCH_ASSOC); + // 加密 + $salt = $adminInfo['salt']; + $diff['admin_password'] = encrypt($diff['admin_password'], $salt); + } + + // 生成sql + $updateData = ""; + foreach ($diff as $key => $value) { + $updateData .= "{$key} = '{$value}',"; + } + $sql = "UPDATE admin SET {$updateData} update_time = '". time() ."' WHERE admin_id = {$adminId}"; + $result = $db->exec($sql); + return; +} + +// 查找管理员个人信息 +$sql = "SELECT * FROM admin WHERE admin_id = {$id}"; +$result = $db->query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..35e2d3070eb7ceb2cb2bfd352f3d315cf01b734a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_list.php" @@ -0,0 +1,13 @@ +query($sql); +$adminList = $result->fetchAll(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..a8a1e38cad93041f7c94689f486c79f7d706dd2f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/admin_register.php" @@ -0,0 +1,37 @@ +query($sql); + $name = $result->fetch(PDO::FETCH_ASSOC); + if ($name) { + return; + } + + // 检查数据库中是否已存在邮箱 + $sql = "SELECT * FROM admin WHERE admin_email = '{$adminEmail}' LIMIT 1"; + $result = $db->query($sql); + $email = $result->fetch(PDO::FETCH_ASSOC); + if ($email) { + return; + } + + // 密码加密 + $salt = getSalt(); + $cryptPassword = encrypt($adminPassword, $salt); + + $sql = "INSERT INTO admin (admin_name, admin_email, admin_password, salt, register_time, update_time) + VALUES ('{$adminName}', '{$adminEmail}', '{$cryptPassword}', '{$salt}', ". time() .", ". time() .");"; + $result = $db->exec($sql); +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..2c7e0752c14de35bff556333c28937c41ac5ade2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_add.php" @@ -0,0 +1,28 @@ +query($sql); + $article = $result->fetch(PDO::FETCH_ASSOC); + if ($article) { + return; + } + $sql = "INSERT INTO article (article_title, article_intro, category_id, article_content, add_time, update_time) + VALUES ('{$articleTitle}', '{$articleIntro}', '{$categoryId}', '{$articleContent}', " . time() . ", " . time() . " );"; + $result = $db->exec($sql); + return; +} + +// 查找分类信息 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..6bd810b97e861f09a25d642c994779cdcba2f719 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_edit.php" @@ -0,0 +1,47 @@ +query($sql); + $article = $result->fetch(PDO::FETCH_ASSOC); + if ($article) { + return; + } + } + + // 生成sql + $updateData = ""; + foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; + } + + $sql = + "UPDATE article + SET + {$updateData} + update_time = '". time() ."' + WHERE article_id = {$articleId};"; + $result = $db->exec($sql); + return; +} + +if (isset($id)) { + // 查找文章信息 + $sql = "SELECT * FROM article WHERE article_id = {$id}"; + $result = $db->query($sql); + $articleInfo = $result->fetch(PDO::FETCH_ASSOC); + + // 查找分类列表 + $sql = "SELECT * FROM category"; + $result = $db->query($sql); + $categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..4128799668078c74c5052c16aacacad9b23adaaa --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/article_list.php" @@ -0,0 +1,38 @@ +exec($sql); + } else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM article WHERE article_id IN ({$articleId})"; + $result = $db->exec($sql); + } + return; +} + +// 文章列表 +$sql = + "SELECT + article_id, + article_title, + category_name, + article_intro, + article.add_time, + article.update_time + FROM article + INNER JOIN category ON article.category_id = category.category_id + ORDER BY article.update_time DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..0ed485ad5507ae8861c2d5207273a60284d88597 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_add.php" @@ -0,0 +1,34 @@ +query($sql); +$categoryNum = (int)$result->fetch(PDO::FETCH_ASSOC)['category_num']; +if ($categoryNum >= 10) { + return; +} + +// 检查数据库中是否有同名的分类 +$sql = "SELECT * FROM category WHERE category_name = '{$categoryName}' LIMIT 1;"; +$result = $db->query($sql); +$category = $result->fetch(PDO::FETCH_ASSOC); +if ($category) { + return; +} +$sql = "INSERT INTO category (category_name, category_desc, add_time, update_time) + VALUES ('{$categoryName}', '{$categoryDesc}', ". time() .", ". time() .")"; +$result = $db->exec($sql); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..b7571597a721414775888855e571d5a247307633 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_edit.php" @@ -0,0 +1,41 @@ +query($sql); + $category = $result->fetch(PDO::FETCH_ASSOC); + if ($category) { + return; + } + } + // 生成sql + $updateData = ''; + foreach($diff as $key => $value) { + $updateData .= "{$key} = '{$value}', "; + } + + $sql = "UPDATE category + SET + {$updateData} + update_time = ". time() ." + WHERE category_id = '{$categoryId}';"; + $result = $db->exec($sql); + return; +} + +// 查找分类 +$sql = "SELECT * FROM category WHERE category_id = {$id}"; +$result = $db->query($sql); +$categoryInfo = $result->fetch(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..9fbcd1f890bbe9ecaf07e7b6af485f385ab2b43a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/category_list.php" @@ -0,0 +1,34 @@ +query($sql); + $article = $result->fetch(PDO::FETCH_ASSOC); + if ($article) { + return; + } + $sql = "DELETE FROM category WHERE category_id = {$categoryId}"; + $result = $db->exec($sql); + } else if (@$_POST['del_multi']) { + // 删除多个 + $sql = "DELETE FROM category WHERE category_id IN ({$categoryId})"; + $result = $db->exec($sql); + } + return; +} + +// 查找分类列表 +$sql = "SELECT * FROM category ORDER BY update_time DESC;"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/dbconn.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/dbconn.php" new file mode 100644 index 0000000000000000000000000000000000000000..a8bdd52fa4df36238fc73354eb11f3fb5d27a6a7 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/dbconn.php" @@ -0,0 +1,10 @@ +query("set names utf8"); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/login.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..c2ffaaaf20e6fd644427b8cadd872f20777e2641 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/model/login.php" @@ -0,0 +1,10 @@ +query($sql); +$adminInfo = $result->fetch(PDO::FETCH_ASSOC); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..c9773bd1e764bedad23d5d4726d0cdcbb76af2fd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_edit.php" @@ -0,0 +1,107 @@ + + + + + + 编辑文章 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..21cb0e67622e851447aa6c86df01d17ad66c0608 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_list.php" @@ -0,0 +1,110 @@ + + + + + 管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_register.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_register.php" new file mode 100644 index 0000000000000000000000000000000000000000..c1a10dbfeba8475675ea96c977598f51aa00e51e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/admin_register.php" @@ -0,0 +1,97 @@ + + + + + 注册管理员 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..6e1e2bbd9dbd7fc5b776fececb3a54045c360ccd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_add.php" @@ -0,0 +1,118 @@ + + + + + 增加文章 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..95c78a09bac15260d4f23af6dd1c9b089d501698 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_edit.php" @@ -0,0 +1,140 @@ + + + + + 编辑文章 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..cbdec0ddbec08436b481c763ba0c4eb60818fe5c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/article_list.php" @@ -0,0 +1,109 @@ + + + + + 文章列表 + + + + +
+ + + +
+ + + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_add.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_add.php" new file mode 100644 index 0000000000000000000000000000000000000000..ec42d41fbef879b243ce61f29571d9f7a92da298 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_add.php" @@ -0,0 +1,84 @@ + + + + + 增加文章 + + + + +
+ + + + + +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_edit.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_edit.php" new file mode 100644 index 0000000000000000000000000000000000000000..87cf8755f7447c68f8fd13fb853b11d9b3c2dffa --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_edit.php" @@ -0,0 +1,97 @@ + + + + + 编辑分类 + + + + +
+ + + + + +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_list.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_list.php" new file mode 100644 index 0000000000000000000000000000000000000000..5bd21f2679653aac3ebade65a52aa7f8942b33c6 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/category_list.php" @@ -0,0 +1,95 @@ + + + + + 分类列表 + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/login.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/login.php" new file mode 100644 index 0000000000000000000000000000000000000000..928ca12c91184343cccad7a4de2f4e0a56073a2a --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/admin/view/login.php" @@ -0,0 +1,77 @@ + + + + + + + 登录 + + + + +
+
+

登录博客系统

+ +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/category.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/category.php" new file mode 100644 index 0000000000000000000000000000000000000000..df9231e01bdf9b6cd442d1b4785eafc74700e330 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/category.php" @@ -0,0 +1,84 @@ +query('set names utf8'); + +$categoryId = $_GET['cid'] ?? ''; +$categoryName = $_GET['cna'] ?? ''; +if (empty($categoryId || $categoryName)) { + header('location: index.php'); + exit(); +} + +$sql = "SELECT * FROM article WHERE category_id = {$categoryId} ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +// 查找分类列表 +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 分类 - <?php echo $categoryName; ?> + + + +
+ + +
+ + +
+
+

+ +
+
+ +
+ 阅读全文 +
+ + 该分类下暂时还没有文章

"; ?> + +
+
+ + + + 1 && $i <= $pageNum; $i++): ?> + " > + + + + +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..51d0ad04a94bb81a1f999f4f14dfcfb940477555 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/admin-main.css" @@ -0,0 +1,194 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; + height: 650px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + margin-left: 10px; + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; + font-size:14px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr:hover td { + background-color: #F1F3F4; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +/* 时间 */ +#right table tr td:nth-last-child(2), +#right table tr td:nth-last-child(3) { + min-width: 150px; +} +/* 操作 */ +#right table tr td:last-child { + min-width: 70px; +} +#right table tr td .me { + color: #5889ff; +} +/* 正常 */ +#right table tr td .normal { + color: #FF9812; +} +/* 冻结 */ +#right table tr td .frozen { + color: #d9b3ff; +} +/* 注销 */ +#right table tr td .logout { + color: #ff0000; +} +#right table tr td .null-status { + color: black; +} +#right table.add tr td:first-child { + text-align: right; + width: 200px; + font-weight: 700; +} +#right table.add tr td { + background-color: white; + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + border-radius: 5px; + outline: none; + font-size: 16px; + border: 1px solid #E1E1E1; +} +#right table.add tr td #null-intro { + margin-left: 10px; + width: auto; + height: auto; +} +#right table.add tr td #null-intro + label { + user-select: none; +} +#right table.add tr td .readonly { + background-color: #DDD; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + border-radius: 5px; + outline: none; + font-size: 16px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + width: 30px; + height: 30px; + line-height: 30px; + margin: 15px 3px; + color: #3951B1; + border-radius: 5px; + text-decoration: none; +} +#page .prev, #page .next { + width: 70px; +} +#page a.page-action, +#page a:hover { + color: #FFF; + background-color: #4E6EFE; +} +#article-num { + margin-top: 5px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..3744b133c49dd8eb3de269eb62698226f621b3e0 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/login.css" @@ -0,0 +1,115 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +.content { + width: 600px; + height: 600px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; + display: flex; + align-items: center; + justify-content: center; +} +.content h1 { + font-size: 23px; +} +.info { + width: 300px; + height: 370px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 15px 25px 25px 25px; + list-style: none; + border-radius: 5px; + font-size: 16px; + box-shadow: -3px 3px 25px #346CB0; +} +.info li:first-child { + font-size: 18px; +} +.info input[type="text"], +.info input[type="password"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; + margin: 10px 0; +} +.info input ~ span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + transition: all 0.3s; +} +.info input + .text { + top: 22px; +} +.info input ~ .line { + bottom: 20px; + height: 2px; + width: 100%; + background-color: #2183e1; + transform-origin: 50% 0; + transform: scaleX(0); +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +.info input:focus ~ .line, +.info input:valid ~ .line { + transform: scaleX(1); +} +/* 验证码 */ +#captcha { + width: 180px; + position: absolute; + left: 0; +} +#captcha ~ .line { + bottom: -50px; + width: 180px; +} +#captcha-img { + position: absolute; + right: 0; +} +/* 记住我 */ +#checkbox-remember { + margin-top: 80px; + text-align: left; + height: 30px; + line-height: 30px; + user-select: none; +} +.info button { + width: 100%; + padding: 12px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..a65a4af314f0c605fe27659cec2a8faba453a483 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/css/main.css" @@ -0,0 +1,132 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; + height: 98vh; +} +#container { + width: 960px; + background-color: white; + margin: 42px auto auto auto; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; + cursor: default; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + margin: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; + padding-bottom: 10px; +} +#article-list .article { + width: 880px; + margin: 24px auto auto auto; +} +#article-list .article.detail { + padding-bottom: 40px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list p { + margin-top: 10px; + text-align: center; +} +#article-list .article a { + font-size: 14px; + width: 65px; + height: 28px; + line-height: 28px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + cursor: default; +} +#page a { + display: inline-block; + width: 38px; + height: 38px; + line-height: 38px; + margin: 15px 3px; + color: #cc9a6a; + border-radius: 5px; + text-decoration: none; +} +#page .prev, #page .next { + width: 80px; +} +#page a.page-action, +#page a:hover { + color: #FFF; + background-color: #cc9a6a; +} +#article-num { + margin-top: 5px; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/detail.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/detail.php" new file mode 100644 index 0000000000000000000000000000000000000000..232fdf96bdf884640b413b3d03a0ae761e2e5820 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/detail.php" @@ -0,0 +1,54 @@ +query('set names utf8'); + +$articleId = $_GET['p'] ?? ''; +if (empty($articleId)) { + header('location: index.php'); + exit(); +} +@$categoryId = $_GET['cid']; +$sql = "SELECT * FROM article WHERE article_id = {$articleId}"; +$result = $db->query($sql); +$articleInfo = $result->fetch(PDO::FETCH_ASSOC); + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + 文章 - <?php echo $articleInfo['article_title']; ?> + + + +
+ + +
+
+
+

+ +
+
+ ', $articleInfo['article_content']); ?> +
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/index.php" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..90dbe44500654e98ea3d76aea83d3994421eb0a5 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/index.php" @@ -0,0 +1,73 @@ +query('set names utf8'); + +$sql = "SELECT * FROM article ORDER BY article_id DESC"; +$result = $db->query($sql); +$articleList = $result->fetchAll(PDO::FETCH_ASSOC); +$articleNum = count($articleList); +$articleNumOfPage = 10; +$pageNum = ceil($articleNum / $articleNumOfPage); +$page = 1; +// 数组截取 +$nowArticleList = array_slice($articleList, 0, $articleNumOfPage); + +if (isset($_GET['page'])) { + $page = $_GET['page']; + $nowArticleList = array_slice($articleList, ($page - 1) * $articleNumOfPage, $articleNumOfPage); +} + +$sql = "SELECT * FROM category"; +$result = $db->query($sql); +$categoryList = $result->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + 首页 + + + +
+ + +
+ +
+
+

+ +
+
+ +
+ 阅读全文 +
+ +
+
+ + + + 1 && $i <= $pageNum; $i++): ?> + " > + + + + +
+
+ + + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/admin-main.js" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/admin-main.js" new file mode 100644 index 0000000000000000000000000000000000000000..1340f2fb1aaf755496f2fe1cd47ba67c1b03184d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/admin-main.js" @@ -0,0 +1,97 @@ +$(function() { + $('#logout').click(function() { + if (confirm('确定要退出登录吗?')) { + $.post( + 'index.php?c=logout', + function (result) { + if (result === 'ok') { + alert('退出登录成功'); + location.assign('index.php?c=login'); + } else { + alert(result); + } + } + ); + } + }); + $('#all').click(function() { + if ($(this).attr('cancel') === '1') { + $('.check-box').prop('checked', false); + $(this).attr('cancel', '0'); + return; + } + $('.check-box').prop('checked', true); + $(this).attr('cancel', '1'); + }); + $('#del-all').click(function() { + let num = 0; + $('.check-box').each(function() { + if ($(this).prop('checked')) { + num++; + } + }); + if (num === 0) { + return; + } + if (confirm('是否确认删除所选项?')) { + if ($(this).attr('flag') === '1') { + // 分类 + categoryDelete(); + } else if ($(this).attr('flag') === '2') { + // 文章 + articleDelete(); + } else { + // 其它 + alert('参数错误,请联系管理员'); + } + } + }); + + function categoryDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'index.php?c=category_list', + { + del_multi: 1, + category_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('index.php?c=category_list'); + } else { + alert(result); + } + } + ); + } + function articleDelete() { + let arr = []; + $('.check-box').each(function () { + if ($(this).prop('checked')) { + arr.push($(this).val()); + } + }); + $.post( + 'index.php?c=article_list', + { + del_multi: 1, + article_id: arr.join(',') + }, + function (result) { + if (result === 'ok') { + alert('删除成功'); + location.assign('index.php?c=article_list'); + } else { + alert(result); + } + } + ); + } + $('input').attr('autocomplete', 'off'); +}); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/jquery-3.5.1.min.js" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/jquery-3.5.1.min.js" new file mode 100644 index 0000000000000000000000000000000000000000..b0614034ad3a95e4ae9f53c2b015eeb3e8d68bde --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/src/js/jquery-3.5.1.min.js" @@ -0,0 +1,2 @@ +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 $maxLen) { + exit("{$tip} ,当前长度为{$len}"); + } +} +// 日志 +function writeLog ($action, $content, $adminEmail = '') { + if (empty($adminEmail)) { + $adminEmail = $_SESSION['admin_email']; + } + $log = [ + 'action' => $action, + 'content' => $content, + 'time' => date('Y-m-d H:i:s'), + 'ip' => $_SERVER['REMOTE_ADDR'], + 'admin_email' => $adminEmail + ]; + // 将数组解析为json字符串 + $jsonStr = json_encode($log, JSON_UNESCAPED_UNICODE); + // 将json字符串写入日志文件中 + $result = file_put_contents('../../logs/'. date('Y-m-d') .'.log', $jsonStr.",". PHP_EOL, FILE_APPEND); + if ($result) { + return "写入日志成功"; + } else { + return "写入日志失败"; + } +} +// 盐 +function getSalt() { + $chars = "123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+{};:.?"; + $salt = ""; + $length = strlen($chars) - 1; + for ($i = 0; $i < 50; $i++) { + $index = mt_rand(0, $length); + $salt .= $chars[$index]; + } + return $salt; +} +// 加密 +function encrypt($plainText, $salt) { + return md5($salt . md5($salt . $plainText . $salt) . $salt); +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_add.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_add.html" new file mode 100644 index 0000000000000000000000000000000000000000..4b7757f676825a3af876aa67aec071b84d26e203 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_add.html" @@ -0,0 +1,68 @@ + + + + + 增加文章 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_list.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_list.html" new file mode 100644 index 0000000000000000000000000000000000000000..5e3b536f751b51f9b64b396a318669ba81f6d855 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/article_list.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/index.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..2802a90983dc1e6dcf8fb631a0721bfc8f029dcd --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/index.html" @@ -0,0 +1,62 @@ + + + + + 后台首页 + + + +
+ + + +
+ + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/login.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/login.html" new file mode 100644 index 0000000000000000000000000000000000000000..6b01077b1b5a0461e1012578bfc53168f43d9a59 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/login.html" @@ -0,0 +1,28 @@ + + + + + + + 登录 + + + +
+ 博客系统 +
+ +
+ 新员工?创建账号 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/register.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/register.html" new file mode 100644 index 0000000000000000000000000000000000000000..311f1647258eee522fe32f00ed9c9363620e7f31 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/admin/register.html" @@ -0,0 +1,26 @@ + + + + + + + 注册 + + + +
+ 博客系统 +
+
    +
  • 请输入相关信息
  • +
  • 用户名
  • +
  • 邮箱
  • +
  • 密码
  • +
  • 确认密码
  • +
  • +
+
+ 已有账号?登录 +
+ + \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/admin-main.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/admin-main.css" new file mode 100644 index 0000000000000000000000000000000000000000..53187dcd671e16a727ce4aabbd9d03b7f376fae2 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/admin-main.css" @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + color: #346cb0; +} +a:hover { + color: #234875; + text-decoration: underline; +} +button { + outline: none; + border: none; + cursor: pointer; +} +body { + font-size: 1rem; + color: #28313b; +} +ul { + list-style: none; +} +#container { + min-width: 960px; +} +#header { + width: 100%; + height: 60px; + background-color: #346CB0; +} +#header h2 { + width: 225px; + background-color: #2E5F9A; + height: 60px; + line-height: 60px; + padding-left: 15px; + color: white; + display: inline-block; + border-right: 1px solid #346EB0; +} +#header .info { + color: white; + float: right; + height: 60px; + line-height: 60px; + padding-right: 10px; +} +#header .info a { + color: #B2D5FF; +} +#header .info a:hover { + color: white; +} +#left { + width: 220px; + padding: 20px 0 0 19px; + border-right: 1px solid #CDCDCD; + position: fixed; +} +#left a { + color: black; +} +#left a.action { + color: #346cb0; + text-decoration: underline; +} +#right { + margin: 0 0 0 240px; + padding: 20px 15px 0 15px; +} +#right .breadcrumbs-nav, +#right .admin-menu { + height: 30px; +} +#right .admin-menu button, +#right table tr td button { + padding: 6px 8px; + border-radius: 3px; +} +#right .admin-menu button:hover, +#right table tr td button:hover { + color: #346cb0; + box-shadow: 0 0 3px #CCC; +} +#right .admin-menu a#add { + float: right; +} +#right table { + width: 100%; + margin-top: 10px; + border-collapse: collapse; +} +#right table tr th, +#right table tr td { + border: 1px solid #E1E1E1; + padding: 6px; + text-align: center; +} +#right table.add tr td:first-child { + text-align: right; +} +#right table.add tr td { + text-align: left; +} +#right table.add tr td input { + width: 250px; + height: 28px; + outline: none; + font-size: 1rem; + border: 1px solid #E1E1E1; +} +#right table.add tr td textarea { + border: 1px solid #E1E1E1; + outline: none; + font-size: 1rem; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/login.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/login.css" new file mode 100644 index 0000000000000000000000000000000000000000..9e4a405bf644af735e5d6d76ed3697b3a086de3e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/login.css" @@ -0,0 +1,85 @@ +* { + padding: 0; + margin: 0; +} +body { + background-color: #198AE1; +} +a { + text-decoration: none; + color: white; +} +a:hover { + color: black; +} +.content { + width: 500px; + height: 500px; + background-color: #198AE1; + text-align: center; + margin: 20px auto; + padding-top: 20px; + color: white; +} +.info { + width: 250px; + height: 350px; + background-color: white; + color: #727676; + margin: 10px auto; + padding: 20px; + list-style: none; + border-radius: 5px; + font-size: 16px; +} +.login { + height: 250px; +} +.info input[type="text"], +.info input[type="password"], +.info input[type="email"] { + width: 100%; + padding: 5px 0; + margin: 20px 0; + font-size: 16px; + border: none; + border-bottom: 2px solid #F4F4F4; + outline: none; +} +.info li { + position: relative; +} +.info input + span { + color: #727676; + pointer-events: none; + position: absolute; + left: 0; + top: 22px; + transition: all 0.5s; +} +.info input:focus + span, +.info input:valid + span { + top: 6px; + font-size: 12px; +} +#checkbox-remember { + text-align: left; + height: 35px; + line-height: 35px; + user-select: none; +} +.info button { + width: 100%; + padding: 10px 0; + margin: 20px 0; + color: white; + background-color: #198AE1; + outline: none; + border: none; + border-radius: 3px; +} +.info button:hover { + cursor: pointer; + color: black; + box-shadow: 0 0px 3px #198AE1; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/main.css" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/main.css" new file mode 100644 index 0000000000000000000000000000000000000000..f2bc3ef3f08c7ba7e38292940273c3e1a850929e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/css/main.css" @@ -0,0 +1,111 @@ +* { + padding: 0; + margin: 0; +} +a { + text-decoration: none; + text-align: center; +} +body { + background-color: #CCCCCC; + color: #6B6B6B; +} +#container { + width: 960px; + background-color: white; + margin: auto; + margin-top: 42px; +} +#header { + width: 100%; + height: 245px; + background-color: #8AB84B; + color: #332616; +} +#header h1 { + font-size: 60px; + padding: 84px 0 0 58px; +} +#header span { + padding: 0 0 0 150px; +} +#banner { + width: 100%; + height: 45px; + background-color: #988060; + color: #FFFFFF; +} +#banner a { + height: 45px; + line-height: 45px; + display: inline-block; + padding: 0 0 0 15px; + color: #FFF; + font-weight: 700; +} +#banner a:first-child { + margin-left: 35px; +} +#banner a:hover { + color: #E7FAA9; +} +#banner a.action { + color: #4B3D2C; +} +#article-list { + width: 100%; +} +#article-list .article { + width: 880px; + margin: auto; + /* background-color: skyblue; */ + margin-top: 24px; +} +#article-list .article-title { + border-bottom: 1px solid #E4F2C8; + padding: 0 0 2px 2px; + margin-bottom: 12px; +} +#article-list .article-title h2 { + display: inline-block; +} +#article-list .article-title span { + font-size: 10px; +} +#article-list .article-intro, +#article-list .article-content { + font-size: 15px; + padding-left: 5px; +} +#article-list .article-content p { + padding-bottom: 25px; +} +#article-list .article a { + width: 80px; + height: 38px; + line-height: 38px; + display: block; + background-color: #FAF7F5; + color: #977C57; + border: 1px solid #EEE8E1; + border-radius: 5px; + margin: 10px 0 0 3px; +} +#page { + width: 100%; + text-align: center; + margin: auto; + height: 70px; + line-height: 70px; +} +#page a { + margin: 0 7px; + color: #97c5a4; +} +#copyright { + width: 100%; + height: 50px; + padding: 25px 0 0 0; + text-align: center; + font-size: 13px; +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/detail.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/detail.html" new file mode 100644 index 0000000000000000000000000000000000000000..b1e42d42a75de02fb675db3114a9db443a820fef --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/detail.html" @@ -0,0 +1,54 @@ + + + + + 详情页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+

Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +

+
+
+
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/index.html" "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..45d0ebde211ab855edb0ca6e8de502fd76c3aaba --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210412/Blog/ui/index.html" @@ -0,0 +1,66 @@ + + + + + 首页 + + + +
+ + +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+

vue入门介绍

+ 2021-03-01 15:00:00 +
+
+ Vue(读音/vju:/,类似view),是一套用于构建用户界面的渐进式JavaScript框架。 + 与其他大型框架不同的是,Vue被设计为可以自底向上逐层应用。Vue的核心库只关注视图层,方便与第三方库或既有项目整合 +
+ 阅读全文 +
+
+
+ 上一页 + 1 + 2 + 3 + 4 + 5 + 下一页 +
+
+ + + diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/.example.env" "b/\346\242\201\345\233\275\347\201\257/20210426/api/.example.env" new file mode 100644 index 0000000000000000000000000000000000000000..c27f74caea59e0bc78bae1941793a6ac34c85a9c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/.example.env" @@ -0,0 +1 @@ +APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = test USERNAME = username PASSWORD = password HOSTPORT = 3306 CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/.gitignore" "b/\346\242\201\345\233\275\347\201\257/20210426/api/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..d465120e74b813c80d55c418ed3cab757a22033c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/.gitignore" @@ -0,0 +1,5 @@ +/.idea +/.vscode +/vendor +*.log +.env \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/.travis.yml" "b/\346\242\201\345\233\275\347\201\257/20210426/api/.travis.yml" new file mode 100644 index 0000000000000000000000000000000000000000..36f7b6f90dafe374d0eca306886df83f09ff13a9 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/.travis.yml" @@ -0,0 +1,42 @@ +sudo: false + +language: php + +branches: + only: + - stable + +cache: + directories: + - $HOME/.composer/cache + +before_install: + - composer self-update + +install: + - composer install --no-dev --no-interaction --ignore-platform-reqs + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip . + - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0" + - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0" + - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0" + - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip . + +script: + - php think unit + +deploy: + provider: releases + api_key: + secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw= + file: + - ThinkPHP_Core.zip + - ThinkPHP_Full.zip + skip_cleanup: true + on: + tags: true diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/LICENSE.txt" "b/\346\242\201\345\233\275\347\201\257/20210426/api/LICENSE.txt" new file mode 100644 index 0000000000000000000000000000000000000000..574a39c401ff71ffcb90d15edb906b8046c7661b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/LICENSE.txt" @@ -0,0 +1,32 @@ + +ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 +版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) +All rights reserved。 +ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 + +Apache Licence是著名的非盈利开源组织Apache采用的协议。 +该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, +允许代码修改,再作为开源或商业软件发布。需要满足 +的条件: +1. 需要给代码的用户一份Apache Licence ; +2. 如果你修改了代码,需要在被修改的文件中说明; +3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 +带有原来代码中的协议,商标,专利声明和其他原来作者规 +定需要包含的说明; +4. 如果再发布的产品中包含一个Notice文件,则在Notice文 +件中需要带有本协议内容。你可以在Notice中增加自己的 +许可,但不可以表现为对Apache Licence构成更改。 +具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/README.md" "b/\346\242\201\345\233\275\347\201\257/20210426/api/README.md" new file mode 100644 index 0000000000000000000000000000000000000000..2929dad091236d93f73380bd02d6a0bbb58b5b2f --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/README.md" @@ -0,0 +1,56 @@ +ThinkPHP 6.0 +=============== + +> 运行环境要求PHP7.1+,兼容PHP8.0。 + +[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api) + +ThinkPHPV6.0版本由[亿速云](https://www.yisu.com/)独家赞助发布。 + +## 主要新特性 + +* 采用`PHP7`强类型(严格模式) +* 支持更多的`PSR`规范 +* 原生多应用支持 +* 更强大和易用的查询 +* 全新的事件系统 +* 模型事件和数据库事件统一纳入事件系统 +* 模板引擎分离出核心 +* 内部功能中间件化 +* SESSION/Cookie机制改进 +* 对Swoole以及协程支持改进 +* 对IDE更加友好 +* 统一和精简大量用法 + +## 安装 + +~~~ +composer create-project topthink/think tp 6.0.* +~~~ + +如果需要更新框架使用 +~~~ +composer update topthink/framework +~~~ + +## 文档 + +[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content) + +## 参与开发 + +请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。 + +## 版权信息 + +ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 + +本项目包含的第三方源码和二进制文件之版权信息另行标注。 + +版权所有Copyright © 2006-2020 by ThinkPHP (http://thinkphp.cn) + +All rights reserved。 + +ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 + +更多细节参阅 [LICENSE.txt](LICENSE.txt) diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/common.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/common.php" new file mode 100644 index 0000000000000000000000000000000000000000..124361568ff89529382ad44b04b53d6fd7543152 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/common.php" @@ -0,0 +1,2 @@ + 'require|min: 1' + ]); + $result = $validate->check(['str' => $str]); + if (!$result) { // 校验参数 + $data = [ + 'status' => 1, + 'message' => $validate->getError(), + 'data' => [] + ]; + return json($data); + } + $len = strlen($str); + + $data = [ + 'status' => 0, + 'message' => '', + 'data' => [ + 'str_len' => $len + ] + ]; + return json($data); + } + + // 判断一个数字是否是斐波那契数列中的数 + public function isFibonacci() + { + $num = Request::param('num'); + $validate = Validate::rule(['num' => 'require|between: 1,' . PHP_INT_MAX]); + $result = $validate->check(['num' => $num]); + if (!$result) { + return $validate->getError(); + } + // 提取斐波那契数组(100以内) + $arr = [ + 0 => 1, + 1 => 1 + ]; + for ($i = 2; $i <= 100; $i++) { + $arr[$i] = $arr[$i - 1] + $arr[$i - 2]; + } + $addr = array_search($num, $arr); + if (!$addr) { + $data = [ + 'status' => 0, + 'message' => $num . "不在斐波那契数列中(100以内)", + 'data' => [] + ]; + return json($data); + } + $data = [ + 'status' => 1, + 'message' => '', + 'data' => [ + 'index' => $addr + 1 + ] + ]; + return json($data); + } + + //设计一个api接口,可以分析一篇英文文章出现的单词列表,并返回json格式。 + public function getWordList() + { + $article = Request::param('article'); + $pattern = '/[a-zA-Z]+/'; + $words = []; + $wordNum = preg_match_all($pattern, $article, $words); + $data = [ + 'status' => 0, + 'message' => '', + 'data' => [ + 'word_num' => $wordNum, + 'word_list' => $words[0] + ] + ]; + return json($data); + } + + /** + * 设计一个api接口,可以根据身份证号,计算出相应的年龄和性别,并返回json格式。 + * 身份证号码格式:1-6位地址码,7-14位出生日期码,15-17位数字顺序码,18位数字校验码 + * 地址码中1-2位省级行政区,3-4位地级行政区,5-6位县级行政区 + * 数字顺序码表示对同一地址所标识的区域范围内,对同年、同月、同日出生的人员编定的顺序号,其中第17位奇数分配给男性,偶数分配给女性 + * 校验码的范围为0-10,其中10使用罗马数字X表示 + */ + public function parseInfoOfIDCard() + { + $idCard = Request::param('idCard'); + $validate = Validate::rule('idCard', 'require|length: 18'); + $result = $validate->check(['idCard' => $idCard]); + if (!$result) { + return self::jsonData(-1, $validate->getError()); + } + $first = substr($idCard, 0, 17); + $last = substr($idCard, 17); + $validate = Validate::rule([ + 'first' => 'require|length: 17|number', + 'last' => [ + 'require', + 'length: 1', + 'regex' => '\d|X' + ] + ]); + $result = $validate->check([ + 'first' => $first, + 'last' => $last + ]); + if (!$result) { + return self::jsonData(-2, '身份证号码格式错误'); + } + $birthYear = substr($idCard, 6, 4); // 出生年份 + $birthMonth = substr($idCard, 10, 2); // 出生月份 + $birthDate = substr($idCard, 12, 2); // 出生日期 + $gender = substr($idCard, 16, 1); // 性别 + $gender = $gender % 2 == 0 ? '女' : '男'; + $validate = Validate::rule([ + 'year' => 'between: 1000,9999', + 'month' => 'between: 01, 12', + 'date' => 'between: 01, 31' + ]); + $result = $validate->check([ + 'year' => $birthYear, + 'month' => $birthMonth, + 'date' => $birthDate + ]); + if (!$result) { + return self::jsonData(-2, '身份证号码格式错误'); + } + $year = date('Y'); // 当前年份 + $month = date('m'); // 当前月份 + $date = date('d'); // 当前日期 + $age = $year - $birthYear; + if ($age < 0) { + return self::jsonData(-3, '身份证号码无效'); + } + if ($month < $birthMonth) { // 判断月份 + if ($age == 0) { + return self::jsonData(-3, '身份证号码无效'); + } + $age--; + return self::jsonData(0, '', [ + 'age' => $age, + 'gender' => $gender + ]); + } + if ($month === $birthMonth && $date < $birthDate) { // 判断日期 + if ($age == 0) { + return self::jsonData(-3, '身份证号码无效'); + } + $age--; + return self::jsonData(0, '', [ + 'age' => $age, + 'gender' => $gender + ]); + } + return self::jsonData(0, '', [ + 'age' => $age, + 'gender' => $gender + ]); + } + + public static function jsonData($status, $message, $data = []) + { + $data = [ + 'status' => $status, + 'message' => $message, + 'data' => $data + ]; + return json($data); + } +} \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/event.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/event.php" new file mode 100644 index 0000000000000000000000000000000000000000..4eff8908bd643cd6072b9fde6ee38ca4ad6f04ad --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/app/index/event.php" @@ -0,0 +1,5 @@ +=7.1.0", + "topthink/framework": "^6.0.0", + "topthink/think-orm": "^2.0", + "topthink/think-multi-app": "^1.0", + "topthink/think-view": "^1.0" + }, + "require-dev": { + "symfony/var-dumper": "^4.2", + "topthink/think-trace":"^1.0" + }, + "autoload": { + "psr-4": { + "app\\": "app" + }, + "psr-0": { + "": "extend/" + } + }, + "config": { + "preferred-install": "dist" + }, + "scripts": { + "post-autoload-dump": [ + "@php think service:discover", + "@php think vendor:publish" + ] + } +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/composer.lock" "b/\346\242\201\345\233\275\347\201\257/20210426/api/composer.lock" new file mode 100644 index 0000000000000000000000000000000000000000..43140d1ad0547dcdb0133cc8f26d01ce7a21d736 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/composer.lock" @@ -0,0 +1,1202 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "af4c1d3fa817eb8c58caa9a7ec0362b0", + "packages": [ + { + "name": "league/flysystem", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.x" + }, + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2020-08-23T07:39:11+00:00" + }, + { + "name": "league/flysystem-cached-adapter", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", + "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", + "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "league/flysystem": "~1.0", + "psr/cache": "^1.0.0" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0", + "tedivm/stash": "~0.12" + }, + "suggest": { + "ext-phpredis": "Pure C implemented extension for PHP" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Cached\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "frankdejonge", + "email": "info@frenky.net" + } + ], + "description": "An adapter decorator to enable meta-data caching.", + "support": { + "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues", + "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master" + }, + "time": "2020-07-25T15:56:04+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.18", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2021-01-18T20:58:21+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "topthink/framework", + "version": "v6.0.7", + "source": { + "type": "git", + "url": "https://github.com/top-think/framework.git", + "reference": "db8fe22520a9660dd5e4c87e304034ac49e39270" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/framework/zipball/db8fe22520a9660dd5e4c87e304034ac49e39270", + "reference": "db8fe22520a9660dd5e4c87e304034ac49e39270", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "league/flysystem": "^1.0", + "league/flysystem-cached-adapter": "^1.0", + "php": ">=7.1.0", + "psr/container": "~1.0", + "psr/log": "~1.0", + "psr/simple-cache": "^1.0", + "topthink/think-helper": "^3.1.1", + "topthink/think-orm": "^2.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "mockery/mockery": "^1.2", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "files": [], + "psr-4": { + "think\\": "src/think/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + }, + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "The ThinkPHP Framework.", + "homepage": "http://thinkphp.cn/", + "keywords": [ + "framework", + "orm", + "thinkphp" + ], + "support": { + "issues": "https://github.com/top-think/framework/issues", + "source": "https://github.com/top-think/framework/tree/v6.0.7" + }, + "time": "2021-01-25T14:48:29+00:00" + }, + { + "name": "topthink/think-helper", + "version": "v3.1.4", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-helper.git", + "reference": "c28d37743bda4a0455286ca85b17b5791d626e10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10", + "reference": "c28d37743bda4a0455286ca85b17b5791d626e10", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "think\\": "src" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "The ThinkPHP6 Helper Package", + "support": { + "issues": "https://github.com/top-think/think-helper/issues", + "source": "https://github.com/top-think/think-helper/tree/3.0" + }, + "time": "2019-11-08T08:01:10+00:00" + }, + { + "name": "topthink/think-multi-app", + "version": "v1.0.14", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-multi-app.git", + "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", + "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/framework": "^6.0.0" + }, + "type": "library", + "extra": { + "think": { + "services": [ + "think\\app\\Service" + ] + } + }, + "autoload": { + "psr-4": { + "think\\app\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "thinkphp6 multi app support", + "support": { + "issues": "https://github.com/top-think/think-multi-app/issues", + "source": "https://github.com/top-think/think-multi-app/tree/master" + }, + "time": "2020-07-12T13:50:37+00:00" + }, + { + "name": "topthink/think-orm", + "version": "v2.0.40", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-orm.git", + "reference": "1119d979b850849f3725856460cf108eec1c3eb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8", + "reference": "1119d979b850849f3725856460cf108eec1c3eb8", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "ext-pdo": "*", + "php": ">=7.1.0", + "psr/log": "~1.0", + "psr/simple-cache": "^1.0", + "topthink/think-helper": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7|^8|^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "think\\": "src" + }, + "files": [ + "stubs/load_stubs.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "think orm", + "keywords": [ + "database", + "orm" + ], + "support": { + "issues": "https://github.com/top-think/think-orm/issues", + "source": "https://github.com/top-think/think-orm/tree/v2.0.40" + }, + "time": "2021-04-19T13:29:37+00:00" + }, + { + "name": "topthink/think-template", + "version": "v2.0.8", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-template.git", + "reference": "abfc293f74f9ef5127b5c416310a01fe42e59368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-template/zipball/abfc293f74f9ef5127b5c416310a01fe42e59368", + "reference": "abfc293f74f9ef5127b5c416310a01fe42e59368", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "think\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "the php template engine", + "support": { + "issues": "https://github.com/top-think/think-template/issues", + "source": "https://github.com/top-think/think-template/tree/v2.0.8" + }, + "time": "2020-12-10T07:52:03+00:00" + }, + { + "name": "topthink/think-view", + "version": "v1.0.14", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-view.git", + "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d", + "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/think-template": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "think\\view\\driver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "thinkphp template driver", + "support": { + "issues": "https://github.com/top-think/think-view/issues", + "source": "https://github.com/top-think/think-view/tree/v1.0.14" + }, + "time": "2019-11-06T11:40:13+00:00" + } + ], + "packages-dev": [ + { + "name": "symfony/polyfill-mbstring", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v4.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806", + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v4.4.21" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-27T19:49:03+00:00" + }, + { + "name": "topthink/think-trace", + "version": "v1.4", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-trace.git", + "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", + "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/framework": "^6.0.0" + }, + "type": "library", + "extra": { + "think": { + "services": [ + "think\\trace\\Service" + ], + "config": { + "trace": "src/config.php" + } + } + }, + "autoload": { + "psr-4": { + "think\\trace\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "thinkphp debug trace", + "support": { + "issues": "https://github.com/top-think/think-trace/issues", + "source": "https://github.com/top-think/think-trace/tree/v1.4" + }, + "time": "2020-06-29T05:27:28+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.1.0" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/app.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/app.php" new file mode 100644 index 0000000000000000000000000000000000000000..8c153135db47557b0fcd01695ed6eaee24cfb701 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/app.php" @@ -0,0 +1,32 @@ + env('app.host', ''), + // 应用的命名空间 + 'app_namespace' => '', + // 是否启用路由 + 'with_route' => true, + // 默认应用 + 'default_app' => 'index', + // 默认时区 + 'default_timezone' => 'Asia/Shanghai', + + // 应用映射(自动多应用模式有效) + 'app_map' => [], + // 域名绑定(自动多应用模式有效) + 'domain_bind' => [], + // 禁止URL访问的应用列表(自动多应用模式有效) + 'deny_app_list' => [], + + // 异常页面的模板文件 + 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', + + // 错误显示信息,非调试模式有效 + 'error_message' => '页面错误!请稍后再试~', + // 显示错误信息 + 'show_error_msg' => true, +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/cache.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/cache.php" new file mode 100644 index 0000000000000000000000000000000000000000..a8d69d247be95ccf50446556d71ec782080a56bb --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/cache.php" @@ -0,0 +1,29 @@ + env('cache.driver', 'file'), + + // 缓存连接方式配置 + 'stores' => [ + 'file' => [ + // 驱动方式 + 'type' => 'File', + // 缓存保存目录 + 'path' => '', + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存 + 'expire' => 0, + // 缓存标签前缀 + 'tag_prefix' => 'tag:', + // 序列化机制 例如 ['serialize', 'unserialize'] + 'serialize' => [], + ], + // 更多的缓存连接 + ], +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/console.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/console.php" new file mode 100644 index 0000000000000000000000000000000000000000..a818a9800951114c99173356086b5906b6d2eb4c --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/console.php" @@ -0,0 +1,9 @@ + [ + ], +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/cookie.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/cookie.php" new file mode 100644 index 0000000000000000000000000000000000000000..d3b3aab925a32374481749793a5b71fdc3e89569 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/cookie.php" @@ -0,0 +1,20 @@ + 0, + // cookie 保存路径 + 'path' => '/', + // cookie 有效域名 + 'domain' => '', + // cookie 启用安全传输 + 'secure' => false, + // httponly设置 + 'httponly' => false, + // 是否使用 setcookie + 'setcookie' => true, + // samesite 设置,支持 'strict' 'lax' + 'samesite' => '', +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/database.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/database.php" new file mode 100644 index 0000000000000000000000000000000000000000..290e00924dcd22ec277fa5d59adc2eee363f0860 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/database.php" @@ -0,0 +1,60 @@ + env('database.driver', 'mysql'), + + // 自定义时间查询规则 + 'time_query_rule' => [], + + // 自动写入时间戳字段 + // true为自动识别类型 false关闭 + // 字符串则明确指定时间字段类型 支持 int timestamp datetime date + 'auto_timestamp' => true, + + // 时间字段取出后的默认时间格式 + 'datetime_format' => 'Y-m-d H:i:s', + + // 数据库连接配置信息 + 'connections' => [ + 'mysql' => [ + // 数据库类型 + 'type' => env('database.type', 'mysql'), + // 服务器地址 + 'hostname' => env('database.hostname', '127.0.0.1'), + // 数据库名 + 'database' => env('database.database', ''), + // 用户名 + 'username' => env('database.username', 'root'), + // 密码 + 'password' => env('database.password', ''), + // 端口 + 'hostport' => env('database.hostport', '3306'), + // 数据库连接参数 + 'params' => [], + // 数据库编码默认采用utf8 + 'charset' => env('database.charset', 'utf8'), + // 数据库表前缀 + 'prefix' => env('database.prefix', ''), + + // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) + 'deploy' => 0, + // 数据库读写是否分离 主从式有效 + 'rw_separate' => false, + // 读写分离后 主服务器数量 + 'master_num' => 1, + // 指定从服务器序号 + 'slave_no' => '', + // 是否严格检查字段是否存在 + 'fields_strict' => true, + // 是否需要断线重连 + 'break_reconnect' => false, + // 监听SQL + 'trigger_sql' => env('app_debug', true), + // 开启字段缓存 + 'fields_cache' => false, + ], + + // 更多的数据库配置信息 + ], +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/filesystem.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/filesystem.php" new file mode 100644 index 0000000000000000000000000000000000000000..965297e8f471c082fb48395c09a1c15753c7c31e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/filesystem.php" @@ -0,0 +1,24 @@ + env('filesystem.driver', 'local'), + // 磁盘列表 + 'disks' => [ + 'local' => [ + 'type' => 'local', + 'root' => app()->getRuntimePath() . 'storage', + ], + 'public' => [ + // 磁盘类型 + 'type' => 'local', + // 磁盘路径 + 'root' => app()->getRootPath() . 'public/storage', + // 磁盘路径对应的外部URL路径 + 'url' => '/storage', + // 可见性 + 'visibility' => 'public', + ], + // 更多的磁盘配置信息 + ], +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/lang.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/lang.php" new file mode 100644 index 0000000000000000000000000000000000000000..59f320ffd7c568df4aeb9ac751de08616268a16b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/lang.php" @@ -0,0 +1,27 @@ + env('lang.default_lang', 'zh-cn'), + // 允许的语言列表 + 'allow_lang_list' => [], + // 多语言自动侦测变量名 + 'detect_var' => 'lang', + // 是否使用Cookie记录 + 'use_cookie' => true, + // 多语言cookie变量 + 'cookie_var' => 'think_lang', + // 多语言header变量 + 'header_var' => 'think-lang', + // 扩展语言包 + 'extend_list' => [], + // Accept-Language转义为对应语言包名称 + 'accept_language' => [ + 'zh-hans-cn' => 'zh-cn', + ], + // 是否支持语言分组 + 'allow_group' => false, +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/log.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/log.php" new file mode 100644 index 0000000000000000000000000000000000000000..ea24ff9d26657863f36b69824896780b6755ca96 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/log.php" @@ -0,0 +1,45 @@ + env('log.channel', 'file'), + // 日志记录级别 + 'level' => [], + // 日志类型记录的通道 ['error'=>'email',...] + 'type_channel' => [], + // 关闭全局日志写入 + 'close' => false, + // 全局日志处理 支持闭包 + 'processor' => null, + + // 日志通道列表 + 'channels' => [ + 'file' => [ + // 日志记录方式 + 'type' => 'File', + // 日志保存目录 + 'path' => '', + // 单文件日志写入 + 'single' => false, + // 独立日志级别 + 'apart_level' => [], + // 最大日志文件数量 + 'max_files' => 0, + // 使用JSON格式记录 + 'json' => false, + // 日志处理 + 'processor' => null, + // 关闭通道日志写入 + 'close' => false, + // 日志输出格式化 + 'format' => '[%s][%s] %s', + // 是否实时写入 + 'realtime_write' => false, + ], + // 其它日志通道配置 + ], + +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/middleware.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/middleware.php" new file mode 100644 index 0000000000000000000000000000000000000000..7e1972f5a09c7f09a1801dca6742e1971cc4e26d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/middleware.php" @@ -0,0 +1,8 @@ + [], + // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行 + 'priority' => [], +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/route.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/route.php" new file mode 100644 index 0000000000000000000000000000000000000000..2f4cd12902712b07c826a16d7653399c45184a44 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/route.php" @@ -0,0 +1,45 @@ + '/', + // URL伪静态后缀 + 'url_html_suffix' => 'html', + // URL普通方式参数 用于自动生成 + 'url_common_param' => true, + // 是否开启路由延迟解析 + 'url_lazy_route' => false, + // 是否强制使用路由 + 'url_route_must' => false, + // 合并路由规则 + 'route_rule_merge' => false, + // 路由是否完全匹配 + 'route_complete_match' => false, + // 访问控制器层名称 + 'controller_layer' => 'controller', + // 空控制器名 + 'empty_controller' => 'Error', + // 是否使用控制器后缀 + 'controller_suffix' => false, + // 默认的路由变量规则 + 'default_route_pattern' => '[\w\.]+', + // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则 + 'request_cache_key' => false, + // 请求缓存有效期 + 'request_cache_expire' => null, + // 全局请求缓存排除规则 + 'request_cache_except' => [], + // 默认控制器名 + 'default_controller' => 'Index', + // 默认操作名 + 'default_action' => 'index', + // 操作方法后缀 + 'action_suffix' => '', + // 默认JSONP格式返回的处理方法 + 'default_jsonp_handler' => 'jsonpReturn', + // 默认JSONP处理方法 + 'var_jsonp_handler' => 'callback', +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/session.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/session.php" new file mode 100644 index 0000000000000000000000000000000000000000..c1ef6e16d3d96f671bae7842196338ab0347ca7d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/session.php" @@ -0,0 +1,19 @@ + 'PHPSESSID', + // SESSION_ID的提交变量,解决flash上传跨域 + 'var_session_id' => '', + // 驱动方式 支持file cache + 'type' => 'file', + // 存储连接标识 当type使用cache的时候有效 + 'store' => null, + // 过期时间 + 'expire' => 1440, + // 前缀 + 'prefix' => '', +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/trace.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/trace.php" new file mode 100644 index 0000000000000000000000000000000000000000..fad2392d9bba5b6e9aaedf64824bc30560212aee --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/trace.php" @@ -0,0 +1,10 @@ + 'Html', + // 读取的日志通道名 + 'channel' => '', +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/config/view.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/view.php" new file mode 100644 index 0000000000000000000000000000000000000000..01259a0ef527b6a92d8eb31f4d89cd3bdb369579 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/config/view.php" @@ -0,0 +1,25 @@ + 'Think', + // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法 + 'auto_rule' => 1, + // 模板目录名 + 'view_dir_name' => 'view', + // 模板后缀 + 'view_suffix' => 'html', + // 模板文件名分隔符 + 'view_depr' => DIRECTORY_SEPARATOR, + // 模板引擎普通标签开始标记 + 'tpl_begin' => '{', + // 模板引擎普通标签结束标记 + 'tpl_end' => '}', + // 标签库标签开始标记 + 'taglib_begin' => '{', + // 标签库标签结束标记 + 'taglib_end' => '}', +]; diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/extend/.gitignore" "b/\346\242\201\345\233\275\347\201\257/20210426/api/extend/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..c96a04f008ee21e260b28f7701595ed59e2839e3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/extend/.gitignore" @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/.htaccess" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/.htaccess" new file mode 100644 index 0000000000000000000000000000000000000000..cbc786893a070c031adbbd5f9cfb3ec3051bdf0b --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/.htaccess" @@ -0,0 +1,8 @@ + + Options +FollowSymlinks -Multiviews + RewriteEngine On + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] + diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/favicon.ico" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/favicon.ico" new file mode 100644 index 0000000000000000000000000000000000000000..e71815a6618c6ef19c78d27840b8995fb2521499 Binary files /dev/null and "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/favicon.ico" differ diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/index.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/index.php" new file mode 100644 index 0000000000000000000000000000000000000000..e3c0fe9083c5540d7149b1277acc679ea18ed48e --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/index.php" @@ -0,0 +1,24 @@ + +// +---------------------------------------------------------------------- + +// [ 应用入口文件 ] +namespace think; + +require __DIR__ . '/../vendor/autoload.php'; + +// 执行HTTP应用并响应 +$http = (new App())->http; + +$response = $http->run(); + +$response->send(); + +$http->end($response); diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/robots.txt" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/robots.txt" new file mode 100644 index 0000000000000000000000000000000000000000..eb0536286f3081c6c0646817037faf5446e3547d --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/robots.txt" @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/router.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/router.php" new file mode 100644 index 0000000000000000000000000000000000000000..9b39a62c9771c00bd676713be4bb48f3a5cdc443 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/router.php" @@ -0,0 +1,19 @@ + +// +---------------------------------------------------------------------- +// $Id$ + +if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) { + return false; +} else { + $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php'; + + require __DIR__ . "/index.php"; +} diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/public/static/.gitignore" "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/static/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..c96a04f008ee21e260b28f7701595ed59e2839e3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/public/static/.gitignore" @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/route/app.php" "b/\346\242\201\345\233\275\347\201\257/20210426/api/route/app.php" new file mode 100644 index 0000000000000000000000000000000000000000..d8e09e382ddf3b67e3193d5ac5cc6b9226959a68 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/route/app.php" @@ -0,0 +1,17 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + +Route::get('think', function () { + return 'hello,ThinkPHP6!'; +}); + +Route::get('hello/:name', 'index/hello'); diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/runtime/.gitignore" "b/\346\242\201\345\233\275\347\201\257/20210426/api/runtime/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..c96a04f008ee21e260b28f7701595ed59e2839e3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/runtime/.gitignore" @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/think" "b/\346\242\201\345\233\275\347\201\257/20210426/api/think" new file mode 100644 index 0000000000000000000000000000000000000000..2429d223a2e44b29a52a721ae88d4085c0d274f3 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/think" @@ -0,0 +1,10 @@ +#!/usr/bin/env php +console->run(); \ No newline at end of file diff --git "a/\346\242\201\345\233\275\347\201\257/20210426/api/view/README.md" "b/\346\242\201\345\233\275\347\201\257/20210426/api/view/README.md" new file mode 100644 index 0000000000000000000000000000000000000000..360eb2468af9fd86de756c4cf26e9b90ee63cb26 --- /dev/null +++ "b/\346\242\201\345\233\275\347\201\257/20210426/api/view/README.md" @@ -0,0 +1 @@ +如果不使用模板,可以删除该目录 \ No newline at end of file