{"id":55430,"date":"2025-08-13T22:14:48","date_gmt":"2025-08-13T14:14:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55430.html"},"modified":"2025-08-13T22:14:48","modified_gmt":"2025-08-13T14:14:48","slug":"%e8%8b%8d%e7%a9%b9%e5%a4%96%e5%8d%96%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%98%ef%bc%88%e6%97%a5%e8%ae%b0%e4%b8%89%ef%bc%89-%e8%ae%b0%e5%bd%95%e5%ae%9e%e6%88%98%e6%95%99%e7%a8%8b%e5%8f%8a%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55430.html","title":{"rendered":"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd"},"content":{"rendered":"<h3 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">\u4e03\u3001\u529f\u80fd\u4ee3\u7801\u5b8c\u5584<\/span><\/h3>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">&#xff08;1&#xff09;\u65b0\u589e\u5458\u5de5\u529f\u80fd<\/span><\/h4>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">1\u3001\u63a7\u5236\u5c42\u4ee3\u7801&#xff1a;<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e &#xff1a;sky-take-out\\\\sky-server\\\\src\\\\main\\\\java\\\\com\\\\sky\\\\controller\\\\admin\\\\EmployeeController.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/**<\/span> \u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">*<\/span> <span style=\"color:#60a0b0\">\u65b0\u589e\u5458\u5de5<\/span> <span style=\"color:#60a0b0\">\u00a0\u00a0\u00a0\u00a0 * <\/span><span style=\"color:#60a0b0\">&#064;param<\/span> <span style=\"color:#60a0b0\">employeeDTO<\/span> \u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">*<\/span> <span style=\"color:#60a0b0\">&#064;return<\/span> \u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">*\/<\/span> \u00a0\u00a0\u00a0 <span style=\"color:#7d9029\">&#064;PostMapping<\/span><span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u6dfb\u52a0\u8fd9\u4e2a\u6ce8\u91ca\u662f\u56e0\u4e3a\u524d\u7aef\u63d0\u4ea4\u7684\u6570\u636e\u683c\u5f0f\u662fJSON<\/span><span style=\"color:#60a0b0\">&#xff0c;\u6240\u4ee5\u53c2\u6570\u9700\u8981\u518d\u4f7f\u7528&#064;RequestBody<\/span><span style=\"color:#60a0b0\">\u6ce8\u89e3 <\/span> \u00a0\u00a0\u00a0 <span style=\"color:#7d9029\">&#064;ApiOperation<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#4070a0\">&#034;<\/span><span style=\"color:#4070a0\">\u65b0\u589e\u5458\u5de5&#034;<\/span><span style=\"color:#666666\">)<\/span><span style=\"color:#60a0b0\">\/\/value<\/span><span style=\"color:#60a0b0\">\u5df2\u7701\u7565,<\/span><span style=\"color:#60a0b0\">\u529f\u80fd\u63cf\u8ff0\u6ce8\u89e3&#xff0c;\u7528\u4e8e\u63a5\u53e3\u6587\u6863 <\/span> \u00a0\u00a0\u00a0 <span style=\"color:#007020\">public<\/span> <span style=\"color:green\">Result<\/span> <span style=\"color:#06287e\">save<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#7d9029\">&#064;RequestBody<\/span> EmployeeDTO employeeDTO<span style=\"color:#666666\">){<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 log<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">info<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#4070a0\">&#034;<\/span><span style=\"color:#4070a0\">\u65b0\u589e\u5458\u5de5&#xff1a;{}&#034;<\/span><span style=\"color:#666666\">,<\/span>employeeDTO<span style=\"color:#666666\">);<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employeeService<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">save<\/span><span style=\"color:#666666\">(<\/span>employeeDTO<span style=\"color:#666666\">);<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#007020\">return<\/span> <span style=\"color:green\">Result<\/span><span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">success<\/span><span style=\"color:#666666\">();<\/span> \u00a0\u00a0\u00a0 <span style=\"color:#666666\">}<\/span><\/p>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">2\u3001\u670d\u52a1\u5c42\u63a5\u53e3\u4ee3\u7801&#xff1a;<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-server\/src\/main\/java\/com\/sky\/service\/EmployeeService.java<\/p>\n<p style=\"margin-left:0;margin-right:0\"><span style=\"color:#60a0b0\">\/**<\/span> \u00a0<span style=\"color:#60a0b0\">*<\/span> <span style=\"color:#60a0b0\">\u65b0\u589e\u5458\u5de5<\/span> <span style=\"color:#60a0b0\">\u00a0* <\/span><span style=\"color:#60a0b0\">&#064;param<\/span> <span style=\"color:#60a0b0\">employeeDTO<\/span> \u00a0<span style=\"color:#60a0b0\">*\/<\/span> <span style=\"color:#902000\">void<\/span> <span style=\"color:#06287e\">save<\/span><span style=\"color:#666666\">(<\/span>EmployeeDTO employeeDTO<span style=\"color:#666666\">);<\/span><\/p>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">3\u3001\u670d\u52a1\u5c42\u5b9e\u73b0\u4ee3\u7801&#xff1a;<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-take-out\\\\sky-server\\\\src\\\\main\\\\java\\\\com\\\\sky\\\\service\\\\impl\\\\EmployeeServiceImpl.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/**<\/span> \u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">*<\/span> <span style=\"color:#60a0b0\">\u65b0\u589e\u5458\u5de5<\/span> <span style=\"color:#60a0b0\">\u00a0\u00a0\u00a0\u00a0 * <\/span><span style=\"color:#60a0b0\">&#064;param<\/span> <span style=\"color:#60a0b0\">employeeDTO<\/span> \u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">*\/<\/span> \u00a0\u00a0\u00a0 <span style=\"color:#007020\">public<\/span> <span style=\"color:#902000\">void<\/span> <span style=\"color:#06287e\">save<\/span><span style=\"color:#666666\">(<\/span>EmployeeDTO employeeDTO<span style=\"color:#666666\">)<\/span> <span style=\"color:#666666\">{<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Employee employee <span style=\"color:#666666\">&#061;<\/span> <span style=\"color:#007020\">new<\/span> <span style=\"color:#06287e\">Employee<\/span><span style=\"color:#666666\">();<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8bbe\u7f6e\u5c5e\u6027\u540d <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u65b9\u6cd5\u4e00&#xff1a;\u8c03\u7528\u81ea\u5b9a\u4e49\u65b9\u6cd5 <\/span> <span style=\"color:#60a0b0\">\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee.setName(employeeDTO.getName()); <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u65b9\u6cd5\u4e8c&#xff1a;\u5bf9\u8c61\u5c5e\u6027\u62f7\u8d1d <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u56e0\u4e3aemployeeDTO<\/span><span style=\"color:#60a0b0\">\u548cemployee<\/span><span style=\"color:#60a0b0\">\u4e2d\u7684\u90e8\u5206\u5c5e\u6027\u540d\u76f8\u540c <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 BeanUtils<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">copyProperties<\/span><span style=\"color:#666666\">(<\/span>employeeDTO<span style=\"color:#666666\">,<\/span>employee<span style=\"color:#666666\">);<\/span><span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u7531employeeDTO<\/span><span style=\"color:#60a0b0\">\u62f7\u8d1d\u5230employee <\/span> \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8bbe\u7f6e\u8d26\u53f7\u9ed8\u8ba4\u72b6\u6001&#xff0c;1<\/span><span style=\"color:#60a0b0\">\u8868\u793a\u6b63\u5e38&#xff0c;0<\/span><span style=\"color:#60a0b0\">\u8868\u793a\u7981\u7528 <\/span> <span style=\"color:#60a0b0\">\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee.setStatus(1); <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u4e3a\u4ee3\u7801\u89c4\u8303&#xff0c;\u65b9\u4fbf\u540e\u7eed\u7ef4\u62a4&#xff0c;\u5c06\u53c2\u6570\u8bbe\u7f6e\u6210\u81ea\u5b9a\u4e49\u5e38\u91cfStatusConstant.ENABLE &#061; 1 <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setStatus<\/span><span style=\"color:#666666\">(<\/span>StatusConstant<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">ENABLE<\/span><span style=\"color:#666666\">);<\/span> \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8bbe\u7f6e\u5bc6\u7801&#xff0c;\u9ed8\u8ba4\u4e3a\u201c123456\u201d<\/span><span style=\"color:#60a0b0\">&#xff0c;\u9700\u8981\u5bf9\u5bc6\u7801\u8fdb\u884cmd5<\/span><span style=\"color:#60a0b0\">\u52a0\u5bc6,PasswordConstant.DEFAULT_PASSWORD &#061; &#034;123456&#034; <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setPassword<\/span><span style=\"color:#666666\">(<\/span>DigestUtils<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">md5DigestAsHex<\/span><span style=\"color:#666666\">(<\/span>PasswordConstant<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">DEFAULT_PASSWORD<\/span><span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">getBytes<\/span><span style=\"color:#666666\">()));<\/span> \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8bbe\u7f6e\u521b\u5efa\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u95f4 <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setCreateTime<\/span><span style=\"color:#666666\">(<\/span>LocalDateTime<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">now<\/span><span style=\"color:#666666\">());<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setUpdateTime<\/span><span style=\"color:#666666\">(<\/span>LocalDateTime<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">now<\/span><span style=\"color:#666666\">());<\/span> \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8bbe\u7f6e\u521b\u5efa\u4ebaID<\/span><span style=\"color:#60a0b0\">\u548c\u4fee\u6539\u4ebaID<\/span><span style=\"color:#60a0b0\">&#xff0c;\u76ee\u524d\u5148\u5199\u6b7b\u4e3a\u4e00\u4e2a\u56fa\u5b9a\u503c <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:red\">TODO<\/span> <span style=\"color:#60a0b0\">\u540e\u671f\u9700\u8981\u4fee\u6539\u4e3a\u767b\u5f55\u4ebaID <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setCreateUser<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#40a070\">10L<\/span><span style=\"color:#666666\">);<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employee<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">setUpdateUser<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#40a070\">10L<\/span><span style=\"color:#666666\">);<\/span> \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#60a0b0\">\/\/<\/span><span style=\"color:#60a0b0\">\u8c03\u7528\u6301\u4e45\u5c42mapper <\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 employeeMapper<span style=\"color:#666666\">.<\/span><span style=\"color:#06287e\">insert<\/span><span style=\"color:#666666\">(<\/span>employee<span style=\"color:#666666\">);<\/span> \u00a0 \u00a0\u00a0\u00a0 <span style=\"color:#666666\">}<\/span><\/p>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">4\u3001mapper\u6301\u4e45\u5c42&#xff08;\u6620\u5c04\u5c42&#xff09;\u4ee3\u7801&#xff1a;<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-server\/src\/main\/java\/com\/sky\/mapper\/EmployeeMapper.java<\/p>\n<p style=\"margin-left:0;margin-right:0\"><span style=\"color:#60a0b0\">\/**<\/span> \u00a0<span style=\"color:#60a0b0\">*<\/span> <span style=\"color:#60a0b0\">\u63d2\u5165\u5458\u5de5\u6570\u636e<\/span> <span style=\"color:#60a0b0\">\u00a0* <\/span><span style=\"color:#60a0b0\">&#064;param<\/span> <span style=\"color:#60a0b0\">employee<\/span> \u00a0<span style=\"color:#60a0b0\">*\/<\/span> <span style=\"color:#7d9029\">&#064;Insert<\/span><span style=\"color:#666666\">(<\/span><span style=\"color:#4070a0\">&#034;insert into employee(name, username, password, phone, sex, id_number, create_time, update_time, create_user, update_user) &#034;<\/span> <span style=\"color:#666666\">&#043;<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#4070a0\">&#034;values &#034;<\/span> <span style=\"color:#666666\">&#043;<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"color:#4070a0\">&#034; (#{name}, #{username}, #{password}, #{phone}, #{sex}, #{idNumber}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})&#034;<\/span><span style=\"color:#666666\">)<\/span> <span style=\"color:#902000\">void<\/span> <span style=\"color:#06287e\">insert<\/span><span style=\"color:#666666\">(<\/span>Employee employee<span style=\"color:#666666\">);<\/span><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6ce8\u610f&#xff1a;\u586b\u5199\u53c2\u6570\u524d\u9700\u8981\u94fe\u63a5\u6570\u636e\u5e93&#xff0c;\u5426\u5219\u65e0\u6cd5\u6b63\u5e38\u5411\u6570\u636e\u5e93\u63d2\u5165\u6570\u636e<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u65b9\u5f0f&#xff1a;\u9f20\u6807\u653e\u5728\u201cinsert into&#8230;\u201d\u5b57\u6bb5\u4e2d&#xff0c;alt&#043;enter&#xff0c;\u6253\u5f00\u5feb\u6377\u65b9\u5f0f\u680f&#xff0c;\u627e\u5230\u201clanguage injection&#8230;\u201d&#xff0c;\u9009\u62e9&#034;ID&#034;\u4e3aMySql<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd585d59.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"371\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd59fa4d.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"493\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd5b5dea.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\n<p style=\"margin-left:0;margin-right:0\">\u70b9\u51fb\u5de6\u4e0a\u89d2\u56fe\u6807&#xff0c;\u94fe\u63a5\u6570\u636e\u5e93&#xff0c;\u8f93\u5165\u4f60\u7684\u6570\u636e\u5e93\u8d26\u53f7\u5bc6\u7801&#xff0c;\u70b9\u51fb\u201cTest connection\u201d<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"414\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd5cd820.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u9009\u62e9\u9700\u8981\u94fe\u63a5\u7684\u6570\u636e\u5e93\u201csky_take_out\u201d,\u6700\u540e\u70b9\u51fbOK\u5373\u53ef<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"415\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd5e45cc.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"301\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd606b2a.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5efa\u8bae&#xff1a;\u4e0b\u8f7d\u4e00\u4e2aAI\u63d2\u4ef6&#xff0c;\u4fbf\u4e8e\u81ea\u52a8\u4e3a\u4f60\u8865\u5168\u4ee3\u7801&#xff0c;\u5982Fitten<\/p>\n<h4 style=\"background-color:transparent;margin-left:0px;margin-right:0px\"><span style=\"color:#0f4761\">5,\u3001\u529f\u80fd\u6d4b\u8bd5<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">&#xff08;1&#xff09;\u901a\u8fc7\u63a5\u53e3\u6587\u6863\u6d4b\u8bd5&#xff1a;\u540e\u7aef\u5f00\u53d1\u7ecf\u5e38\u4f7f\u7528&#xff0c;\u56e0\u4e3a\u524d\u7aef\u7f51\u9875\u53ef\u80fd\u672a\u5f00\u53d1<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u65b9\u6cd5\u4e00&#xff1a;\u4f7f\u7528keni4j\u81ea\u5e26\u7684\u63a5\u53e3\u6587\u6863\u7f51\u9875<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6253\u5f00\u9875\u9762\u82cd\u7a79\u5916\u5356\u9879\u76ee\u63a5\u53e3\u6587\u6863<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd61b4ea.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u76f4\u63a5\u70b9\u53d1\u9001&#xff0c;\u4f1a\u53d1\u73b0\u8fd4\u56de401&#xff08;\u672a\u6388\u6743&#xff09;&#xff0c;\u4e14\u540e\u7aef\u63a7\u5236\u53f0\u8fd4\u56de\u4e0b\u56fe\u5185\u5bb9<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd6318cd.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u539f\u56e0&#xff1a;\u53d1\u9001\u5185\u5bb9\u672a\u901a\u8fc7JWT\u6821\u9a8c&#xff0c;\u5373\u65e0\u5408\u6cd5\u4ee4\u724c&#xff0c;\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5148\u4ece\u201c\u5458\u5de5\u767b\u5f55\u201d\u6d4b\u8bd5&#xff0c;\u4ece\u8fd4\u56de\u5185\u5bb9\u53ef\u89c1&#xff0c;\u5176\u751f\u6210\u7684\u5408\u6cd5\u4ee4\u724c\u7801token&#xff08;token\u662f\u5f00\u53d1\u6587\u6863\u8981\u6c42\u7684\u7edf\u4e00\u4f7f\u7528\u7684JWT\u4ee4\u724c\u540d\u79f0&#xff09;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd648421.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u590d\u5236token\u7801-&gt;&#034;\u6587\u6863\u7ba1\u7406&#034;-&gt;&#034;\u5168\u5c40\u53c2\u6570\u8bbe\u7f6e&#034;-&gt;&#034;\u6dfb\u52a0\u53c2\u6570&#034;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd65e26f.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6ce8\u610f&#xff1a;\u5f53\u54cd\u5e94\u7801\u663e\u793a\u201c401\u201d\u65f6&#xff0c;\u5373\u672a\u6388\u6743&#xff0c;\u8bf4\u660e\u539f\u6765\u7684JWT token\u5df2\u7ecf\u8fc7\u671f\u9700\u8981\u66f4\u6362&#xff0c;\u91cd\u590d\u4e0a\u9762\u7684\u6b65\u9aa4\u5373\u53ef&#xff0c;\u66f4\u6362\u8bf7\u6c42\u5934&#xff08;header&#xff09;\u5373\u53ef<\/p>\n<p style=\"margin-left:0;margin-right:0\">\n<p style=\"margin-left:0;margin-right:0\">\u65b9\u6cd5\u4e8c&#xff1a;APIfox:\u6dfb\u52a0\u5168\u5c40\u53c2\u6570\u8bbe\u7f6e&#xff0c;\u6b65\u9aa4\u57fa\u672c\u4e00\u81f4<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd67417b.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u518d\u6b21\u6d4b\u8bd5\u662f&#xff0c;\u4f1a\u51fa\u73b0\u9ed8\u8ba4\u7684\u8bf7\u6c42\u5934\u90e8&#xff08;header&#xff09;,\u51fa\u73b0200&#xff0c;\u8868\u793a\u53d1\u9001\u6210\u529f<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"390\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd68ddc7.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">&#xff08;2&#xff09;\u524d\u540e\u7aef\u8054\u8c03&#xff1a;\u901a\u8fc7\u524d\u7aef\u7f51\u9875\u6d4b\u8bd5\u6dfb\u52a0\u5458\u5de5\u529f\u80fd\u662f\u5426\u5b8c\u5584<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"394\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd6a4766.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">&#xff08;3&#xff09;\u68c0\u67e5\u6570\u636e\u5e93\u6570\u636e\u662f\u5426\u6dfb\u52a0\u6210\u529f&#xff0c;\u5df2\u6210\u529f\u6dfb\u52a02\u30013\u30014&#xff0c;\u5bc6\u7801\u9ed8\u8ba4\u4e3a123456<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"388\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd6ba5a5.png\" width=\"700\" \/><\/p>\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">6\u3001\u5b8c\u5584\u4ee3\u7801<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-server\/src\/main\/java\/com\/sky\/handler\/GlobalExceptionHandler.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u8bf4\u660e&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"143\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141446-689c9dd6d8675.jpg\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5177\u4f53\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\/** \u00a0* \u6355\u83b7SQL\u5f02\u5e38 \u00a0* &#064;param ex \u00a0* &#064;return \u00a0*\/ &#064;ExceptionHandler public Result exceptionHandler(SQLIntegrityConstraintViolationException ex){ \u00a0\u00a0\u00a0 \/\/Duplicate entry &#039;zhangsan&#039; for key &#039;employee.idx_username&#039; \u00a0\u00a0\u00a0 String message &#061; ex.getMessage(); \u00a0\u00a0\u00a0 if (message.contains(&#034;Duplicate entry&#034;)){ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 String[] split &#061; message.split(&#034; &#034;); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 String username &#061; split[2]; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 String msg &#061; username &#043; MessageConstant.ALREADY_EXISTS;\/\/\u81ea\u5b9a\u4e49\u5e38\u91cf\u201c\u5df2\u5b58\u5728\u201d \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return Result.error(msg); \u00a0\u00a0\u00a0 }else { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return Result.error(MessageConstant.UNKNOWN_ERROR);\/\/\u81ea\u5b9a\u4e49\u5e38\u91cf\u201c\u672a\u77e5\u9519\u8bef\u201d \u00a0\u00a0\u00a0 } }<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"438\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141447-689c9dd716dc7.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\n<h4 style=\"margin-left:0;margin-right:0\"><span style=\"color:#0f4761\">7\u3001\u5b8c\u5584\u4ee3\u78012<\/span><\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u8bf4\u660e&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"65\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141447-689c9dd73f956.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6b65\u9aa4\u4e00&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5728\u6e90\u6587\u4ef6\u4e2d\u7684\u4e09\u4e2a\u4f4d\u7f6e\u6dfb\u52a0\u4e00\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e\u4e00&#xff1a;sky-server\/src\/main\/java\/com\/sky\/service\/impl\/EmployeeServiceImpl.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e\u4e8c&#xff1a;sky-server\/src\/main\/java\/com\/sky\/interceptor\/JwtTokenAdminInterceptor.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e\u4e09&#xff1a;sky-server\/src\/main\/java\/com\/sky\/controller\/admin\/EmployeeController.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6dfb\u52a0\u7684\u4ee3\u7801\u4e3a&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">System.out.println(&#034;\u5f53\u524d\u73b0\u6210\u7684ID\u4e3a&#xff1a;&#034; &#043; Thread.currentThread().getId());<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"70\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141447-689c9dd7519a1.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u793a\u610f\u56fe&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"320\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141447-689c9dd763897.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"310\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141447-689c9dd77ea29.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"320\" src=\"2025-08-13kemyl4kmkjn.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"174\" src=\"2025-08-13yvfs0z1hm3a.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u8bf4\u660e&#xff1a;\u7531\u63a7\u5236\u53f0\u8f93\u51fa\u53ef\u77e5&#xff0c;\u4e0a\u9762\u6b65\u9aa4\u9a8c\u8bc1\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u72ec\u7acb\u7684\u7ebf\u7a0b<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6b65\u9aa4\u4e8c&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6dfb\u52a0\u4ee3\u78011<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-server\/src\/main\/java\/com\/sky\/interceptor\/JwtTokenAdminInterceptor.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5177\u4f53\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\/\/\u8bbe\u7f6e\u5f53\u524d\u7ebf\u7a0b\u7684\u5458\u5de5id BaseContext.setCurrentId(empId);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u793a\u610f\u56fe&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"494\" src=\"2025-08-13wjkrfv10byj.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6dfb\u52a0\u4ee3\u78012<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f4d\u7f6e&#xff1a;sky-server\/src\/main\/java\/com\/sky\/service\/impl\/EmployeeServiceImpl.java<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5177\u4f53\u4ee3\u7801&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\/\/\u4fee\u6539\u4e3a\u83b7\u53d6\u5f53\u524d\u767b\u5f55\u4ebaID employee.setCreateUser(BaseContext.getCurrentId()); employee.setUpdateUser(BaseContext.getCurrentId());<\/p>\n<p style=\"margin-left:0;margin-right:0\">\/\/\u6539\u524d\u4ee3\u7801\u4e3a \/\/TODO \u540e\u671f\u9700\u8981\u4fee\u6539\u4e3a\u767b\u5f55\u4ebaID employee.setCreateUser(10L);\/\/\u8bbe\u7f6e\u4e00\u4e2a\u5e38\u91cf employee.setUpdateUser(10L);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u793a\u610f\u56fe&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"427\" src=\"2025-08-13zztdh4pejkn.png\" width=\"700\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u81f3\u6b64&#xff0c;\u65b0\u589e\u5458\u5de5\u529f\u80fd\u5b8c\u6210!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb22\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5916\u5356\u7cfb\u7edf\u540e\u53f0\u65b0\u589e\u5458\u5de5\u529f\u80fd\u7684\u4ee3\u7801\u5b9e\u73b0\u8fc7\u7a0b\u3002\u4e3b\u8981\u5305\u62ec\u63a7\u5236\u5c42\u63a5\u6536JSON\u6570\u636e\u7684@PostMapping\u63a5\u53e3\u3001\u670d\u52a1\u5c42\u4f7f\u7528BeanUtils.copyProperties\u8fdb\u884c\u5bf9\u8c61\u5c5e\u6027\u62f7\u8d1d\u3001\u8bbe\u7f6e\u9ed8\u8ba4\u5bc6\u7801\u548c\u72b6\u6001\u5e38\u91cf\u3001\u4ee5\u53ca\u901a\u8fc7ThreadLocal\u5b9e\u73b0\u7ebf\u7a0b\u5b89\u5168\u7684\u5f53\u524d\u7528\u6237ID\u83b7\u53d6\u3002\u540c\u65f6\u4ecb\u7ecd\u4e86\u4f7f\u7528\u63a5\u53e3\u6587\u6863\u6d4b\u8bd5\u548c\u524d\u540e\u7aef\u8054\u8c03\u7684\u4e24\u79cd\u6d4b\u8bd5\u65b9\u6cd5\uff0c\u5e76\u89e3\u51b3\u4e86JWT\u4ee4\u724c\u9a8c\u8bc1\u548cSQL\u552f\u4e00\u7ea6\u675f\u5f02\u5e38\u5904\u7406\u95ee\u9898\u3002\u6700\u7ec8\u5b9e\u73b0\u4e86\u5305\u542bMD5\u52a0\u5bc6\u9ed8\u8ba4\u5bc6\u7801\u3001\u81ea\u52a8\u8bb0\u5f55\u64cd\u4f5c\u7528\u6237\u548c\u521b\u5efa\u65f6\u95f4\u7b49\u5b8c\u6574\u529f\u80fd\u7684\u65b0\u589e\u5458\u5de5\u6a21\u5757\u3002<\/p>\n","protected":false},"author":2,"featured_media":55410,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[882,99,114,98,292,190,4156,2139,5698],"topic":[],"class_list":["post-55430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-idea","tag-java","tag-mysql","tag-spring-boot","tag-292","tag-190","tag-4156","tag-2139","tag-5698"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \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\/55430.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb22\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5916\u5356\u7cfb\u7edf\u540e\u53f0\u65b0\u589e\u5458\u5de5\u529f\u80fd\u7684\u4ee3\u7801\u5b9e\u73b0\u8fc7\u7a0b\u3002\u4e3b\u8981\u5305\u62ec\u63a7\u5236\u5c42\u63a5\u6536JSON\u6570\u636e\u7684@PostMapping\u63a5\u53e3\u3001\u670d\u52a1\u5c42\u4f7f\u7528BeanUtils.copyProperties\u8fdb\u884c\u5bf9\u8c61\u5c5e\u6027\u62f7\u8d1d\u3001\u8bbe\u7f6e\u9ed8\u8ba4\u5bc6\u7801\u548c\u72b6\u6001\u5e38\u91cf\u3001\u4ee5\u53ca\u901a\u8fc7ThreadLocal\u5b9e\u73b0\u7ebf\u7a0b\u5b89\u5168\u7684\u5f53\u524d\u7528\u6237ID\u83b7\u53d6\u3002\u540c\u65f6\u4ecb\u7ecd\u4e86\u4f7f\u7528\u63a5\u53e3\u6587\u6863\u6d4b\u8bd5\u548c\u524d\u540e\u7aef\u8054\u8c03\u7684\u4e24\u79cd\u6d4b\u8bd5\u65b9\u6cd5\uff0c\u5e76\u89e3\u51b3\u4e86JWT\u4ee4\u724c\u9a8c\u8bc1\u548cSQL\u552f\u4e00\u7ea6\u675f\u5f02\u5e38\u5904\u7406\u95ee\u9898\u3002\u6700\u7ec8\u5b9e\u73b0\u4e86\u5305\u542bMD5\u52a0\u5bc6\u9ed8\u8ba4\u5bc6\u7801\u3001\u81ea\u52a8\u8bb0\u5f55\u64cd\u4f5c\u7528\u6237\u548c\u521b\u5efa\u65f6\u95f4\u7b49\u5b8c\u6574\u529f\u80fd\u7684\u65b0\u589e\u5458\u5de5\u6a21\u5757\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55430.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T14:14:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd585d59.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\/55430.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55430.html\",\"name\":\"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T14:14:48+00:00\",\"dateModified\":\"2025-08-13T14:14:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55430.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55430.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55430.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd\"}]},{\"@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":"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \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\/55430.html","og_locale":"zh_CN","og_type":"article","og_title":"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb22\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5916\u5356\u7cfb\u7edf\u540e\u53f0\u65b0\u589e\u5458\u5de5\u529f\u80fd\u7684\u4ee3\u7801\u5b9e\u73b0\u8fc7\u7a0b\u3002\u4e3b\u8981\u5305\u62ec\u63a7\u5236\u5c42\u63a5\u6536JSON\u6570\u636e\u7684@PostMapping\u63a5\u53e3\u3001\u670d\u52a1\u5c42\u4f7f\u7528BeanUtils.copyProperties\u8fdb\u884c\u5bf9\u8c61\u5c5e\u6027\u62f7\u8d1d\u3001\u8bbe\u7f6e\u9ed8\u8ba4\u5bc6\u7801\u548c\u72b6\u6001\u5e38\u91cf\u3001\u4ee5\u53ca\u901a\u8fc7ThreadLocal\u5b9e\u73b0\u7ebf\u7a0b\u5b89\u5168\u7684\u5f53\u524d\u7528\u6237ID\u83b7\u53d6\u3002\u540c\u65f6\u4ecb\u7ecd\u4e86\u4f7f\u7528\u63a5\u53e3\u6587\u6863\u6d4b\u8bd5\u548c\u524d\u540e\u7aef\u8054\u8c03\u7684\u4e24\u79cd\u6d4b\u8bd5\u65b9\u6cd5\uff0c\u5e76\u89e3\u51b3\u4e86JWT\u4ee4\u724c\u9a8c\u8bc1\u548cSQL\u552f\u4e00\u7ea6\u675f\u5f02\u5e38\u5904\u7406\u95ee\u9898\u3002\u6700\u7ec8\u5b9e\u73b0\u4e86\u5305\u542bMD5\u52a0\u5bc6\u9ed8\u8ba4\u5bc6\u7801\u3001\u81ea\u52a8\u8bb0\u5f55\u64cd\u4f5c\u7528\u6237\u548c\u521b\u5efa\u65f6\u95f4\u7b49\u5b8c\u6574\u529f\u80fd\u7684\u65b0\u589e\u5458\u5de5\u6a21\u5757\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55430.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T14:14:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813141445-689c9dd585d59.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\/55430.html","url":"https:\/\/www.wsisp.com\/helps\/55430.html","name":"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T14:14:48+00:00","dateModified":"2025-08-13T14:14:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55430.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55430.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55430.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u82cd\u7a79\u5916\u5356\u9879\u76ee\u5b9e\u6218\uff08\u65e5\u8bb0\u4e09\uff09-\u8bb0\u5f55\u5b9e\u6218\u6559\u7a0b\u53ca\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5-\u529f\u80fd\u4ee3\u7801\u5b8c\u5584\uff081\uff09\u65b0\u589e\u5458\u5de5\u529f\u80fd"}]},{"@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\/55430","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=55430"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55430\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/55410"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55430"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}