{"id":71055,"date":"2026-02-03T01:18:03","date_gmt":"2026-02-02T17:18:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/71055.html"},"modified":"2026-02-03T01:18:03","modified_gmt":"2026-02-02T17:18:03","slug":"%e5%9f%ba%e4%ba%8espring-boot%e7%9a%84%e5%ae%b6%e5%ba%ad%e8%ae%be%e5%a4%87%e7%bb%b4%e4%bf%ae%e6%9c%8d%e5%8a%a1%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/71055.html","title":{"rendered":"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf"},"content":{"rendered":"<p>&#x1f345; \u4f5c\u8005\u4e3b\u9875&#xff1a;Selina .a<\/p>\n<p>&#x1f345; \u7b80\u4ecb&#xff1a;Java\u9886\u57df\u4f18\u8d28\u521b\u4f5c\u8005&#x1f3c6;\u3001\u4e13\u6ce8\u4e8eJava\u6280\u672f\u9886\u57df\u548c\u5b66\u751f\u6bd5\u4e1a\u9879\u76ee\u5b9e\u6218,\u9ad8\u6821\u8001\u5e08\/\u8bb2\u5e08\/\u540c\u884c\u4ea4\u6d41\u5408\u4f5c\u3002<\/p>\n<p>\u4e3b\u8981\u5185\u5bb9&#xff1a;SpringBoot\u3001Vue\u3001SSM\u3001HLMT\u3001Jsp\u3001PHP\u3001Nodejs\u3001Python\u3001\u722c\u866b\u3001\u6570\u636e\u53ef\u89c6\u5316\u3001\u5c0f\u7a0b\u5e8f\u3001\u5b89\u5353app\u3001\u5927\u6570\u636e\u3001\u7269\u8054\u7f51\u3001\u673a\u5668\u5b66\u4e60\u7b49\u8bbe\u8ba1\u4e0e\u5f00\u53d1\u3002<\/p>\n<p>&#x1f345;<span style=\"color:#fe2c24\">\u6587\u672b\u83b7\u53d6\u6e90\u7801\u8054\u7cfb<\/span>&#x1f345;\u00a0\u00a0<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E8%AF%BE%E9%A2%98%E7%9A%84%E6%8F%90%E5%87%BA-toc\" style=\"margin-left:0px\">\u8bfe\u9898\u7684\u63d0\u51fa<\/p>\n<p id=\"%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1-toc\" style=\"margin-left:0px\">\u6570\u636e\u5e93\u8bbe\u8ba1<\/p>\n<p id=\"%E7%B3%BB%E7%BB%9F%E5%8A%9F%E8%83%BD%E8%AE%BE%E8%AE%A1-toc\" style=\"margin-left:0px\">\u7cfb\u7edf\u529f\u80fd\u8bbe\u8ba1<\/p>\n<p id=\"%E5%85%B3%E9%94%AE%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:0px\">\u5173\u952e\u4ee3\u7801<\/p>\n<p id=\"%C2%A0%E4%B8%93%E6%A0%8F%E6%8E%A8%E8%8D%90-toc\" style=\"margin-left:0px\">\u00a0\u4e13\u680f\u63a8\u8350<\/p>\n<p id=\"%E6%8E%A8%E8%8D%90%E9%A1%B9%E7%9B%AE-toc\" style=\"margin-left:0px\">\u63a8\u8350\u9879\u76ee<\/p>\n<p id=\"%E4%B9%9D%E3%80%81%E6%BA%90%E7%A0%81%E8%8E%B7%E5%8F%96%EF%BC%9A-toc\" style=\"margin-left:0px\">\u6e90\u7801\u83b7\u53d6<\/p>\n<hr \/>\n<h2 id=\"%E8%AF%BE%E9%A2%98%E7%9A%84%E6%8F%90%E5%87%BA\">\u8bfe\u9898\u7684\u63d0\u51fa<\/h2>\n<p>\u5728\u73b0\u4ee3\u57ce\u5e02\u751f\u6d3b\u4e2d&#xff0c;\u5bb6\u7528\u7535\u5668\u4e0e\u7535\u5b50\u8bbe\u5907\u5df2\u6210\u4e3a\u5bb6\u5ead\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u6210\u90e8\u5206\u3002\u7136\u800c&#xff0c;\u5f53\u51b0\u7bb1\u3001\u7a7a\u8c03\u3001\u6d17\u8863\u673a\u7b49\u8bbe\u5907\u51fa\u73b0\u6545\u969c\u65f6&#xff0c;\u4f20\u7edf\u7684\u7ef4\u4fee\u670d\u52a1\u6a21\u5f0f\u5f80\u5f80\u7ed9\u7528\u6237\u5e26\u6765\u8bf8\u591a\u56f0\u6270&#xff1a;\u5bfb\u627e\u53ef\u9760\u7ef4\u4fee\u5e08\u5085\u6e20\u9053\u6709\u9650\u3001\u4ef7\u683c\u4e0d\u900f\u660e\u3001\u670d\u52a1\u8d28\u91cf\u53c2\u5dee\u4e0d\u9f50\u3001\u9884\u7ea6\u65f6\u95f4\u4e0d\u4fbf\u3001\u7ef4\u4fee\u8fc7\u7a0b\u65e0\u6cd5\u8ffd\u6eaf&#xff0c;\u4ee5\u53ca\u53ef\u80fd\u906d\u9047\u201c\u5c0f\u75c5\u5927\u4fee\u201d\u7b49\u884c\u4e1a\u4e71\u8c61\u3002\u540c\u65f6&#xff0c;\u5bf9\u4e8e\u5927\u91cf\u5206\u6563\u7684\u4e2a\u4f53\u7ef4\u4fee\u6280\u5e08\u6216\u4e2d\u5c0f\u670d\u52a1\u5546\u800c\u8a00&#xff0c;\u4e5f\u9762\u4e34\u7740\u83b7\u5ba2\u6e20\u9053\u5355\u4e00\u3001\u8ba2\u5355\u4e0d\u7a33\u5b9a\u3001\u670d\u52a1\u6d41\u7a0b\u7ba1\u7406\u4f4e\u6548\u3001\u54c1\u724c\u5316\u7a0b\u5ea6\u4e0d\u9ad8\u7b49\u6311\u6218\u3002\u8fd9\u79cd\u4f9b\u9700\u53cc\u65b9\u7684\u4fe1\u606f\u4e0d\u5bf9\u79f0\u4e0e\u670d\u52a1\u4f53\u9a8c\u65ad\u5c42&#xff0c;\u6784\u6210\u4e86\u5f53\u524d\u5bb6\u5ead\u7ef4\u4fee\u5e02\u573a\u7684\u6838\u5fc3\u75db\u70b9\u3002<\/p>\n<p>\u4e3a\u4e86\u7834\u89e3\u8fd9\u4e00\u56f0\u5883&#xff0c;\u6784\u5efa\u4e00\u4e2a\u6570\u5b57\u5316\u3001\u6807\u51c6\u5316\u3001\u900f\u660e\u5316\u7684\u7ebf\u4e0a\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u5e73\u53f0\u52bf\u5728\u5fc5\u884c\u3002\u672c\u9879\u76ee\u65e8\u5728\u5229\u7528Spring Boot\u4e0eVue.js\u524d\u540e\u7aef\u5206\u79bb\u7684\u73b0\u4ee3Web\u67b6\u6784&#xff0c;\u6253\u9020\u4e00\u4e2a\u8fde\u63a5\u7528\u6237\u4e0e\u4e13\u4e1a\u7ef4\u4fee\u670d\u52a1\u8005\u7684O2O&#xff08;\u7ebf\u4e0a\u5230\u7ebf\u4e0b&#xff09;\u7efc\u5408\u670d\u52a1\u7cfb\u7edf\u3002<\/p>\n<p>\u5728\u8be5\u7cfb\u7edf\u4e2d&#xff0c;Spring Boot\u4f5c\u4e3a\u540e\u7aef\u670d\u52a1\u57fa\u77f3&#xff0c;\u5c06\u627f\u62c5\u8d77\u6784\u5efa\u7a33\u5b9a\u3001\u5b89\u5168\u3001\u9ad8\u6027\u80fd\u4e1a\u52a1\u903b\u8f91\u7684\u91cd\u4efb\u3002\u5b83\u80fd\u591f\u9ad8\u6548\u5b9e\u73b0\u7528\u6237\u4e0e\u6280\u5e08\u7684\u6ce8\u518c\u8ba4\u8bc1\u4f53\u7cfb\u3001\u57fa\u4e8e\u5730\u7406\u4f4d\u7f6e&#xff08;LBS&#xff09;\u7684\u667a\u80fd\u8ba2\u5355\u6d3e\u53d1\u4e0e\u62a2\u5355\u673a\u5236\u3001\u670d\u52a1\u9879\u76ee\u4e0e\u52a8\u6001\u4ef7\u683c\u7684\u6807\u51c6\u5316\u7ba1\u7406\u3001\u5728\u7ebf\u652f\u4ed8\u4e0e\u8bc4\u4ef7\u7cfb\u7edf\u7684\u96c6\u6210&#xff0c;\u4ee5\u53ca\u590d\u6742\u7684\u8ba2\u5355\u72b6\u6001\u6d41\u7a0b\u7ba1\u63a7\u3002\u5176\u5fae\u670d\u52a1\u53cb\u597d\u7684\u7279\u6027\u548c\u5f3a\u5927\u7684\u4e8b\u52a1\u7ba1\u7406\u80fd\u529b&#xff0c;\u786e\u4fdd\u4e86\u591a\u7528\u6237\u5e76\u53d1\u9884\u7ea6\u3001\u6280\u5e08\u8c03\u5ea6\u3001\u8d22\u52a1\u7ed3\u7b97\u7b49\u6838\u5fc3\u4e1a\u52a1\u573a\u666f\u7684\u53ef\u9760\u8fd0\u884c\u3002<\/p>\n<p>\u524d\u7aef\u5219\u91c7\u7528Vue.js\u6846\u67b6&#xff0c;\u6784\u5efa\u76f4\u89c2\u6613\u7528\u7684\u4ea4\u4e92\u754c\u9762\u3002\u7528\u6237\u7aef\u53ef\u4fbf\u6377\u5b9e\u73b0\u6545\u969c\u63cf\u8ff0\u3001\u5728\u7ebf\u9884\u7ea6\u3001\u670d\u52a1\u6bd4\u4ef7\u3001\u5b9e\u65f6\u67e5\u770b\u6280\u5e08\u4f4d\u7f6e\u4e0e\u8fdb\u5ea6\u3001\u5728\u7ebf\u652f\u4ed8\u4e0e\u8bc4\u4ef7\u5168\u6d41\u7a0b\u3002\u6280\u5e08\u7aef\u5219\u80fd\u9ad8\u6548\u7ba1\u7406\u4e2a\u4eba\u65e5\u7a0b\u3001\u63a5\u6536\u8ba2\u5355\u3001\u67e5\u770b\u5bfc\u822a\u3001\u66f4\u65b0\u7ef4\u4fee\u72b6\u6001\u5e76\u7ba1\u7406\u6536\u5165\u3002Vue\u7684\u54cd\u5e94\u5f0f\u7279\u6027\u548c\u7ec4\u4ef6\u5316\u5f00\u53d1&#xff0c;\u786e\u4fdd\u4e86\u8de8\u7ec8\u7aef&#xff08;PC\u3001\u79fb\u52a8\u7aef&#xff09;\u7684\u4e00\u81f4\u6d41\u7545\u4f53\u9a8c&#xff0c;\u8fd9\u5bf9\u4e8e\u9700\u8981\u9891\u7e41\u72b6\u6001\u66f4\u65b0\u7684\u670d\u52a1\u7c7b\u5e94\u7528\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p>\u672c\u9879\u76ee\u4e0d\u4ec5\u662f\u6280\u672f\u5b9e\u73b0&#xff0c;\u66f4\u662f\u4e00\u6b21\u5bf9\u4f20\u7edf\u751f\u6d3b\u670d\u52a1\u884c\u4e1a\u7684\u6570\u5b57\u5316\u6539\u9020\u3002\u5b83\u901a\u8fc7\u5efa\u7acb\u53ef\u4fe1\u7684\u670d\u52a1\u6807\u51c6\u3001\u900f\u660e\u7684\u5b9a\u4ef7\u4f53\u7cfb\u3001\u53ef\u89c6\u5316\u7684\u670d\u52a1\u6d41\u7a0b\u4e0e\u53cc\u5411\u8bc4\u4ef7\u673a\u5236&#xff0c;\u65e8\u5728\u91cd\u5851\u7528\u6237\u4fe1\u4efb&#xff0c;\u63d0\u5347\u670d\u52a1\u6548\u7387\u4e0e\u8d28\u91cf\u3002\u5e73\u53f0\u5728\u521b\u9020\u4fbf\u6377\u751f\u6d3b\u4ef7\u503c\u7684\u540c\u65f6&#xff0c;\u4e5f\u6709\u52a9\u4e8e\u89c4\u8303\u7ef4\u4fee\u5e02\u573a&#xff0c;\u8d4b\u80fd\u5e7f\u5927\u7ef4\u4fee\u6280\u5e08&#xff0c;\u662f\u54cd\u5e94\u201c\u4e92\u8054\u7f51&#043;\u751f\u6d3b\u670d\u52a1\u201d\u8d8b\u52bf&#xff0c;\u63a8\u52a8\u5bb6\u5ead\u670d\u52a1\u4e1a\u5411\u73b0\u4ee3\u5316\u3001\u6807\u51c6\u5316\u8f6c\u578b\u5347\u7ea7\u7684\u91cd\u8981\u5b9e\u8df5\u3002<\/p>\n<hr \/>\n<h2 id=\"%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1\">\u529f\u80fd\u89d2\u8272\u63cf\u8ff0<\/h2>\n<p>\u7528\u6237&#xff1a;\u6ce8\u518c\u767b\u5f55&#xff08;\u53ef\u4ee5\u4eba\u8138\u8bc6\u522b\u767b\u5f55&#xff09;\u3001\u9996\u9875\u3001\u516c\u544a\u4fe1\u606f\u3001\u7559\u8a00\u53cd\u9988\u3001\u4e2a\u4eba\u4e2d\u5fc3&#xff08;\u4fee\u6539\u5bc6\u7801\u3001\u8bbe\u5907\u4fe1\u606f\u3001\u8bbe\u5907\u62a5\u4fee\u3001\u62a5\u4fee\u5206\u914d\u3001\u7ef4\u4fee\u5b8c\u6210\u3001\u73af\u5883\u76d1\u6d4b\u3001\u6211\u7684\u6536\u85cf&#xff09;\u3002<\/p>\n<p>\u7ef4\u4fee\u4eba\u5458&#xff1a;\u62a5\u4fee\u5206\u914d\u3001\u7ef4\u4fee\u5b8c\u6210\u3001\u73af\u5883\u76d1\u6d4b\u3001\u7cfb\u7edf\u9996\u9875\u3001\u4e2a\u4eba\u4e2d\u5fc3\u3002<\/p>\n<p>\u7ba1\u7406\u5458&#xff1a;\u7528\u6237\u3001\u7ef4\u4fee\u4eba\u5458\u3001\u8bbe\u5907\u7c7b\u578b\u3001\u8bbe\u5907\u4fe1\u606f\u3001\u7ef4\u4fee\u7c7b\u578b\u3001\u8bbe\u5907\u62a5\u4fee\u3001\u62a5\u4fee\u5206\u914d\u3001\u7ef4\u4fee\u5b8c\u6210\u3001\u73af\u5883\u76d1\u6d4b\u3001\u7559\u8a00\u53cd\u9988\u3001\u7cfb\u7edf\u7ba1\u7406\u3001\u7cfb\u7edf\u9996\u9875\u3001\u4e2a\u4eba\u4e2d\u5fc3\u3002<\/p>\n<hr \/>\n<h2 id=\"%E7%B3%BB%E7%BB%9F%E5%8A%9F%E8%83%BD%E8%AE%BE%E8%AE%A1\">\u7cfb\u7edf\u754c\u9762\u5c55\u793a<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"916\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171753-6980dc4180a59.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"912\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171754-6980dc4276eac.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"913\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171755-6980dc435048a.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"914\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171755-6980dc43f01ee.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"911\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171756-6980dc448cbb6.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"910\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171757-6980dc452e645.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"908\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171757-6980dc45ca5fd.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"910\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171758-6980dc467bb69.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"913\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171759-6980dc473bdec.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"912\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171800-6980dc4822d50.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"906\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171800-6980dc48c4154.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"910\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171801-6980dc498b598.png\" width=\"1919\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"908\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171802-6980dc4a43b6b.png\" width=\"1919\" \/><\/p>\n<hr \/>\n<h2 id=\"%E5%85%B3%E9%94%AE%E4%BB%A3%E7%A0%81\">\u5173\u952e\u4ee3\u7801<\/h2>\n<p>package com.controller;<\/p>\n<p>import java.util.Arrays;<br \/>\nimport java.util.Calendar;<br \/>\nimport java.util.Date;<br \/>\nimport java.util.Map;<\/p>\n<p>import javax.servlet.http.HttpServletRequest;<\/p>\n<p>import org.springframework.beans.factory.annotation.Autowired;<br \/>\nimport org.springframework.stereotype.Controller;<br \/>\nimport org.springframework.web.bind.annotation.GetMapping;<br \/>\nimport org.springframework.web.bind.annotation.PathVariable;<br \/>\nimport org.springframework.web.bind.annotation.PostMapping;<br \/>\nimport org.springframework.web.bind.annotation.RequestBody;<br \/>\nimport org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RequestParam;<br \/>\nimport org.springframework.web.bind.annotation.ResponseBody;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>import com.annotation.IgnoreAuth;<br \/>\nimport com.baomidou.mybatisplus.mapper.EntityWrapper;<br \/>\nimport com.entity.TokenEntity;<br \/>\nimport com.entity.UserEntity;<br \/>\nimport com.service.TokenService;<br \/>\nimport com.service.UserService;<br \/>\nimport com.utils.CommonUtil;<br \/>\nimport com.utils.MPUtil;<br \/>\nimport com.utils.PageUtils;<br \/>\nimport com.utils.R;<br \/>\nimport com.utils.ValidatorUtils;<\/p>\n<p>\/**<br \/>\n * \u767b\u5f55\u76f8\u5173<br \/>\n *\/<br \/>\n&#064;RequestMapping(&#034;users&#034;)<br \/>\n&#064;RestController<br \/>\npublic class UserController{<\/p>\n<p>&#064;Autowired<br \/>\nprivate UserService userService;<\/p>\n<p>&#064;Autowired<br \/>\nprivate TokenService tokenService;<\/p>\n<p>\/**<br \/>\n * \u767b\u5f55<br \/>\n *\/<br \/>\n&#064;IgnoreAuth<br \/>\n&#064;PostMapping(value &#061; &#034;\/login&#034;)<br \/>\npublic R login(String username, String password, String captcha, HttpServletRequest request) {<br \/>\nUserEntity user &#061; userService.selectOne(new EntityWrapper&lt;UserEntity&gt;().eq(&#034;username&#034;, username));<br \/>\nif(user&#061;&#061;null || !user.getPassword().equals(password)) {<br \/>\nreturn R.error(&#034;\u8d26\u53f7\u6216\u5bc6\u7801\u4e0d\u6b63\u786e&#034;);<br \/>\n}<br \/>\nString token &#061; tokenService.generateToken(user.getId(),username, &#034;users&#034;, user.getRole());<br \/>\nreturn R.ok().put(&#034;token&#034;, token);<br \/>\n}<\/p>\n<p>\/**<br \/>\n * \u6ce8\u518c<br \/>\n *\/<br \/>\n&#064;IgnoreAuth<br \/>\n&#064;PostMapping(value &#061; &#034;\/register&#034;)<br \/>\npublic R register(&#064;RequestBody UserEntity user){<br \/>\n\/\/    ValidatorUtils.validateEntity(user);<br \/>\n    if(userService.selectOne(new EntityWrapper&lt;UserEntity&gt;().eq(&#034;username&#034;, user.getUsername())) !&#061;null) {<br \/>\n    return R.error(&#034;\u7528\u6237\u5df2\u5b58\u5728&#034;);<br \/>\n    }<br \/>\n        userService.insert(user);<br \/>\n        return R.ok();<br \/>\n    }<\/p>\n<p>\/**<br \/>\n * \u9000\u51fa<br \/>\n *\/<br \/>\n&#064;GetMapping(value &#061; &#034;logout&#034;)<br \/>\npublic R logout(HttpServletRequest request) {<br \/>\nrequest.getSession().invalidate();<br \/>\nreturn R.ok(&#034;\u9000\u51fa\u6210\u529f&#034;);<br \/>\n}<\/p>\n<p>\/**<br \/>\n     * \u5bc6\u7801\u91cd\u7f6e<br \/>\n     *\/<br \/>\n    &#064;IgnoreAuth<br \/>\n&#064;RequestMapping(value &#061; &#034;\/resetPass&#034;)<br \/>\n    public R resetPass(String username, HttpServletRequest request){<br \/>\n    UserEntity user &#061; userService.selectOne(new EntityWrapper&lt;UserEntity&gt;().eq(&#034;username&#034;, username));<br \/>\n    if(user&#061;&#061;null) {<br \/>\n    return R.error(&#034;\u8d26\u53f7\u4e0d\u5b58\u5728&#034;);<br \/>\n    }<br \/>\n    user.setPassword(&#034;123456&#034;);<br \/>\n        userService.update(user,null);<br \/>\n        return R.ok(&#034;\u5bc6\u7801\u5df2\u91cd\u7f6e\u4e3a&#xff1a;123456&#034;);<br \/>\n    }<\/p>\n<p>\/**<br \/>\n     * \u5217\u8868<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/page&#034;)<br \/>\n    public R page(&#064;RequestParam Map&lt;String, Object&gt; params,UserEntity user){<br \/>\n        EntityWrapper&lt;UserEntity&gt; ew &#061; new EntityWrapper&lt;UserEntity&gt;();<br \/>\n    PageUtils page &#061; userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));<br \/>\n        return R.ok().put(&#034;data&#034;, page);<br \/>\n    }<\/p>\n<p>\/**<br \/>\n     * \u5217\u8868<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/list&#034;)<br \/>\n    public R list( UserEntity user){<br \/>\n       EntityWrapper&lt;UserEntity&gt; ew &#061; new EntityWrapper&lt;UserEntity&gt;();<br \/>\n      ew.allEq(MPUtil.allEQMapPre( user, &#034;user&#034;));<br \/>\n        return R.ok().put(&#034;data&#034;, userService.selectListView(ew));<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u4fe1\u606f<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/info\/{id}&#034;)<br \/>\n    public R info(&#064;PathVariable(&#034;id&#034;) String id){<br \/>\n        UserEntity user &#061; userService.selectById(id);<br \/>\n        return R.ok().put(&#034;data&#034;, user);<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u83b7\u53d6\u7528\u6237\u7684session\u7528\u6237\u4fe1\u606f<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/session&#034;)<br \/>\n    public R getCurrUser(HttpServletRequest request){<br \/>\n    Long id &#061; (Long)request.getSession().getAttribute(&#034;userId&#034;);<br \/>\n        UserEntity user &#061; userService.selectById(id);<br \/>\n        return R.ok().put(&#034;data&#034;, user);<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u4fdd\u5b58<br \/>\n     *\/<br \/>\n    &#064;PostMapping(&#034;\/save&#034;)<br \/>\n    public R save(&#064;RequestBody UserEntity user){<br \/>\n\/\/    ValidatorUtils.validateEntity(user);<br \/>\n    if(userService.selectOne(new EntityWrapper&lt;UserEntity&gt;().eq(&#034;username&#034;, user.getUsername())) !&#061;null) {<br \/>\n    return R.error(&#034;\u7528\u6237\u5df2\u5b58\u5728&#034;);<br \/>\n    }<br \/>\n        userService.insert(user);<br \/>\n        return R.ok();<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u4fee\u6539<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/update&#034;)<br \/>\n    public R update(&#064;RequestBody UserEntity user){<br \/>\n\/\/        ValidatorUtils.validateEntity(user);<br \/>\n    UserEntity u &#061; userService.selectOne(new EntityWrapper&lt;UserEntity&gt;().eq(&#034;username&#034;, user.getUsername()));<br \/>\n    if(u!&#061;null &amp;&amp; u.getId()!&#061;user.getId() &amp;&amp; u.getUsername().equals(user.getUsername())) {<br \/>\n    return R.error(&#034;\u7528\u6237\u540d\u5df2\u5b58\u5728\u3002&#034;);<br \/>\n    }<br \/>\n        userService.updateById(user);\/\/\u5168\u90e8\u66f4\u65b0<br \/>\n        return R.ok();<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u5220\u9664<br \/>\n     *\/<br \/>\n    &#064;RequestMapping(&#034;\/delete&#034;)<br \/>\n    public R delete(&#064;RequestBody Long[] ids){<br \/>\n        userService.deleteBatchIds(Arrays.asList(ids));<br \/>\n        return R.ok();<br \/>\n    }<br \/>\n}<\/p>\n<hr \/>\n<h2 id=\"%C2%A0%E4%B8%93%E6%A0%8F%E6%8E%A8%E8%8D%90\">\u00a0\u4e13\u680f\u63a8\u8350<\/h2>\n<p>Spring Boot&#043;Vue&#043;CSS&#043;JavaScript&#043;HTML\u7b49\u6280\u672f\u9879\u76ee\u4e13\u680f\u63a8\u8350<\/p>\n<p>\u9879\u76ee\u6c47\u603b\u4e13\u680f\u63a8\u8350<\/p>\n<hr \/>\n<h2 id=\"%E6%8E%A8%E8%8D%90%E9%A1%B9%E7%9B%AE\">\u63a8\u8350\u9879\u76ee<\/h2>\n<p id=\"articleContentId\">\u57fa\u4e8eNode.js&#043;Vue&#043;MySQL\u7684\u5c0f\u578b\u4f01\u4e1a\u5de5\u8d44\u7ba1\u7406\u7cfb\u7edf<\/p>\n<p>\u57fa\u4e8eSSM&#043;Android&#043;MySQL\u7684\u6821\u56ed\u8003\u7814\u8bba\u575b\u00a0<\/p>\n<p>\u57fa\u4e8eSpring Boot&#043;Android&#043;MySQL\u7684\u8bb0\u5f55\u751f\u6d3b\u7ba1\u7406\u7cfb\u7edf\u00a0<\/p>\n<p>\u57fa\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u519c\u4e1a\u7535\u5546\u670d\u52a1\u7ba1\u7406\u7cfb\u7edf\u00a0<\/p>\n<p>\u57fa\u4e8e\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u667a\u6167\u7269\u6d41\u5c0f\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u00a0<\/p>\n<hr \/>\n<h2 id=\"%E4%B9%9D%E3%80%81%E6%BA%90%E7%A0%81%E8%8E%B7%E5%8F%96%EF%BC%9A\">\u6e90\u7801\u83b7\u53d6<\/h2>\n<p>\u00a0\u5927\u5bb6\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u5173\u6ce8\u3001\u8bc4\u8bba\u5566 \u3001\u67e5\u770b&#x1f447;&#x1f3fb;\u83b7\u53d6\u8054\u7cfb\u65b9\u5f0f&#x1f447;&#x1f3fb;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f345; \u4f5c\u8005\u4e3b\u9875&#xff1a;Selina .a &#x1f345; \u7b80\u4ecb&#xff1a;Java\u9886\u57df\u4f18\u8d28\u521b\u4f5c\u8005&#x1f3c6;\u3001\u4e13\u6ce8\u4e8eJava\u6280\u672f\u9886\u57df\u548c\u5b66\u751f\u6bd5\u4e1a\u9879\u76ee\u5b9e\u6218,\u9ad8\u6821\u8001\u5e08\/\u8bb2\u5e08\/\u540c\u884c\u4ea4\u6d41\u5408\u4f5c\u3002 \u4e3b\u8981\u5185\u5bb9&#xff1a;SpringBoot\u3001Vue\u3001SSM\u3001HLMT\u3001Jsp\u3001PHP\u3001Nodejs\u3001Python\u3001\u722c\u866b\u3001\u6570\u636e\u53ef\u89c6\u5316\u3001\u5c0f\u7a0b\u5e8f\u3001\u5b89\u5353app\u3001\u5927\u6570\u636e\u3001\u7269\u8054\u7f51\u3001\u673a\u5668\u5b66\u4e60\u7b49\u8bbe\u8ba1\u4e0e\u5f00\u53d1\u3002 &#x1f345;\u6587\u672b\u83b7\u53d6\u6e90\u7801\u8054\u7cfb&#x1f345;\u00a0\u00a0 \u76ee\u5f55 <\/p>\n","protected":false},"author":2,"featured_media":71042,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,98,292],"topic":[],"class_list":["post-71055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring-boot","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/71055.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f345; \u4f5c\u8005\u4e3b\u9875&#xff1a;Selina .a &#x1f345; \u7b80\u4ecb&#xff1a;Java\u9886\u57df\u4f18\u8d28\u521b\u4f5c\u8005&#x1f3c6;\u3001\u4e13\u6ce8\u4e8eJava\u6280\u672f\u9886\u57df\u548c\u5b66\u751f\u6bd5\u4e1a\u9879\u76ee\u5b9e\u6218,\u9ad8\u6821\u8001\u5e08\/\u8bb2\u5e08\/\u540c\u884c\u4ea4\u6d41\u5408\u4f5c\u3002 \u4e3b\u8981\u5185\u5bb9&#xff1a;SpringBoot\u3001Vue\u3001SSM\u3001HLMT\u3001Jsp\u3001PHP\u3001Nodejs\u3001Python\u3001\u722c\u866b\u3001\u6570\u636e\u53ef\u89c6\u5316\u3001\u5c0f\u7a0b\u5e8f\u3001\u5b89\u5353app\u3001\u5927\u6570\u636e\u3001\u7269\u8054\u7f51\u3001\u673a\u5668\u5b66\u4e60\u7b49\u8bbe\u8ba1\u4e0e\u5f00\u53d1\u3002 &#x1f345;\u6587\u672b\u83b7\u53d6\u6e90\u7801\u8054\u7cfb&#x1f345;\u00a0\u00a0 \u76ee\u5f55\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/71055.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-02T17:18:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171753-6980dc4180a59.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71055.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/71055.html\",\"name\":\"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-02T17:18:03+00:00\",\"dateModified\":\"2026-02-02T17:18:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/71055.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/71055.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71055.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/71055.html","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f345; \u4f5c\u8005\u4e3b\u9875&#xff1a;Selina .a &#x1f345; \u7b80\u4ecb&#xff1a;Java\u9886\u57df\u4f18\u8d28\u521b\u4f5c\u8005&#x1f3c6;\u3001\u4e13\u6ce8\u4e8eJava\u6280\u672f\u9886\u57df\u548c\u5b66\u751f\u6bd5\u4e1a\u9879\u76ee\u5b9e\u6218,\u9ad8\u6821\u8001\u5e08\/\u8bb2\u5e08\/\u540c\u884c\u4ea4\u6d41\u5408\u4f5c\u3002 \u4e3b\u8981\u5185\u5bb9&#xff1a;SpringBoot\u3001Vue\u3001SSM\u3001HLMT\u3001Jsp\u3001PHP\u3001Nodejs\u3001Python\u3001\u722c\u866b\u3001\u6570\u636e\u53ef\u89c6\u5316\u3001\u5c0f\u7a0b\u5e8f\u3001\u5b89\u5353app\u3001\u5927\u6570\u636e\u3001\u7269\u8054\u7f51\u3001\u673a\u5668\u5b66\u4e60\u7b49\u8bbe\u8ba1\u4e0e\u5f00\u53d1\u3002 &#x1f345;\u6587\u672b\u83b7\u53d6\u6e90\u7801\u8054\u7cfb&#x1f345;\u00a0\u00a0 \u76ee\u5f55","og_url":"https:\/\/www.wsisp.com\/helps\/71055.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-02T17:18:03+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260202171753-6980dc4180a59.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/71055.html","url":"https:\/\/www.wsisp.com\/helps\/71055.html","name":"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-02T17:18:03+00:00","dateModified":"2026-02-02T17:18:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/71055.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/71055.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/71055.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8eSpring Boot\u7684\u5bb6\u5ead\u8bbe\u5907\u7ef4\u4fee\u670d\u52a1\u7cfb\u7edf"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=71055"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/71042"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=71055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=71055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=71055"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=71055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}