{"id":8293,"date":"2025-04-18T16:29:47","date_gmt":"2025-04-18T08:29:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/8293.html"},"modified":"2025-04-18T16:29:47","modified_gmt":"2025-04-18T08:29:47","slug":"%e8%8b%a5%e4%be%9d%e6%a1%86%e6%9e%b6%e7%af%87-%e8%8b%a5%e4%be%9d%e9%9b%86%e6%88%90-x-file-storage-%e6%a1%86%e6%9e%b6%ef%bc%88%e5%ae%9e%e7%8e%b0%e5%9b%be%e7%89%87%e4%b8%8a%e4%bc%a0%e9%98%bf%e9%87%8c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/8293.html","title":{"rendered":"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09"},"content":{"rendered":"<p>&#x1f525;\u535a\u5ba2\u4e3b\u9875&#xff1a;\u00a0\u3010\u5c0f\u6273_-CSDN\u535a\u5ba2\u3011 \u2764\u611f\u8c22\u5927\u5bb6\u70b9\u8d5e&#x1f44d;\u6536\u85cf\u2b50\u8bc4\u8bba\u270d<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"400\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082942-68020d76b80b1.png\" width=\"459\" \/><\/p>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7738dcd.gif\" \/><\/p>\n<p id=\"main-toc\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.0%20%E5%AE%9E%E7%8E%B0%E4%BD%BF%E7%94%A8%20Excel%20%E6%96%87%E4%BB%B6%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5-toc\" style=\"margin-left:0px\">\u00a0 \u00a0 \u00a0 \u00a0 1.0 \u5b9e\u73b0\u4f7f\u7528 Excel \u6587\u4ef6\u6279\u91cf\u5bfc\u5165<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.1%20%E5%AF%BC%E5%85%A5%E5%8A%9F%E8%83%BD%E7%9A%84%E5%89%8D%E7%AB%AF%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 1.1 \u5bfc\u5165\u529f\u80fd\u7684\u524d\u7aef\u5177\u4f53\u5b9e\u73b0<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.2%20%E5%AF%BC%E5%85%A5%E5%8A%9F%E8%83%BD%E7%9A%84%E5%90%8E%E7%AB%AF%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 1.2 \u5bfc\u5165\u529f\u80fd\u7684\u540e\u7aef\u5177\u4f53\u5b9e\u73b0<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.3%20%E4%BD%BF%E7%94%A8%20EasyExcel%20%E6%A1%86%E6%9E%B6%E5%AE%9E%E7%8E%B0%20Excel%20%E8%AF%BB%E3%80%81%E5%86%99%E5%8A%9F%E8%83%BD-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 1.3 \u4f7f\u7528 EasyExcel \u6846\u67b6\u5b9e\u73b0 Excel \u8bfb\u3001\u5199\u529f\u80fd<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.4%20%E5%B0%86%20Easy%20Excel%20%E9%9B%86%E6%88%90%E5%88%B0%E8%8B%A5%E4%BE%9D%E6%A1%86%E6%9E%B6%E4%B8%AD-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 1.4 \u5c06 Easy Excel \u96c6\u6210\u5230\u82e5\u4f9d\u6846\u67b6\u4e2d<\/p>\n<p id=\"%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A02.0%20%E9%98%BF%E9%87%8C%E4%BA%91%20OSS%20%E6%A6%82%E8%BF%B0-toc\" style=\"margin-left:0px\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.0 \u963f\u91cc\u4e91 OSS \u6982\u8ff0<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%202.1%20%E4%BD%BF%E7%94%A8%E9%98%BF%E9%87%8C%E4%BA%91%20OSS%20%E5%85%B7%E4%BD%93%E8%BF%87%E7%A8%8B-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 2.1 \u4f7f\u7528\u963f\u91cc\u4e91 OSS \u5177\u4f53\u8fc7\u7a0b<\/p>\n<p id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%202.2%20%E5%B0%86%20X-File-Storage%20%E9%9B%86%E6%88%90%E5%88%B0%E8%8B%A5%E4%BE%9D%E6%A1%86%E6%9E%B6%E4%B8%AD-toc\" style=\"margin-left:40px\">\u00a0 \u00a0 \u00a0 \u00a0 2.2 \u5c06 X-File-Storage \u96c6\u6210\u5230\u82e5\u4f9d\u6846\u67b6\u4e2d<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.0%20%E5%AE%9E%E7%8E%B0%E4%BD%BF%E7%94%A8%20Excel%20%E6%96%87%E4%BB%B6%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5\">\u00a0 \u00a0 \u00a0 \u00a0 1.0 \u5b9e\u73b0\u4f7f\u7528 Excel \u6587\u4ef6\u6279\u91cf\u5bfc\u5165<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528\u82e5\u4f9d\u6846\u67b6\u5b9e\u73b0\u4e86 CRUD \u4e4b\u540e&#xff0c;\u82e5\u4f9d\u4f1a\u81ea\u52a8\u5b9e\u73b0\u5bfc\u51fa\u529f\u80fd&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"236\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7741529.png\" width=\"910\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5c06\u5f53\u524d\u9875\u9762\u6240\u5c55\u793a\u7684\u4fe1\u606f&#xff0c;\u4ee5 Excel \u7684\u5f62\u5f0f\u5bfc\u5165\u5230\u672c\u5730\u4e2d&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"211\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7754d05.png\" width=\"496\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5bfc\u51fa\u529f\u80fd\u82e5\u4f9d\u7531\u82e5\u4f9d\u6846\u67b6\u5b9e\u73b0\u7684&#xff0c;\u5bf9\u4e8e\u5bfc\u5165\u529f\u80fd&#xff0c;\u82e5\u4f9d\u6846\u67b6\u6ca1\u6709\u5b9e\u73b0\u8be5\u529f\u80fd\u3002<\/p>\n<p>\u82e5\u4f9d\u6846\u67b6\u5b9e\u73b0\u5bfc\u51fa\u529f\u80fd&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;\u524d\u7aef\u4ee3\u7801&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"254\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7760736.png\" width=\"656\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u9996\u5148\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6309\u94ae&#xff0c;\u5173\u8054\u7740 handleExport \u65b9\u6cd5&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"174\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d776d02e.png\" width=\"564\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2&#xff09;\u540e\u7aef\u4ee3\u7801&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"386\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7778221.png\" width=\"669\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5728 Controller \u5c42\u4e2d&#xff0c;\u8c03\u7528\u63a5\u53e3\u83b7\u53d6\u5230 list \u9700\u8981\u5bfc\u51fa\u7684\u6570\u636e&#xff0c;\u901a\u8fc7 ExcelUtil \u5de5\u5177\u7c7b&#xff0c;\u8c03\u7528\u8be5\u5de5\u5177\u7c7b\u7684 exportExcel() \u65b9\u6cd5&#xff0c;\u6765\u5c06\u6570\u636e\u8fdb\u884c\u5bfc\u51fa\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Sku \u662f\u4e00\u4e2a\u6839\u636e\u4e1a\u52a1\u9700\u8981\u751f\u6210\u7684\u4e00\u4e2a\u5b9e\u4f53\u7c7b&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"780\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7787e0c.png\" width=\"566\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u901a\u8fc7 &#064;Excel \u6ce8\u89e3\u6765\u5b9e\u73b0\u5b9e\u4f53\u7c7b\u4e0e Excel \u8868\u683c\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6620\u5c04\u3002<\/p>\n<\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.1%20%E5%AF%BC%E5%85%A5%E5%8A%9F%E8%83%BD%E7%9A%84%E5%89%8D%E7%AB%AF%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0\">\u00a0 \u00a0 \u00a0 \u00a0 1.1 \u5bfc\u5165\u529f\u80fd\u7684\u524d\u7aef\u5177\u4f53\u5b9e\u73b0<\/h3>\n<p>\u6839\u636e\u4e1a\u52a1\u9700\u8981\u5b9e\u73b0&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"216\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d7799f99.png\" width=\"439\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;\u9996\u5148\u9700\u8981\u5b9a\u4e49\u4e00\u4e2a\u6309\u94ae&#xff0c;\u70b9\u51fb\u4e4b\u540e&#xff0c;\u5f39\u51fa\u5bf9\u8bdd\u6846&#xff1a;<\/p>\n<p>       &lt;el-col :span&#061;&#034;1.5&#034;&gt;<br \/>\n        &lt;el-button<br \/>\n          type&#061;&#034;warning&#034;<br \/>\n          plain<br \/>\n          icon&#061;&#034;upload&#034;<br \/>\n          &#064;click&#061;&#034;handleImport&#034;<br \/>\n          v-hasPermi&#061;&#034;[&#039;manage:sku:add&#039;]&#034;<br \/>\n        &gt;\u5bfc\u5165&lt;\/el-button&gt;<br \/>\n      &lt;\/el-col&gt; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u8be5\u6309\u94ae\u5173\u8054\u7740 handleImport \u7684\u65b9\u6cd5&#xff0c;\u5f53\u89e6\u53d1\u70b9\u51fb\u4e8b\u4ef6\u4e4b\u4e4b\u540e&#xff0c;\u5f39\u51fa\u5bf9\u8bdd\u6846&#xff1a;<\/p>\n<p> const excelOpen &#061; ref(false);<br \/>\nfunction handleImport(){<br \/>\n  excelOpen.value &#061; true;<\/p>\n<p>} <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2&#xff09;\u5bf9\u8bdd\u6846\u7684\u5185\u5bb9&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u6839\u636e Element \u5b98\u7f51\u53c2\u8003\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd&#xff1a;Upload \u4e0a\u4f20 | Element Plus<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"506\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d77a6730.png\" width=\"1200\" \/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728\u5bf9\u8bdd\u6846\u4e2d\u63d2\u5165\u6587\u4ef6\u4e0a\u4f20\u7684\u529f\u80fd&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528\u4e86 el-dialog \u7ec4\u4ef6\u6765\u521b\u5efa\u4e00\u4e2a\u5bf9\u8bdd\u6846&#xff0c;\u7528\u4e8e\u5bfc\u5165\u6570\u636e\u3002\u5bf9\u8bdd\u6846\u5185\u5d4c\u4e86\u4e00\u4e2a el-upload \u7ec4\u4ef6&#xff0c;\u7528\u4e8e\u6587\u4ef6\u4e0a\u4f20\u3002<\/p>\n<p>     &lt;!&#8211; \u6570\u636e\u5bfc\u5165\u5bf9\u8bdd\u6846 &#8211;&gt;<br \/>\n    &lt;el-dialog title&#061;&#034;\u5bfc\u5165\u6570\u636e&#034; v-model&#061;&#034;excelOpen&#034; width&#061;&#034;400px&#034; append-to-body&gt;<br \/>\n        &lt;el-upload<br \/>\n          ref&#061;&#034;uploadRef&#034;<br \/>\n          class&#061;&#034;upload-demo&#034;<br \/>\n          :action&#061;&#034;uploadExcelUrl&#034;<br \/>\n          :headers&#061;&#034;headers&#034;<br \/>\n          :on-success&#061;&#034;handleUploadSuccess&#034;<br \/>\n          :on-error&#061;&#034;handleUploadError&#034;<br \/>\n          :before-upload&#061;&#034;handleBeforeUpload&#034;<br \/>\n          :limit&#061;&#034;1&#034;<br \/>\n          :auto-upload&#061;&#034;false&#034;<br \/>\n            &gt;<br \/>\n          &lt;template #trigger&gt;<br \/>\n            &lt;el-button type&#061;&#034;primary&#034;&gt;\u4e0a\u4f20\u6587\u4ef6&lt;\/el-button&gt;<br \/>\n          &lt;\/template&gt;<\/p>\n<p>          &lt;el-button class&#061;&#034;ml-3&#034; type&#061;&#034;success&#034; &#064;click&#061;&#034;submitUpload&#034;&gt;<br \/>\n            \u4e0a\u4f20<br \/>\n          &lt;\/el-button&gt;<\/p>\n<p>          &lt;template #tip&gt;<br \/>\n            &lt;div class&#061;&#034;el-upload__tip&#034;&gt;<br \/>\n              \u4e0a\u4f20\u6587\u4ef6\u4ec5\u652f\u6301&#xff0c;xls\/xlsx\u683c\u5f0f&#xff0c;\u6587\u4ef6\u5927\u5c0f\u4e0d\u5f97\u8d85\u8fc71M<br \/>\n            &lt;\/div&gt;<br \/>\n          &lt;\/template&gt;<br \/>\n        &lt;\/el-upload&gt;<br \/>\n    &lt;\/el-dialog&gt; <\/p>\n<p>\u5bf9\u5e94\u7684 JS \u4ee3\u7801&#xff1a;\u00a0<\/p>\n<p> const uploadRef &#061; ref({});<br \/>\nfunction submitUpload(){<br \/>\n  uploadRef.value.submit();<br \/>\n} <\/p>\n<p>\u6807\u7b7e\u4e2d\u5c5e\u6027\u89e3\u6790&#xff1a;<\/p>\n<p><span style=\"color:#fe2c24\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8211; v-model&#061;&#034;excelOpen&#034;: \u63a7\u5236\u5bf9\u8bdd\u6846\u7684\u663e\u793a\u4e0e\u9690\u85cf\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :action&#061;&#034;uploadExcelUrl&#034;: \u6587\u4ef6\u4e0a\u4f20\u7684\u76ee\u6807 URL\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :headers&#061;&#034;headers&#034;: \u4e0a\u4f20\u8bf7\u6c42\u7684\u5934\u90e8\u4fe1\u606f\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :on-success&#061;&#034;handleUploadSuccess&#034;: \u6587\u4ef6\u4e0a\u4f20\u6210\u529f\u540e\u7684\u56de\u8c03\u51fd\u6570\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :on-error&#061;&#034;handleUploadError&#034;: \u6587\u4ef6\u4e0a\u4f20\u5931\u8d25\u540e\u7684\u56de\u8c03\u51fd\u6570\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :before-upload&#061;&#034;handleBeforeUpload&#034;: \u6587\u4ef6\u4e0a\u4f20\u524d\u7684\u94a9\u5b50\u51fd\u6570&#xff0c;\u53ef\u4ee5\u7528\u6765\u505a\u6587\u4ef6\u6821\u9a8c\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :limit&#061;&#034;1&#034;: \u9650\u5236\u4e00\u6b21\u53ea\u80fd\u4e0a\u4f20\u4e00\u4e2a\u6587\u4ef6\u3002 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; :auto-upload&#061;&#034;false&#034;: \u7981\u7528\u81ea\u52a8\u4e0a\u4f20&#xff0c;\u9700\u8981\u624b\u52a8\u89e6\u53d1\u4e0a\u4f20\u3002<\/span><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3&#xff09;\u524d\u7aef\u5b9e\u73b0\u5bfc\u5165\u529f\u80fd\u7684\u5b8c\u6574\u4ee3\u7801<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u57fa\u4e8e\u82e5\u4f9d\u6846\u67b6\u5b9e\u73b0\u7684\u524d\u7aef\u4ee3\u7801&#xff1a;<\/p>\n<p> &lt;!&#8211;  \u5bfc\u5165\u6309\u94ae&#8211;&gt;<br \/>\n&lt;el-col :span&#061;&#034;1.5&#034;&gt;<br \/>\n    &lt;el-button type&#061;&#034;warning&#034; plain icon&#061;&#034;Upload&#034; &#064;click&#061;&#034;handleExcelImport&#034; v-hasPermi&#061;&#034;[&#039;manage:sku:add&#039;]&#034;&gt;\u5bfc\u5165&lt;\/el-button&gt;<br \/>\n&lt;\/el-col&gt;<\/p>\n<p>&lt;!&#8211; \u6570\u636e\u5bfc\u5165\u5bf9\u8bdd\u6846 &#8211;&gt;<br \/>\n&lt;el-dialog title&#061;&#034;\u6570\u636e\u5bfc\u5165&#034; v-model&#061;&#034;excelOpen&#034; width&#061;&#034;400px&#034; append-to-body&gt;<br \/>\n  &lt;el-upload ref&#061;&#034;uploadRef&#034; class&#061;&#034;upload-demo&#034;<br \/>\n    :action&#061;&#034;uploadExcelUrl&#034;<br \/>\n    :headers&#061;&#034;headers&#034;<br \/>\n    :on-success&#061;&#034;handleUploadSuccess&#034;<br \/>\n    :on-error&#061;&#034;handleUploadError&#034;<br \/>\n    :before-upload&#061;&#034;handleBeforeUpload&#034;<br \/>\n    :limit&#061;&#034;1&#034;<br \/>\n    :auto-upload&#061;&#034;false&#034;&gt;<br \/>\n    &lt;template #trigger&gt;<br \/>\n      &lt;el-button type&#061;&#034;primary&#034;&gt;\u4e0a\u4f20\u6587\u4ef6&lt;\/el-button&gt;<br \/>\n    &lt;\/template&gt;<br \/>\n    &lt;el-button class&#061;&#034;ml-3&#034; type&#061;&#034;success&#034; &#064;click&#061;&#034;submitUpload&#034;&gt;<br \/>\n      \u4e0a\u4f20<br \/>\n    &lt;\/el-button&gt;<br \/>\n    &lt;template #tip&gt;<br \/>\n      &lt;div class&#061;&#034;el-upload__tip&#034;&gt;<br \/>\n        \u4e0a\u4f20\u6587\u4ef6\u4ec5\u652f\u6301&#xff0c;xls\/xlsx\u683c\u5f0f&#xff0c;\u6587\u4ef6\u5927\u5c0f\u4e0d\u5f97\u8d85\u8fc71M<br \/>\n      &lt;\/div&gt;<br \/>\n    &lt;\/template&gt;<br \/>\n  &lt;\/el-upload&gt;<br \/>\n&lt;\/el-dialog&gt;<\/p>\n<p>&lt;script setup name&#061;&#034;Sku&#034;&gt;<br \/>\nimport { getToken } from &#034;&#064;\/utils\/auth&#034;;<\/p>\n<p>\/* \u6253\u5f00\u6570\u636e\u5bfc\u5165\u5bf9\u8bdd\u6846 *\/<br \/>\nconst excelOpen &#061; ref(false);<br \/>\nfunction handleExcelImport() {<br \/>\n  excelOpen.value &#061; true;<br \/>\n}<\/p>\n<p>\/* \u4e0a\u4f20\u5730\u5740 *\/<br \/>\nconst uploadExcelUrl &#061; ref(import.meta.env.VITE_APP_BASE_API &#043; &#034;\/manage\/sku\/import&#034;); \/\/ \u4e0a\u4f20excel\u6587\u4ef6\u5730\u5740<br \/>\n\/* \u4e0a\u4f20\u8bf7\u6c42\u5934 *\/<br \/>\nconst headers &#061; ref({ Authorization: &#034;Bearer &#034; &#043; getToken() });<\/p>\n<p>\/* \u4e0a\u4f20excel *\/<br \/>\nconst uploadRef &#061; ref({});<br \/>\nfunction submitUpload() {<br \/>\n  uploadRef.value.submit()<br \/>\n}<\/p>\n<p>const props &#061; defineProps({<br \/>\n  modelValue: [String, Object, Array],<br \/>\n  \/\/ \u5927\u5c0f\u9650\u5236(MB)<br \/>\n  fileSize: {<br \/>\n    type: Number,<br \/>\n    default: 1,<br \/>\n  },<br \/>\n  \/\/ \u6587\u4ef6\u7c7b\u578b, \u4f8b\u5982[&#034;xls&#034;, &#034;xlsx&#034;]<br \/>\n  fileType: {<br \/>\n    type: Array,<br \/>\n    default: () &#061;&gt; [&#034;xls&#034;, &#034;xlsx&#034;],<br \/>\n  },<br \/>\n});<\/p>\n<p>\/\/ \u4e0a\u4f20\u524dloading\u52a0\u8f7d<br \/>\nfunction handleBeforeUpload(file) {<br \/>\n  let isExcel &#061; false;<br \/>\n  if (props.fileType.length) {<br \/>\n    let fileExtension &#061; &#034;&#034;;<br \/>\n    if (file.name.lastIndexOf(&#034;.&#034;) &gt; -1) {<br \/>\n      fileExtension &#061; file.name.slice(file.name.lastIndexOf(&#034;.&#034;) &#043; 1);<br \/>\n    }<br \/>\n    isExcel &#061; props.fileType.some(type &#061;&gt; {<br \/>\n      if (file.type.indexOf(type) &gt; -1) return true;<br \/>\n      if (fileExtension &amp;&amp; fileExtension.indexOf(type) &gt; -1) return true;<br \/>\n      return false;<br \/>\n    });<br \/>\n  }<br \/>\n  if (!isExcel) {<br \/>\n    proxy.$modal.msgError(<br \/>\n      &#096;\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e, \u8bf7\u4e0a\u4f20${props.fileType.join(&#034;\/&#034;)}\u683c\u5f0f\u6587\u4ef6!&#096;<br \/>\n    );<br \/>\n    return false;<br \/>\n  }<br \/>\n  if (props.fileSize) {<br \/>\n    const isLt &#061; file.size \/ 1024 \/ 1024 &lt; props.fileSize;<br \/>\n    if (!isLt) {<br \/>\n      proxy.$modal.msgError(&#096;\u4e0a\u4f20excel\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ${props.fileSize} MB!&#096;);<br \/>\n      return false;<br \/>\n    }<br \/>\n  }<br \/>\n  proxy.$modal.loading(&#034;\u6b63\u5728\u4e0a\u4f20excel&#xff0c;\u8bf7\u7a0d\u5019&#8230;&#034;);<br \/>\n}<\/p>\n<p>\/\/ \u4e0a\u4f20\u5931\u8d25<br \/>\nfunction handleUploadError() {<br \/>\n  proxy.$modal.msgError(&#034;\u4e0a\u4f20excel\u5931\u8d25&#034;);<br \/>\n  uploadRef.value.clearFiles();<br \/>\n  proxy.$modal.closeLoading();<br \/>\n}<\/p>\n<p>\/\/ \u4e0a\u4f20\u6210\u529f\u56de\u8c03<br \/>\nfunction handleUploadSuccess(res, file) {<br \/>\n  if (res.code &#061;&#061;&#061; 200) {<br \/>\n    proxy.$modal.msgSuccess(&#034;\u4e0a\u4f20excel\u6210\u529f&#034;);<br \/>\n    excelOpen.value &#061; false;<br \/>\n    getList();<br \/>\n  }else{<br \/>\n    proxy.$modal.msgError(&#034;res.msg&#034;);<br \/>\n  }<br \/>\n  uploadRef.value.clearFiles();<br \/>\n  proxy.$modal.closeLoading();<br \/>\n}<br \/>\n&lt;\/script&gt; <\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.2%20%E5%AF%BC%E5%85%A5%E5%8A%9F%E8%83%BD%E7%9A%84%E5%90%8E%E7%AB%AF%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0\">\u00a0 \u00a0 \u00a0 \u00a0 1.2 \u5bfc\u5165\u529f\u80fd\u7684\u540e\u7aef\u5177\u4f53\u5b9e\u73b0<\/h3>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"454\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d77d9d18.png\" width=\"752\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u4e0e\u5bfc\u51fa Excel \u529f\u80fd\u4e00\u6837&#xff0c;\u521b\u5efa\u4e86 ExcelUtil \u5bf9\u8c61&#xff0c;\u4f7f\u7528\u8be5\u5bf9\u8c61\u7684 importExcel() \u65b9\u6cd5&#xff0c;\u5c06\u6587\u4ef6\u6d41\u8fdb\u884c\u5bfc\u5165&#xff0c;\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e00\u4e2a List \u96c6\u5408\u6570\u636e&#xff0c;\u63a5\u4e0b\u6765\u53ef\u4ee5\u8fdb\u884c\u6279\u91cf\u63d2\u5165\u6570\u636e\u4e86\u3002<\/p>\n<\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.3%20%E4%BD%BF%E7%94%A8%20EasyExcel%20%E6%A1%86%E6%9E%B6%E5%AE%9E%E7%8E%B0%20Excel%20%E8%AF%BB%E3%80%81%E5%86%99%E5%8A%9F%E8%83%BD\">\u00a0 \u00a0 \u00a0 \u00a0 1.3 \u4f7f\u7528 EasyExcel \u6846\u67b6\u5b9e\u73b0 Excel \u8bfb\u3001\u5199\u529f\u80fd<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 EasyExcel \u5b98\u7f51&#xff1a;EasyExcel\u5b98\u65b9\u6587\u6863 &#8211; \u57fa\u4e8eJava\u7684Excel\u5904\u7406\u5de5\u5177 | Easy Excel \u5b98\u7f51<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u963f\u91cc\u5df4\u5df4\u5f00\u6e90\u7684\u6846\u67b6&#xff0c;\u5b83\u4ee5\u4f7f\u7528\u7b80\u5355\u3001\u529f\u80fd\u5f3a\u5927\u548c\u8282\u7701\u5185\u5b58\u800c\u8457\u79f0&#xff0c;\u7279\u522b\u9002\u5408\u4e8e\u9700\u8981\u8fdb\u884c\u5927\u91cf\u6570\u636e\u5bfc\u5165\u548c\u5bfc\u51fa\u7684\u573a\u666f\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"497\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082943-68020d77eaf8c.png\" width=\"1200\" \/><\/p>\n<p id=\"u068af552\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Java \u89e3\u6790\u3001\u751f\u6210 Excel \u6bd4\u8f83\u6709\u540d\u7684\u6846\u67b6\u6709 Apache poi\u3001jxl\u3002\u4f46\u4ed6\u4eec\u90fd\u5b58\u5728\u4e00\u4e2a\u4e25\u91cd\u7684\u95ee\u9898\u5c31\u662f\u975e\u5e38\u7684\u8017\u5185\u5b58&#xff0c;poi \u6709\u4e00\u5957 SAX \u6a21\u5f0f\u7684 API \u53ef\u4ee5\u4e00\u5b9a\u7a0b\u5ea6\u7684\u89e3\u51b3\u4e00\u4e9b\u5185\u5b58\u6ea2\u51fa\u7684\u95ee\u9898&#xff0c;\u4f46 POI \u8fd8\u662f\u6709\u4e00\u4e9b\u7f3a\u9677&#xff0c;\u6bd4\u5982 07 \u7248 Excel \u89e3\u538b\u7f29\u4ee5\u53ca\u89e3\u538b\u540e\u5b58\u50a8\u90fd\u662f\u5728\u5185\u5b58\u4e2d\u5b8c\u6210\u7684&#xff0c;\u5185\u5b58\u6d88\u8017\u4f9d\u7136\u5f88\u5927\u3002 easyexcel \u91cd\u5199\u4e86 poi \u5bf9 07 \u7248 Excel \u7684\u89e3\u6790&#xff0c;\u4e00\u4e2a 3M \u7684 excel \u7528 POI sax \u89e3\u6790\u4f9d\u7136\u9700\u8981 100M \u5de6\u53f3\u5185\u5b58&#xff0c;\u6539\u7528 easyexcel \u53ef\u4ee5\u964d\u4f4e\u5230 \u51e0M&#xff0c;\u5e76\u4e14\u518d\u5927\u7684 excel \u4e5f\u4e0d\u4f1a\u51fa\u73b0\u5185\u5b58\u6ea2\u51fa&#xff1b;03 \u7248\u4f9d\u8d56 POI \u7684 sax \u6a21\u5f0f&#xff0c;\u5728\u4e0a\u5c42\u505a\u4e86\u6a21\u578b\u8f6c\u6362\u7684\u5c01\u88c5&#xff0c;\u8ba9\u4f7f\u7528\u8005\u66f4\u52a0\u7b80\u5355\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%201.4%20%E5%B0%86%20Easy%20Excel%20%E9%9B%86%E6%88%90%E5%88%B0%E8%8B%A5%E4%BE%9D%E6%A1%86%E6%9E%B6%E4%B8%AD\">\u00a0 \u00a0 \u00a0 \u00a0 1.4 \u5c06 Easy Excel \u96c6\u6210\u5230\u82e5\u4f9d\u6846\u67b6\u4e2d<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;dkd-common\\\\pom.xml \u6a21\u5757\u6dfb\u52a0\u6574\u5408\u4f9d\u8d56&#xff1a;<\/p>\n<p> &lt;!&#8211;  excel\u5904\u7406\u5de5\u5177&#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;com.alibaba&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;easyexcel&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;4.0.1&lt;\/version&gt;<br \/>\n&lt;\/dependency&gt; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2&#xff09;\u5728 dkd-common\\\\ \u6a21\u5757\u7684 ExcelUtil.java \u65b0\u589e easyexcel \u5bfc\u51fa\u5bfc\u5165\u65b9\u6cd5&#xff1a;<\/p>\n<p> \/**<br \/>\n * \u5bf9excel\u8868\u5355\u9ed8\u8ba4\u7b2c\u4e00\u4e2a\u7d22\u5f15\u540d\u8f6c\u6362\u6210list&#xff08;EasyExcel&#xff09;<br \/>\n *<br \/>\n * &#064;param is \u8f93\u5165\u6d41<br \/>\n * &#064;return \u8f6c\u6362\u540e\u96c6\u5408<br \/>\n *\/<br \/>\npublic List&lt;T&gt; importEasyExcel(InputStream is) throws Exception<br \/>\n{<br \/>\nreturn EasyExcel.read(is).head(clazz).sheet().doReadSync();<br \/>\n}<\/p>\n<p>\/**<br \/>\n * \u5bf9list\u6570\u636e\u6e90\u5c06\u5176\u91cc\u9762\u7684\u6570\u636e\u5bfc\u5165\u5230excel\u8868\u5355&#xff08;EasyExcel&#xff09;<br \/>\n *<br \/>\n * &#064;param list \u5bfc\u51fa\u6570\u636e\u96c6\u5408<br \/>\n * &#064;param sheetName \u5de5\u4f5c\u8868\u7684\u540d\u79f0<br \/>\n * &#064;return \u7ed3\u679c<br \/>\n *\/<br \/>\npublic void exportEasyExcel(HttpServletResponse response, List&lt;T&gt; list, String sheetName)<br \/>\n{<br \/>\ntry<br \/>\n{<br \/>\nEasyExcel.write(response.getOutputStream(), clazz).sheet(sheetName).doWrite(list);<br \/>\n}<br \/>\ncatch (IOException e)<br \/>\n{<br \/>\nlog.error(&#034;\u5bfc\u51faEasyExcel\u5f02\u5e38{}&#034;, e.getMessage());<br \/>\n}<br \/>\n} <\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"656\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082944-68020d7845458.png\" width=\"1200\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"894\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082944-68020d788531c.png\" width=\"1049\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3&#xff09;\u5b9e\u4f53\u7c7b\u7684\u5c5e\u6027\u4e0a\u6dfb\u52a0\u00a0&#064;ExcelProperty \u6ce8\u89e3&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6dfb\u52a0\u5b8c &#064;ExcelPropety \u6ce8\u89e3\u4e4b\u540e&#xff0c;\u5b9e\u73b0\u5b9e\u4f53\u7c7b\u7684\u5c5e\u6027\u4e0e Excel \u8868\u683c\u5b57\u6bb5\u6620\u5c04\u3002\u8fd8\u9700\u8981\u5728\u5b9e\u4f53\u7c7b\u4e0a\u6dfb\u52a0\u6ce8\u89e3&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 &#8211; &#064;ExcelIgnoreUnannotated\/\/ \u6ce8\u89e3\u8868\u793a\u5728\u5bfc\u51faExcel\u65f6&#xff0c;\u5ffd\u7565\u6ca1\u6709\u88ab\u4efb\u4f55\u6ce8\u89e3\u6807\u8bb0\u7684\u5b57\u6bb5 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; &#064;ColumnWidth(16)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u5217\u7684\u5bbd\u5ea6 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; &#064;HeadRowHeight(14)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u8868\u5934\u884c\u7684\u9ad8\u5ea6 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; &#064;HeadFontStyle(fontHeightInPoints &#061; 11)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u8868\u5934\u7684\u5b57\u4f53\u6837\u5f0f<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff1a;<\/p>\n<p> package com.dkd.manage.domain;<\/p>\n<p>import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;<br \/>\nimport com.alibaba.excel.annotation.ExcelProperty;<br \/>\nimport com.alibaba.excel.annotation.write.style.ColumnWidth;<br \/>\nimport com.alibaba.excel.annotation.write.style.HeadFontStyle;<br \/>\nimport com.alibaba.excel.annotation.write.style.HeadRowHeight;<br \/>\nimport com.dkd.common.annotation.Excel;<br \/>\nimport com.dkd.common.core.domain.BaseEntity;<br \/>\nimport org.apache.commons.lang3.builder.ToStringBuilder;<br \/>\nimport org.apache.commons.lang3.builder.ToStringStyle;<\/p>\n<p>\/**<br \/>\n * \u5546\u54c1\u7ba1\u7406\u5bf9\u8c61 tb_sku<br \/>\n *<br \/>\n * &#064;author itheima<br \/>\n * &#064;date 2024-07-15<br \/>\n *\/<br \/>\n&#064;ExcelIgnoreUnannotated\/\/ \u6ce8\u89e3\u8868\u793a\u5728\u5bfc\u51faExcel\u65f6&#xff0c;\u5ffd\u7565\u6ca1\u6709\u88ab\u4efb\u4f55\u6ce8\u89e3\u6807\u8bb0\u7684\u5b57\u6bb5<br \/>\n&#064;ColumnWidth(16)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u5217\u7684\u5bbd\u5ea6<br \/>\n&#064;HeadRowHeight(14)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u8868\u5934\u884c\u7684\u9ad8\u5ea6<br \/>\n&#064;HeadFontStyle(fontHeightInPoints &#061; 11)\/\/ \u6ce8\u89e3\u7528\u4e8e\u8bbe\u7f6e\u8868\u5934\u7684\u5b57\u4f53\u6837\u5f0f<br \/>\npublic class Sku extends BaseEntity<br \/>\n{<br \/>\n    private static final long serialVersionUID &#061; 1L;<\/p>\n<p>    \/** \u4e3b\u952e *\/<br \/>\n    private Long skuId;<\/p>\n<p>    \/** \u5546\u54c1\u540d\u79f0 *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u5546\u54c1\u540d\u79f0&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u5546\u54c1\u540d\u79f0&#034;)<br \/>\n    private String skuName;<\/p>\n<p>    \/** \u5546\u54c1\u56fe\u7247 *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u5546\u54c1\u56fe\u7247&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u5546\u54c1\u56fe\u7247&#034;)<br \/>\n    private String skuImage;<\/p>\n<p>    \/** \u54c1\u724c *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u54c1\u724c&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u54c1\u724c&#034;)<br \/>\n    private String brandName;<\/p>\n<p>    \/** \u89c4\u683c(\u51c0\u542b\u91cf) *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u89c4\u683c(\u51c0\u542b\u91cf)&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u89c4\u683c(\u51c0\u542b\u91cf)&#034;)<br \/>\n    private String unit;<\/p>\n<p>    \/** \u5546\u54c1\u4ef7\u683c *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u5546\u54c1\u4ef7\u683c&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u5546\u54c1\u4ef7\u683c&#034;)<br \/>\n    private Long price;<\/p>\n<p>    \/** \u5546\u54c1\u7c7b\u578bId *\/<br \/>\n    &#064;Excel(name &#061; &#034;\u5546\u54c1\u7c7b\u578bId&#034;)<br \/>\n    &#064;ExcelProperty(&#034;\u5546\u54c1\u7c7b\u578bId&#034;)<br \/>\n    private Long classId;<\/p>\n<p>    \/** \u662f\u5426\u6253\u6298\u4fc3\u9500 *\/<br \/>\n    private Integer isDiscount;<\/p>\n<p>\/\/ \u5176\u4ed6\u7565&#8230;<br \/>\n} <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5b8c\u6210\u4e4b\u540e&#xff0c;\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86&#xff0c;\u901a\u8fc7\u521b\u5efa ExcelUtil \u5bf9\u8c61&#xff0c;\u8c03\u7528\u00a0importEasyExcel() \u65b9\u6cd5\u5b9e\u73b0\u5bfc\u5165\u529f\u80fd&#xff0c;\u8c03\u7528\u00a0exportEasyExcel() \u65b9\u6cd5\u5b9e\u73b0\u5bfc\u51fa\u529f\u80fd\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"815\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082944-68020d78dd411.png\" width=\"841\" \/><\/p>\n<p>\u5bfc\u51fa\u7ed3\u679c&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"411\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082945-68020d791addf.png\" width=\"906\" \/><\/p>\n<\/p>\n<h2 id=\"%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A02.0%20%E9%98%BF%E9%87%8C%E4%BA%91%20OSS%20%E6%A6%82%E8%BF%B0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.0 \u963f\u91cc\u4e91 OSS \u6982\u8ff0<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u963f\u91cc\u4e91\u5bf9\u8c61\u5b58\u50a8 OSS&#xff08;Object Storage Service&#xff09;&#xff0c;\u662f\u4e00\u6b3e\u6d77\u91cf\u3001\u5b89\u5168\u3001\u4f4e\u6210\u672c\u3001\u9ad8\u53ef\u9760\u7684\u4e91\u5b58\u50a8\u670d\u52a1\u3002\u4f7f\u7528 OSS&#xff0c;\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u968f\u65f6\u5b58\u50a8\u548c\u8c03\u7528\u5305\u62ec\u6587\u672c\u3001\u56fe\u7247\u3001\u97f3\u9891\u548c\u89c6\u9891\u7b49\u5728\u5185\u7684\u5404\u79cd\u6587\u4ef6\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"404\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082945-68020d7939d16.png\" width=\"937\" \/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528\u4e86\u963f\u91cc\u4e91 OSS \u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u4e4b\u540e&#xff0c;\u6211\u4eec\u7684\u9879\u76ee\u5f53\u4e2d\u5982\u679c\u6d89\u53ca\u5230\u6587\u4ef6\u4e0a\u4f20\u8fd9\u6837\u7684\u4e1a\u52a1&#xff0c;\u5728\u524d\u7aef\u8fdb\u884c\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bf7\u6c42\u5230\u670d\u52a1\u7aef\u65f6&#xff0c;\u5728\u670d\u52a1\u5668\u672c\u5730\u78c1\u76d8\u5f53\u4e2d\u5c31\u4e0d\u9700\u8981\u518d\u6765\u5b58\u50a8\u6587\u4ef6\u4e86\u3002\u6211\u4eec\u76f4\u63a5\u5c06\u63a5\u6536\u5230\u7684\u6587\u4ef6\u4e0a\u4f20\u5230 oss&#xff0c;\u7531 oss \u5e2e\u6211\u4eec\u5b58\u50a8\u548c\u7ba1\u7406&#xff0c;\u540c\u65f6\u963f\u91cc\u4e91\u7684 oss \u5b58\u50a8\u670d\u52a1\u8fd8\u4fdd\u969c\u4e86\u6211\u4eec\u6240\u5b58\u50a8\u5185\u5bb9\u7684\u5b89\u5168\u53ef\u9760\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"460\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082945-68020d795d779.png\" width=\"1200\" \/><\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%202.1%20%E4%BD%BF%E7%94%A8%E9%98%BF%E9%87%8C%E4%BA%91%20OSS%20%E5%85%B7%E4%BD%93%E8%BF%87%E7%A8%8B\">\u00a0 \u00a0 \u00a0 \u00a0 2.1 \u4f7f\u7528\u963f\u91cc\u4e91 OSS \u5177\u4f53\u8fc7\u7a0b<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;\u6ce8\u518c\u963f\u91cc\u4e91\u8d26\u6237&#xff08;\u6ce8\u518c\u5b8c\u6210\u540e\u9700\u8981\u5b9e\u540d\u8ba4\u8bc1&#xff09;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2&#xff09;\u6ce8\u518c\u5b8c\u8d26\u53f7\u4e4b\u540e&#xff0c;\u5c31\u53ef\u4ee5\u767b\u5f55\u963f\u91cc\u4e91<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3&#xff09;\u901a\u8fc7\u63a7\u5236\u53f0\u627e\u5230\u5bf9\u8c61\u5b58\u50a8 OSS \u670d\u52a1<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"811\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082945-68020d798e37e.png\" width=\"1192\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"606\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082945-68020d79ea50e.png\" width=\"1200\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 4&#xff09;\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u8bbf\u95ee&#xff0c;\u8fd8\u9700\u8981\u5f00\u901a\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1 OSS<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"292\" src=\"2025-04-18ps2ym1jpsgn.png\" width=\"1200\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 5&#xff09;\u5f00\u901a OSS \u670d\u52a1\u4e4b\u540e&#xff0c;\u5c31\u53ef\u4ee5\u8fdb\u5165\u5230\u963f\u91cc\u4e91\u5bf9\u8c61\u5b58\u50a8\u7684\u63a7\u5236\u53f0<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"880\" src=\"2025-04-184rinjl1mwhp.png\" width=\"1200\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 6&#xff09;\u70b9\u51fb\u5de6\u4fa7\u7684 &#034;Bucket\u5217\u8868&#034;&#xff0c;\u521b\u5efa\u4e00\u4e2aBucket<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"570\" src=\"2025-04-181eevutoycrs.png\" width=\"1200\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"826\" src=\"2025-04-18xhf1vc1gos2.png\" width=\"1166\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 7&#xff09;\u70b9\u51fb &#034;AccessKey\u7ba1\u7406&#034;&#xff0c;\u8fdb\u5165\u5230\u7ba1\u7406\u9875\u9762<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"524\" src=\"2025-04-18ba33osn1wg3.png\" width=\"860\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"296\" src=\"2025-04-18osqqdfasrlg.png\" width=\"1200\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"570\" src=\"2025-04-18ywhfvns55u3.png\" width=\"1075\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 8&#xff09;\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00CMD\u547d\u4ee4\u884c&#xff0c;\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff0c;\u914d\u7f6e\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf<\/p>\n<p> set OSS_ACCESS_KEY_ID&#061;LTAI5tXXXXXXXXXXXXXXXXXXXXM8TP<br \/>\nset OSS_ACCESS_KEY_SECRET&#061;UzMcJXXXXXXXXXXXXXXXXXXXXdabTNafi <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5c06\u4e0a\u8ff0\u7684ACCESS_KEY_ID \u4e0e ACCESS_KEY_SECRET \u7684\u503c\u4e00\u5b9a\u8981\u66ff\u6362\u6210\u81ea\u5df1\u7684 \u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff0c;\u8ba9\u66f4\u6539\u751f\u6548&#xff1a;<\/p>\n<p> setx OSS_ACCESS_KEY_ID &#034;%OSS_ACCESS_KEY_ID%&#034;<br \/>\nsetx OSS_ACCESS_KEY_SECRET &#034;%OSS_ACCESS_KEY_SECRET%&#034; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff0c;\u9a8c\u8bc1\u73af\u5883\u53d8\u91cf\u662f\u5426\u751f\u6548&#xff1a;<\/p>\n<p> echo %OSS_ACCESS_KEY_ID%<br \/>\necho %OSS_ACCESS_KEY_SECRET% <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u963f\u91cc\u4e91oss \u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u7684\u51c6\u5907\u5de5\u4f5c\u6211\u4eec\u5df2\u7ecf\u5b8c\u6210\u4e86&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u5b8c\u6210\u7b2c\u4e8c\u6b65\u64cd\u4f5c&#xff1a;\u53c2\u7167\u5b98\u65b9\u6240\u63d0\u4f9b\u7684sdk\u793a\u4f8b\u6765\u7f16\u5199\u5165\u95e8\u7a0b\u5e8f\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;\u9996\u5148\u6211\u4eec\u9700\u8981\u6765\u6253\u5f00\u963f\u91cc\u4e91OSS\u7684\u5b98\u65b9\u6587\u6863&#xff0c;\u5728\u5b98\u65b9\u6587\u6863\u4e2d\u627e\u5230 SDK \u7684\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"438\" src=\"2025-04-184rcievv4r1b.png\" width=\"937\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2&#xff09;\u6587\u6863\u9605\u8bfb&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"885\" src=\"2025-04-184uux2jopqas.png\" width=\"1200\" \/><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"542\" src=\"2025-04-185tcm5yozrnc.png\" width=\"937\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3&#xff09;\u53c2\u7167\u5b98\u65b9\u63d0\u4f9b\u7684SDK&#xff0c;\u6539\u9020\u4e00\u4e0b&#xff0c;\u5373\u53ef\u5b9e\u73b0\u6587\u4ef6\u4e0a\u4f20\u529f\u80fd&#xff1a;<\/p>\n<p> package com.dkd.common.test;<\/p>\n<p>import com.aliyun.oss.ClientException;<br \/>\nimport com.aliyun.oss.OSS;<br \/>\nimport com.aliyun.oss.common.auth.*;<br \/>\nimport com.aliyun.oss.OSSClientBuilder;<br \/>\nimport com.aliyun.oss.OSSException;<br \/>\nimport com.aliyun.oss.model.PutObjectRequest;<br \/>\nimport com.aliyun.oss.model.PutObjectResult;<br \/>\nimport java.io.FileInputStream;<br \/>\nimport java.io.InputStream;<\/p>\n<p>public class Demo {<\/p>\n<p>    public static void main(String[] args) throws Exception {<br \/>\n        \/\/ Endpoint\u4ee5\u534e\u4e1c1&#xff08;\u676d\u5dde&#xff09;\u4e3a\u4f8b&#xff0c;\u5176\u5b83Region\u8bf7\u6309\u5b9e\u9645\u60c5\u51b5\u586b\u5199\u3002<br \/>\n        String endpoint &#061; &#034;https:\/\/oss-cn-beijing.aliyuncs.com&#034;;<br \/>\n        \/\/ \u4ece\u73af\u5883\u53d8\u91cf\u4e2d\u83b7\u53d6\u8bbf\u95ee\u51ed\u8bc1\u3002\u8fd0\u884c\u672c\u4ee3\u7801\u793a\u4f8b\u4e4b\u524d&#xff0c;\u8bf7\u786e\u4fdd\u5df2\u8bbe\u7f6e\u73af\u5883\u53d8\u91cfOSS_ACCESS_KEY_ID\u548cOSS_ACCESS_KEY_SECRET\u3002<br \/>\n        EnvironmentVariableCredentialsProvider credentialsProvider &#061; CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();<br \/>\n        \/\/ \u586b\u5199Bucket\u540d\u79f0&#xff0c;\u4f8b\u5982examplebucket\u3002<br \/>\n        String bucketName &#061; &#034;dkd-itheima&#034;;<br \/>\n        \/\/ \u586b\u5199Object\u5b8c\u6574\u8def\u5f84&#xff0c;\u5b8c\u6574\u8def\u5f84\u4e2d\u4e0d\u80fd\u5305\u542bBucket\u540d\u79f0&#xff0c;\u4f8b\u5982exampledir\/exampleobject.txt\u3002<br \/>\n        String objectName &#061; &#034;gao.png&#034;;<br \/>\n        \/\/ \u586b\u5199\u672c\u5730\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84&#xff0c;\u4f8b\u5982D:\\\\\\\\localpath\\\\\\\\examplefile.txt\u3002<br \/>\n        \/\/ \u5982\u679c\u672a\u6307\u5b9a\u672c\u5730\u8def\u5f84&#xff0c;\u5219\u9ed8\u8ba4\u4ece\u793a\u4f8b\u7a0b\u5e8f\u6240\u5c5e\u9879\u76ee\u5bf9\u5e94\u672c\u5730\u8def\u5f84\u4e2d\u4e0a\u4f20\u6587\u4ef6\u6d41\u3002<br \/>\n        String filePath&#061; &#034;E:\\\\\\\\temp\\\\\\\\upload\\\\\\\\gao.png&#034;;<\/p>\n<p>        \/\/ \u521b\u5efaOSSClient\u5b9e\u4f8b\u3002<br \/>\n        OSS ossClient &#061; new OSSClientBuilder().build(endpoint, credentialsProvider);<\/p>\n<p>        try {<br \/>\n            InputStream inputStream &#061; new FileInputStream(filePath);<br \/>\n            \/\/ \u521b\u5efaPutObjectRequest\u5bf9\u8c61\u3002<br \/>\n            PutObjectRequest putObjectRequest &#061; new PutObjectRequest(bucketName, objectName, inputStream);<br \/>\n            \/\/ \u521b\u5efaPutObject\u8bf7\u6c42\u3002<br \/>\n            PutObjectResult result &#061; ossClient.putObject(putObjectRequest);<br \/>\n        } catch (OSSException oe) {<br \/>\n            System.out.println(&#034;Caught an OSSException, which means your request made it to OSS, &#034;<br \/>\n                    &#043; &#034;but was rejected with an error response for some reason.&#034;);<br \/>\n            System.out.println(&#034;Error Message:&#034; &#043; oe.getErrorMessage());<br \/>\n            System.out.println(&#034;Error Code:&#034; &#043; oe.getErrorCode());<br \/>\n            System.out.println(&#034;Request ID:&#034; &#043; oe.getRequestId());<br \/>\n            System.out.println(&#034;Host ID:&#034; &#043; oe.getHostId());<br \/>\n        } catch (ClientException ce) {<br \/>\n            System.out.println(&#034;Caught an ClientException, which means the client encountered &#034;<br \/>\n                    &#043; &#034;a serious internal problem while trying to communicate with OSS, &#034;<br \/>\n                    &#043; &#034;such as not being able to access the network.&#034;);<br \/>\n            System.out.println(&#034;Error Message:&#034; &#043; ce.getMessage());<br \/>\n        } finally {<br \/>\n            if (ossClient !&#061; null) {<br \/>\n                ossClient.shutdown();<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<p id=\"uc1f94051\">\u5728\u4ee5\u4e0a\u4ee3\u7801\u4e2d&#xff0c;\u9700\u8981\u66ff\u6362\u7684\u5185\u5bb9\u4e3a&#xff1a;<\/p>\n<p><span style=\"color:#fe2c24\">\u00a0 \u00a0 \u00a0 \u00a0 &#8211; endpoint&#xff1a;\u963f\u91cc\u4e91OSS\u4e2d\u7684bucket\u5bf9\u5e94\u7684\u57df\u540d<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u00a0 \u00a0 \u00a0 \u00a0 &#8211; bucketName&#xff1a;Bucket\u540d\u79f0<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u00a0 \u00a0 \u00a0 \u00a0 &#8211; objectName&#xff1a;\u5bf9\u8c61\u540d\u79f0&#xff0c;\u5728Bucket\u4e2d\u5b58\u50a8\u7684\u5bf9\u8c61\u7684\u540d\u79f0<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u00a0 \u00a0 \u00a0 \u00a0 &#8211; filePath&#xff1a;\u6587\u4ef6\u8def\u5f84<\/span><\/p>\n<p id=\"u2823384a\">\u8fd0\u884c\u4ee5\u4e0a\u7a0b\u5e8f\u540e&#xff0c;\u4f1a\u628a\u672c\u5730\u7684\u6587\u4ef6\u4e0a\u4f20\u5230\u963f\u91cc\u4e91OSS\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<\/p>\n<h3 id=\"%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%202.2%20%E5%B0%86%20X-File-Storage%20%E9%9B%86%E6%88%90%E5%88%B0%E8%8B%A5%E4%BE%9D%E6%A1%86%E6%9E%B6%E4%B8%AD\">\u00a0 \u00a0 \u00a0 \u00a0 2.2 \u5c06 X-File-Storage \u96c6\u6210\u5230\u82e5\u4f9d\u6846\u67b6\u4e2d<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u76f8\u6bd4\u76f4\u63a5\u4f7f\u7528\u963f\u91cc\u4e91 OSS&#xff0c;\u4f7f\u7528 X-File-Storage \u4e0a\u4f20\u56fe\u7247\u5230\u4e91\u670d\u52a1\u5668\u7684\u64cd\u4f5c\u4f1a\u66f4\u52a0\u5bb9\u6613&#xff0c;\u4f7f\u7528 X-File-Storage \u53ef\u4ee5\u7b80\u5316\u56fe\u7247\u4e0a\u4f20\u5230\u4e91\u670d\u52a1\u5668\u7684\u8fc7\u7a0b&#xff0c;\u7279\u522b\u662f\u5bf9\u4e8e\u90a3\u4e9b\u4e0d\u719f\u6089\u963f\u91cc\u4e91 OSS API \u6216\u8005\u5e0c\u671b\u51cf\u5c11\u5f00\u53d1\u5de5\u4f5c\u91cf\u7684\u5f00\u53d1\u8005\u6765\u8bf4\u3002X-File-Storage \u662f\u4e00\u4e2a\u62bd\u8c61\u5c42&#xff0c;\u5b83\u5c01\u88c5\u4e86\u5e95\u5c42\u5b58\u50a8\u670d\u52a1\u7684\u590d\u6742\u6027&#xff0c;\u63d0\u4f9b\u4e86\u66f4\u7b80\u5355\u3001\u66f4\u7edf\u4e00\u7684\u63a5\u53e3\u3002\u00a0<\/p>\n<p>\u5c06\u00a0X-File-Storage \u96c6\u6210\u5230\u82e5\u4f9d\u6846\u67b6\u4e2d\u7684\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1&#xff09;\u5728 dkd-common \u7684 pom.xml \u4e2d\u5f15\u5165\u4f9d\u8d56&#xff1a;<\/p>\n<p> &lt;!&#8211; \u6587\u4ef6\u4e0a\u4f20&#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;org.dromara.x-file-storage&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;x-file-storage-spring&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;2.1.0&lt;\/version&gt;<br \/>\n&lt;\/dependency&gt;<br \/>\n&lt;!&#8211; \u963f\u91cc\u4e91oss&#8211;&gt;<br \/>\n&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;com.aliyun.oss&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;aliyun-sdk-oss&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;3.16.1&lt;\/version&gt;<br \/>\n&lt;\/dependency&gt; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02&#xff09;\u5728 dkd-admin \u7684 application.yml \u914d\u7f6e\u6587\u4ef6\u4e2d\u5148\u6dfb\u52a0\u4ee5\u4e0b\u57fa\u7840\u914d\u7f6e&#xff0c;\u518d\u6dfb\u52a0\u5bf9\u5e94\u5e73\u53f0\u7684\u914d\u7f6e&#xff1a;<\/p>\n<p> # \u6587\u4ef6\u4e0a\u4f20<br \/>\ndromara:<br \/>\n  x-file-storage: #\u6587\u4ef6\u5b58\u50a8\u914d\u7f6e<br \/>\n    default-platform: aliyun-oss-1 #\u9ed8\u8ba4\u4f7f\u7528\u7684\u5b58\u50a8\u5e73\u53f0<br \/>\n    thumbnail-suffix: &#034;.min.jpg&#034; #\u7f29\u7565\u56fe\u540e\u7f00&#xff0c;\u4f8b\u5982\u3010.min.jpg\u3011\u3010.png\u3011<br \/>\n    #\u5bf9\u5e94\u5e73\u53f0\u7684\u914d\u7f6e\u5199\u5728\u8fd9\u91cc&#xff0c;\u6ce8\u610f\u7f29\u8fdb\u8981\u5bf9\u9f50<br \/>\n    aliyun-oss:<br \/>\n      &#8211; platform: aliyun-oss-1 # \u5b58\u50a8\u5e73\u53f0\u6807\u8bc6<br \/>\n        enable-storage: true  # \u542f\u7528\u5b58\u50a8<br \/>\n        access-key: ??<br \/>\n        secret-key: ??<br \/>\n        end-point: oss-cn-qingdao.aliyuncs.com<br \/>\n        bucket-name: itheima-007<br \/>\n        domain: https:\/\/itheima-007.oss-cn-qingdao.aliyuncs.com\/ # \u8bbf\u95ee\u57df\u540d&#xff0c;\u6ce8\u610f\u201c\/\u201d\u7ed3\u5c3e&#xff0c;\u4f8b\u5982&#xff1a;https:\/\/abc.oss-cn-shanghai.aliyuncs.com\/<br \/>\n        base-path: dkd-images\/ # \u57fa\u7840\u8def\u5f84 <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03&#xff09;\u5728 dkd-admin \u7684\u542f\u52a8\u7c7b\u4e0a\u52a0\u4e0a &#064;EnableFileStorage \u6ce8\u89e3&#xff1a;<\/p>\n<p> &#064;EnableFileStorage<br \/>\n&#064;SpringBootApplication(exclude &#061; { DataSourceAutoConfiguration.class })<br \/>\npublic class DkdApplication<br \/>\n{<br \/>\n    public static void main(String[] args)<br \/>\n    {<br \/>\n        \/\/ System.setProperty(&#034;spring.devtools.restart.enabled&#034;, &#034;false&#034;);<br \/>\n        SpringApplication.run(DkdApplication.class, args);<br \/>\n        System.out.println(&#034;(\u2665\u25e0\u203f\u25e0)&#xff89;&#xff9e;  \u5e1d\u53ef\u5f97\u542f\u52a8\u6210\u529f   \u10da(\u00b4\u06a1&#096;\u10da)&#xff9e;&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 4&#xff09;\u4fee\u6539\u82e5\u4f9d\u9ed8\u8ba4\u4e0a\u4f20\u56fe\u7247\u4ee3\u7801<\/p>\n<p id=\"u474a0b74\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u627e\u5230 ruoyi-admin \u6a21\u5757\u4e2d\u7684 com.ruoyi.web.controller.common.CommonController \u7c7b&#xff0c;\u4fee\u6539\u5355\u4e2a\u6587\u4ef6\u4e0a\u4f20\u7684\u65b9\u6cd5&#xff1a;<\/p>\n<p> &#064;Autowired<br \/>\nprivate FileStorageService fileStorageService;\/\/\u6ce8\u5165\u5b9e\u5217<\/p>\n<p>\/**<br \/>\n  * \u901a\u7528\u4e0a\u4f20\u8bf7\u6c42&#xff08;\u5355\u4e2a&#xff09;<br \/>\n*\/<br \/>\n&#064;PostMapping(&#034;\/upload&#034;)<br \/>\npublic AjaxResult uploadFile(MultipartFile file) throws Exception {<\/p>\n<p>    try {<br \/>\n        \/\/ \u6307\u5b9aoss\u4fdd\u5b58\u6587\u4ef6\u8def\u5f84<br \/>\n        String objectName &#061; LocalDate.now().format(DateTimeFormatter.ofPattern(&#034;yyyy\/MM\/dd&#034;)) &#043; &#034;\/&#034;;<br \/>\n        \/\/ \u4e0a\u4f20\u56fe\u7247&#xff0c;\u6210\u529f\u8fd4\u56de\u6587\u4ef6\u4fe1\u606f<br \/>\n        FileInfo fileInfo &#061; fileStorageService.of(file).setPath(objectName).upload();<br \/>\n        \/\/ \u8bbe\u7f6e\u8fd4\u56de\u7ed3\u679c<br \/>\n        AjaxResult ajax &#061; AjaxResult.success();<br \/>\n        ajax.put(&#034;url&#034;, fileInfo.getUrl());<br \/>\n        ajax.put(&#034;fileName&#034;, fileInfo.getUrl());  \/\/\u6ce8\u610f&#xff1a;\u8fd9\u91cc\u7684\u503c\u8981\u6539\u4e3aurl&#xff0c;\u524d\u7aef\u8bbf\u95ee\u7684\u5730\u5740,\u9700\u8981\u6587\u4ef6\u7684\u5730\u5740 \u800c\u4e0d\u662f\u6587\u4ef6\u540d\u79f0<br \/>\n        ajax.put(&#034;newFileName&#034;, fileInfo.getUrl());<br \/>\n        ajax.put(&#034;originalFilename&#034;, file.getOriginalFilename());<br \/>\n        return ajax;<br \/>\n    } catch (Exception e) {<br \/>\n        return AjaxResult.error(e.getMessage());<br \/>\n    }<br \/>\n} <\/p>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"2025-04-18v5i2dxoohd5.gif\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e136\u6b21\uff0c\u6536\u85cf164\u6b21\u3002\u963f\u91cc\u4e91\u5bf9\u8c61\u5b58\u50a8 OSS\uff08Object Storage Service\uff09\uff0c\u662f\u4e00\u6b3e\u6d77\u91cf\u3001\u5b89\u5168\u3001\u4f4e\u6210\u672c\u3001\u9ad8\u53ef\u9760\u7684\u4e91\u5b58\u50a8\u670d\u52a1\u3002\u4f7f\u7528 OSS\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u968f\u65f6\u5b58\u50a8\u548c\u8c03\u7528\u5305\u62ec\u6587\u672c\u3001\u56fe\u7247\u3001\u97f3\u9891\u548c\u89c6\u9891\u7b49\u5728\u5185\u7684\u5404\u79cd\u6587\u4ef6\u3002\u4f7f\u7528\u4e86\u963f\u91cc\u4e91 OSS \u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u4e4b\u540e\uff0c\u6211\u4eec\u7684\u9879\u76ee\u5f53\u4e2d\u5982\u679c\u6d89\u53ca\u5230\u6587\u4ef6\u4e0a\u4f20\u8fd9\u6837\u7684\u4e1a\u52a1\uff0c\u5728\u524d\u7aef\u8fdb\u884c\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bf7\u6c42\u5230\u670d\u52a1\u7aef\u65f6\uff0c\u5728\u670d\u52a1\u5668\u672c\u5730\u78c1\u76d8\u5f53\u4e2d\u5c31\u4e0d\u9700\u8981\u518d\u6765\u5b58\u50a8\u6587\u4ef6\u4e86\u3002\u6211\u4eec\u76f4\u63a5\u5c06\u63a5\u6536\u5230\u7684\u6587\u4ef6\u4e0a\u4f20\u5230 oss\uff0c\u7531 oss \u5e2e\u6211\u4eec\u5b58\u50a8\u548c\u7ba1\u7406\uff0c\u540c\u65f6\u963f\u91cc\u4e91\u7684 oss \u5b58\u50a8\u670d\u52a1\u8fd8\u4fdd\u969c\u4e86\u6211\u4eec\u6240\u5b58\u50a8\u5185\u5bb9\u7684\u5b89\u5168\u53ef\u9760\u3002<\/p>\n","protected":false},"author":2,"featured_media":8273,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,101,98,97,100,95,96],"topic":[],"class_list":["post-8293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring","tag-spring-boot","tag-97","tag-100","tag-95","tag-96"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \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\/8293.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e136\u6b21\uff0c\u6536\u85cf164\u6b21\u3002\u963f\u91cc\u4e91\u5bf9\u8c61\u5b58\u50a8 OSS\uff08Object Storage Service\uff09\uff0c\u662f\u4e00\u6b3e\u6d77\u91cf\u3001\u5b89\u5168\u3001\u4f4e\u6210\u672c\u3001\u9ad8\u53ef\u9760\u7684\u4e91\u5b58\u50a8\u670d\u52a1\u3002\u4f7f\u7528 OSS\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u968f\u65f6\u5b58\u50a8\u548c\u8c03\u7528\u5305\u62ec\u6587\u672c\u3001\u56fe\u7247\u3001\u97f3\u9891\u548c\u89c6\u9891\u7b49\u5728\u5185\u7684\u5404\u79cd\u6587\u4ef6\u3002\u4f7f\u7528\u4e86\u963f\u91cc\u4e91 OSS \u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u4e4b\u540e\uff0c\u6211\u4eec\u7684\u9879\u76ee\u5f53\u4e2d\u5982\u679c\u6d89\u53ca\u5230\u6587\u4ef6\u4e0a\u4f20\u8fd9\u6837\u7684\u4e1a\u52a1\uff0c\u5728\u524d\u7aef\u8fdb\u884c\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bf7\u6c42\u5230\u670d\u52a1\u7aef\u65f6\uff0c\u5728\u670d\u52a1\u5668\u672c\u5730\u78c1\u76d8\u5f53\u4e2d\u5c31\u4e0d\u9700\u8981\u518d\u6765\u5b58\u50a8\u6587\u4ef6\u4e86\u3002\u6211\u4eec\u76f4\u63a5\u5c06\u63a5\u6536\u5230\u7684\u6587\u4ef6\u4e0a\u4f20\u5230 oss\uff0c\u7531 oss \u5e2e\u6211\u4eec\u5b58\u50a8\u548c\u7ba1\u7406\uff0c\u540c\u65f6\u963f\u91cc\u4e91\u7684 oss \u5b58\u50a8\u670d\u52a1\u8fd8\u4fdd\u969c\u4e86\u6211\u4eec\u6240\u5b58\u50a8\u5185\u5bb9\u7684\u5b89\u5168\u53ef\u9760\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/8293.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T08:29:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082942-68020d76b80b1.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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8293.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/8293.html\",\"name\":\"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T08:29:47+00:00\",\"dateModified\":\"2025-04-18T08:29:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/8293.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/8293.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/8293.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09\"}]},{\"@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":"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \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\/8293.html","og_locale":"zh_CN","og_type":"article","og_title":"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e136\u6b21\uff0c\u6536\u85cf164\u6b21\u3002\u963f\u91cc\u4e91\u5bf9\u8c61\u5b58\u50a8 OSS\uff08Object Storage Service\uff09\uff0c\u662f\u4e00\u6b3e\u6d77\u91cf\u3001\u5b89\u5168\u3001\u4f4e\u6210\u672c\u3001\u9ad8\u53ef\u9760\u7684\u4e91\u5b58\u50a8\u670d\u52a1\u3002\u4f7f\u7528 OSS\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f51\u7edc\u968f\u65f6\u5b58\u50a8\u548c\u8c03\u7528\u5305\u62ec\u6587\u672c\u3001\u56fe\u7247\u3001\u97f3\u9891\u548c\u89c6\u9891\u7b49\u5728\u5185\u7684\u5404\u79cd\u6587\u4ef6\u3002\u4f7f\u7528\u4e86\u963f\u91cc\u4e91 OSS \u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u4e4b\u540e\uff0c\u6211\u4eec\u7684\u9879\u76ee\u5f53\u4e2d\u5982\u679c\u6d89\u53ca\u5230\u6587\u4ef6\u4e0a\u4f20\u8fd9\u6837\u7684\u4e1a\u52a1\uff0c\u5728\u524d\u7aef\u8fdb\u884c\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bf7\u6c42\u5230\u670d\u52a1\u7aef\u65f6\uff0c\u5728\u670d\u52a1\u5668\u672c\u5730\u78c1\u76d8\u5f53\u4e2d\u5c31\u4e0d\u9700\u8981\u518d\u6765\u5b58\u50a8\u6587\u4ef6\u4e86\u3002\u6211\u4eec\u76f4\u63a5\u5c06\u63a5\u6536\u5230\u7684\u6587\u4ef6\u4e0a\u4f20\u5230 oss\uff0c\u7531 oss \u5e2e\u6211\u4eec\u5b58\u50a8\u548c\u7ba1\u7406\uff0c\u540c\u65f6\u963f\u91cc\u4e91\u7684 oss \u5b58\u50a8\u670d\u52a1\u8fd8\u4fdd\u969c\u4e86\u6211\u4eec\u6240\u5b58\u50a8\u5185\u5bb9\u7684\u5b89\u5168\u53ef\u9760\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/8293.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T08:29:47+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418082942-68020d76b80b1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/8293.html","url":"https:\/\/www.wsisp.com\/helps\/8293.html","name":"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T08:29:47+00:00","dateModified":"2025-04-18T08:29:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/8293.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/8293.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/8293.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u82e5\u4f9d\u6846\u67b6\u7bc7-\u82e5\u4f9d\u96c6\u6210 X-File-Storage \u6846\u67b6\uff08\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u963f\u91cc\u4e91 OSS \u670d\u52a1\u5668\uff09\u3001EasyExcel \u6846\u67b6\uff08\u5b9e\u73b0 Excel \u6570\u636e\u6279\u91cf\u5bfc\u5165\u529f\u80fd\uff09"}]},{"@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\/8293","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=8293"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/8293\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/8273"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=8293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=8293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=8293"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=8293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}