From a02d930f110815641b96eb9c167c05a4dac7168c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?=
<2291200076@qq.com>
Date: Wed, 2 Mar 2022 11:28:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E6=B3=A8?=
=?UTF-8?q?=E5=86=8C=E5=8A=9F=E8=83=BD=EF=BC=9BEncrpt=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E4=B8=BAEncrypt=EF=BC=9B=E6=B7=BB=E5=8A=A0=E5=A1=AB=E5=85=85?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Others/sql/flashsale.sql | 8 +-
README.md | 22 ---
frontend/getotp.html | 20 +++
frontend/register.html | 132 ++++++++++++++++++
.../flashsale/controller/UserController.java | 24 +++-
.../flashsale/dataobject/UserPasswordDO.java | 20 +--
.../service/impl/UserServiceImpl.java | 11 +-
src/main/resources/application.properties | 2 +-
src/main/resources/mapping/UserDOMapper.xml | 2 +-
.../mapping/UserPasswordDOMapper.xml | 22 +--
10 files changed, 204 insertions(+), 59 deletions(-)
create mode 100644 frontend/register.html
diff --git a/Others/sql/flashsale.sql b/Others/sql/flashsale.sql
index f39117c..ac3997b 100644
--- a/Others/sql/flashsale.sql
+++ b/Others/sql/flashsale.sql
@@ -11,7 +11,7 @@
Target Server Version : 50726
File Encoding : 65001
- Date: 01/03/2022 17:01:05
+ Date: 02/03/2022 10:30:12
*/
SET NAMES utf8mb4;
@@ -42,13 +42,13 @@ INSERT INTO `user_info` VALUES (1, 'admin', 2, 18, '110', 'phone', '');
-- ----------------------------
DROP TABLE IF EXISTS `user_password`;
CREATE TABLE `user_password` (
- `id` int(11) NOT NULL,
- `encrpt_password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `encrypt_password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE,
CONSTRAINT `user_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user_info` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user_password
diff --git a/README.md b/README.md
index 21505c8..110958f 100644
--- a/README.md
+++ b/README.md
@@ -12,28 +12,6 @@
> 用户名密码均为 `admin`
-### 本次修改通过以下方式查看👇
-
-> http://localhost:8090/user/getotp?telephone=1
-
-预期效果:
-
-```json
-{"data":null,"status":"success"}
-```
-
-控制台:
-```sql
-telephone = 1 & otpCode = 90824
-```
-
-> http://localhost:8090/user/get?id=2
-
-预期效果:
-
-```json
-{"data":{"errCode":10002,"errMsg":"未知错误"},"status":"fail"}
-```
### 层次结构(以User为例,自上向下)
| | 目录 | Java对象类型 | 说明 | 举例 |
diff --git a/frontend/getotp.html b/frontend/getotp.html
index 1961327..61a1867 100644
--- a/frontend/getotp.html
+++ b/frontend/getotp.html
@@ -21,6 +21,12 @@
+ 用户注册
+
+
+
@@ -39,9 +45,11 @@
data: {
"telephone": telephone,
},
+ xhrFields: {withCredentials: true},
success: function (data) {
if (data.status == "success") {
alert("OTP已经发送到了您的手机上,请注意查收");
+ window.location.href = "./register.html";
} else {
alert("OTP发送失败,原因为" + data.data.errMsg);
}
@@ -51,6 +59,18 @@
}
})
})
+
+ $("#fillData").on("click", function () {
+ $("#telephone").val("18900000001");
+ $("#telephone").attr("disabled", true);
+ // 屏蔽弹窗
+ alert = function () {};
+ $("#getotp").click();
+ })
+
+ if(location.search=="?quickDebug") {
+ $("#fillData").click();
+ }
})
diff --git a/frontend/register.html b/frontend/register.html new file mode 100644 index 0000000..352d9ec --- /dev/null +++ b/frontend/register.html @@ -0,0 +1,132 @@ + + +
+ +
+ + + + + +
+