添加了swagger接口、重置密码、修改了usercontroller
Change-Id: Ib651fa9b0fe0b220eb8cb88dde2b63d6bf54895e
diff --git a/src/main/resources/static/home.html b/src/main/resources/static/home.html
index 5cac114..507e3ad 100644
--- a/src/main/resources/static/home.html
+++ b/src/main/resources/static/home.html
@@ -9,22 +9,20 @@
<div id="userInfo"></div>
<script>
(async () => {
- const token = localStorage.getItem('token'); // 从 localStorage 获取 token
- if (!token) return window.location.href = 'login.html'; // 如果 token 不存在,重定向到登录页面
-
- const res = await fetch('/api/me', {
- headers: { 'token': token } // 使用 token 请求用户信息
- });
-
- const json = await res.json(); // 解析响应数据
- if (json.code !== 0) {
- return window.location.href = 'login.html'; // 如果获取用户信息失败,重定向到登录页面
+ const token = localStorage.getItem('token');
+ if (!token) {
+ return window.location.href = 'login.html';
}
-
- // 输出当前用户和 token
- document.getElementById('userInfo')
- .innerText = '当前用户:' + json.data.username + ',Token:' + json.data; // 显示用户名和 token
+ const res = await fetch('/api/me', {
+ headers: { 'token': token }
+ });
+ const json = await res.json();
+ if (json.code !== 0) {
+ return window.location.href = 'login.html';
+ }
+ document.getElementById('userInfo').innerText =
+ `当前用户:${json.data.username},Token:${json.data.token}`;
})();
</script>
</body>
-</html>
\ No newline at end of file
+</html>