From c0ef54f9b769bf68ad41e74bc4477fca14277ae3 Mon Sep 17 00:00:00 2001 From: xiongfeng Date: Tue, 5 Jul 2022 16:22:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=AE=80=E5=8D=95=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=88=90=E5=8A=9F=E9=A1=B5=E9=9D=A2=E5=B9=B6=E4=BC=A0?= =?UTF-8?q?=E9=80=92token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/login.html | 10 ++++-- src/main/resources/templates/success.html | 40 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/templates/success.html diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index 88de722..2bf51e7 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -14,6 +14,7 @@ } + @@ -23,6 +24,7 @@ +
@@ -53,13 +55,17 @@ var json = JSON.stringify(data); var cipher = this.encryptByPublicKey(json); console.log("密文 :" + cipher); - var url = "http://localhost:8088/user/login"; axios.post(url, { encryptedData: cipher, }) .then(function (response) { - console.log(response); + var data = response.data; + if (data.code == 200) { + window.location.href = "success.html?token=" + data.data.token + } else { + alert(data.message) + } }) .catch(function (error) { console.log(error); diff --git a/src/main/resources/templates/success.html b/src/main/resources/templates/success.html new file mode 100644 index 0000000..9dd5e2d --- /dev/null +++ b/src/main/resources/templates/success.html @@ -0,0 +1,40 @@ + + + + + + + 登录成功 + + + +
+

这是登录成功页面

+

+ token: + {{token}} +

+
+ + + + \ No newline at end of file