{"id":9165,"date":"2024-11-15T03:40:49","date_gmt":"2024-11-14T19:40:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/9165\/"},"modified":"2024-11-15T03:40:49","modified_gmt":"2024-11-14T19:40:49","slug":"%e9%aa%8c%e8%af%81%e5%a4%b1%e8%b4%a5%e5%90%8e%e8%83%bd%e5%90%a6%e9%87%8d%e6%96%b0%e4%b8%8a%e4%bc%a0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/9165\/","title":{"rendered":"\u9a8c\u8bc1\u5931\u8d25\u540e\u80fd\u5426\u91cd\u65b0\u4e0a\u4f20\uff1f"},"content":{"rendered":"<h1 id=\"%e9%aa%8c%e8%af%81%e5%a4%b1%e8%b4%a5%e5%90%8e%e8%83%bd%e5%90%a6%e9%87%8d%e6%96%b0%e4%b8%8a%e4%bc%a0%ef%bc%9f-neDVlUpzEm\">\u9a8c\u8bc1\u5931\u8d25\u540e\u80fd\u5426\u91cd\u65b0\u4e0a\u4f20\uff1f<\/h1>\n<p>\u5728\u73b0\u4ee3\u4e92\u8054\u7f51\u73af\u5883\u4e2d\uff0c\u6570\u636e\u4e0a\u4f20\u548c\u9a8c\u8bc1\u662f\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u5c24\u5176\u662f\u5728\u6d89\u53ca\u7528\u6237\u4fe1\u606f\u3001\u6587\u4ef6\u63d0\u4ea4\u6216\u5728\u7ebf\u8868\u5355\u65f6\u3002\u7528\u6237\u5728\u4e0a\u4f20\u6570\u636e\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u9a8c\u8bc1\u5931\u8d25\u7684\u60c5\u51b5\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0d\u4ec5\u4f1a\u5f71\u54cd\u7528\u6237\u4f53\u9a8c\uff0c\u8fd8\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u6216\u9519\u8bef\u3002\u672c\u6587\u5c06\u63a2\u8ba8\u5728\u9a8c\u8bc1\u5931\u8d25\u540e\uff0c\u7528\u6237\u662f\u5426\u53ef\u4ee5\u91cd\u65b0\u4e0a\u4f20\u6570\u636e\uff0c\u4ee5\u53ca\u76f8\u5173\u7684\u6280\u672f\u7ec6\u8282\u548c\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<h2 id=\"%e9%aa%8c%e8%af%81%e5%a4%b1%e8%b4%a5%e7%9a%84%e5%8e%9f%e5%9b%a0-neDVlUpzEm\">\u9a8c\u8bc1\u5931\u8d25\u7684\u539f\u56e0<\/h2>\n<p>\u9a8c\u8bc1\u5931\u8d25\u901a\u5e38\u662f\u7531\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u539f\u56e0\u9020\u6210\u7684\uff1a<\/p>\n<ul>\n<li><strong>\u683c\u5f0f\u9519\u8bef\uff1a<\/strong>\u7528\u6237\u4e0a\u4f20\u7684\u6587\u4ef6\u683c\u5f0f\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u4f8b\u5982\u4e0a\u4f20\u4e86\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b\u3002<\/li>\n<li><strong>\u5927\u5c0f\u8d85\u9650\uff1a<\/strong>\u4e0a\u4f20\u7684\u6587\u4ef6\u8d85\u8fc7\u4e86\u7cfb\u7edf\u8bbe\u5b9a\u7684\u5927\u5c0f\u9650\u5236\u3002<\/li>\n<li><strong>\u5185\u5bb9\u4e0d\u5408\u89c4\uff1a<\/strong>\u6587\u4ef6\u5185\u5bb9\u4e0d\u7b26\u5408\u7279\u5b9a\u7684\u5b89\u5168\u6216\u5408\u89c4\u8981\u6c42\uff0c\u4f8b\u5982\u5305\u542b\u6076\u610f\u4ee3\u7801\u6216\u654f\u611f\u4fe1\u606f\u3002<\/li>\n<li><strong>\u7f3a\u5c11\u5fc5\u586b\u5b57\u6bb5\uff1a<\/strong>\u5728\u8868\u5355\u63d0\u4ea4\u65f6\uff0c\u7528\u6237\u672a\u586b\u5199\u6240\u6709\u5fc5\u586b\u5b57\u6bb5\u3002<\/li>\n<\/ul>\n<h2 id=\"%e9%87%8d%e6%96%b0%e4%b8%8a%e4%bc%a0%e7%9a%84%e5%8f%af%e8%83%bd%e6%80%a7-neDVlUpzEm\">\u91cd\u65b0\u4e0a\u4f20\u7684\u53ef\u80fd\u6027<\/h2>\n<p>\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u9a8c\u8bc1\u5931\u8d25\u540e\u7528\u6237\u662f\u53ef\u4ee5\u91cd\u65b0\u4e0a\u4f20\u6570\u636e\u7684\u3002\u5177\u4f53\u6d41\u7a0b\u901a\u5e38\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li><strong>\u9519\u8bef\u63d0\u793a\uff1a<\/strong>\u7cfb\u7edf\u4f1a\u5411\u7528\u6237\u63d0\u4f9b\u660e\u786e\u7684\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u9a8c\u8bc1\u5931\u8d25\u7684\u539f\u56e0\u3002<\/li>\n<li><strong>\u4fee\u6539\u6570\u636e\uff1a<\/strong>\u7528\u6237\u6839\u636e\u63d0\u793a\u4fee\u6539\u4e0a\u4f20\u7684\u6570\u636e\uff0c\u786e\u4fdd\u7b26\u5408\u8981\u6c42\u3002<\/li>\n<li><strong>\u91cd\u65b0\u4e0a\u4f20\uff1a<\/strong>\u7528\u6237\u5728\u4fee\u6539\u540e\u53ef\u4ee5\u518d\u6b21\u5c1d\u8bd5\u4e0a\u4f20\u6570\u636e\u3002<\/li>\n<\/ol>\n<h3 id=\"%e6%8a%80%e6%9c%af%e5%ae%9e%e7%8e%b0-neDVlUpzEm\">\u6280\u672f\u5b9e\u73b0<\/h3>\n<p>\u5728\u6280\u672f\u5c42\u9762\uff0c\u91cd\u65b0\u4e0a\u4f20\u7684\u5b9e\u73b0\u901a\u5e38\u6d89\u53ca\u524d\u7aef\u548c\u540e\u7aef\u7684\u914d\u5408\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5728\u524d\u7aef\u5904\u7406\u6587\u4ef6\u4e0a\u4f20\u548c\u9a8c\u8bc1\uff1a<\/p>\n<pre><code>\nfunction validateAndUpload(file) {\n    const maxSize = 2 * 1024 * 1024; \/\/ 2MB\n    const allowedTypes = ['image\/jpeg', 'image\/png'];\n\n    if (file.size &gt; maxSize) {\n        alert('\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\uff01');\n        return false;\n    }\n\n    if (!allowedTypes.includes(file.type)) {\n        alert('\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b\uff01');\n        return false;\n    }\n\n    \/\/ \u8fdb\u884c\u4e0a\u4f20\n    uploadFile(file);\n}\n\nfunction uploadFile(file) {\n    const formData = new FormData();\n    formData.append('file', file);\n\n    fetch('\/upload', {\n        method: 'POST',\n        body: formData\n    })\n    .then(response =&gt; response.json())\n    .then(data =&gt; {\n        if (data.success) {\n            alert('\u6587\u4ef6\u4e0a\u4f20\u6210\u529f\uff01');\n        } else {\n            alert('\u6587\u4ef6\u4e0a\u4f20\u5931\u8d25\uff1a' + data.message);\n        }\n    });\n}\n<\/code><\/pre>\n<h2 id=\"%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5-neDVlUpzEm\">\u6700\u4f73\u5b9e\u8df5<\/h2>\n<p>\u4e3a\u4e86\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u548c\u7cfb\u7edf\u7684\u53ef\u9760\u6027\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<ul>\n<li><strong>\u63d0\u4f9b\u6e05\u6670\u7684\u9519\u8bef\u4fe1\u606f\uff1a<\/strong>\u786e\u4fdd\u7528\u6237\u80fd\u591f\u7406\u89e3\u9a8c\u8bc1\u5931\u8d25\u7684\u539f\u56e0\uff0c\u5e76\u63d0\u4f9b\u76f8\u5e94\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/li>\n<li><strong>\u4f18\u5316\u4e0a\u4f20\u6d41\u7a0b\uff1a<\/strong>\u5141\u8bb8\u7528\u6237\u5728\u540c\u4e00\u9875\u9762\u4e0a\u8fdb\u884c\u4fee\u6539\u548c\u91cd\u65b0\u4e0a\u4f20\uff0c\u907f\u514d\u9875\u9762\u8df3\u8f6c\u3002<\/li>\n<li><strong>\u5b9e\u65bd\u6587\u4ef6\u7c7b\u578b\u548c\u5927\u5c0f\u9650\u5236\uff1a<\/strong>\u5728\u524d\u7aef\u8fdb\u884c\u521d\u6b65\u9a8c\u8bc1\uff0c\u51cf\u5c11\u670d\u52a1\u5668\u8d1f\u62c5\u3002<\/li>\n<li><strong>\u8bb0\u5f55\u4e0a\u4f20\u5386\u53f2\uff1a<\/strong>\u5728\u540e\u53f0\u8bb0\u5f55\u7528\u6237\u7684\u4e0a\u4f20\u5386\u53f2\uff0c\u4ee5\u4fbf\u4e8e\u540e\u7eed\u7684\u5ba1\u8ba1\u548c\u95ee\u9898\u6392\u67e5\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%80%bb%e7%bb%93-neDVlUpzEm\">\u603b\u7ed3<\/h2>\n<p>\u5728\u9a8c\u8bc1\u5931\u8d25\u540e\uff0c\u7528\u6237\u901a\u5e38\u53ef\u4ee5\u91cd\u65b0\u4e0a\u4f20\u6570\u636e\u3002\u901a\u8fc7\u63d0\u4f9b\u6e05\u6670\u7684\u9519\u8bef\u63d0\u793a\u548c\u4f18\u5316\u4e0a\u4f20\u6d41\u7a0b\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002\u7c73\u4e91\u63d0\u4f9b\u9ad8\u6548\u7684<a href=\"https:\/\/fwq.ai\">\u4e91\u670d\u52a1\u5668<\/a>\u89e3\u51b3\u65b9\u6848\uff0c\u786e\u4fdd\u60a8\u7684\u6570\u636e\u4e0a\u4f20\u548c\u9a8c\u8bc1\u8fc7\u7a0b\u987a\u7545\u65e0\u963b\u3002\u65e0\u8bba\u662f\u9700\u8981<a href=\"https:\/\/fwq.ai\">VPS<\/a>\u8fd8\u662f<a href=\"https:\/\/fwq.ai\">\u7f8e\u56fd<\/a>\u7684\u4e13\u7528\u670d\u52a1\u5668\uff0c\u7c73\u4e91\u90fd\u80fd\u4e3a\u60a8\u63d0\u4f9b\u53ef\u9760\u7684\u652f\u6301\u3002<\/p>\n<p>\u7c73\u4e91\u4e0d\u662f\u91d1\u878d\u673a\u6784\uff0c\u4e0d\u8981\u6c42KYC\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9a8c\u8bc1\u5931\u8d25\u540e\u80fd\u5426\u91cd\u65b0\u4e0a\u4f20\uff1f \u5728\u73b0\u4ee3\u4e92\u8054\u7f51\u73af\u5883\u4e2d\uff0c\u6570\u636e\u4e0a\u4f20\u548c\u9a8c\u8bc1\u662f\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u5c24\u5176\u662f\u5728\u6d89\u53ca\u7528\u6237\u4fe1\u606f\u3001\u6587\u4ef6\u63d0\u4ea4\u6216\u5728\u7ebf\u8868\u5355\u65f6\u3002\u7528\u6237\u5728\u4e0a\u4f20\u6570\u636e\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u9a8c\u8bc1\u5931\u8d25\u7684\u60c5\u51b5\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0d\u4ec5\u4f1a\u5f71\u54cd\u7528\u6237\u4f53\u9a8c\uff0c\u8fd8\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u6216\u9519\u8bef\u3002\u672c\u6587\u5c06\u63a2\u8ba8\u5728\u9a8c\u8bc1\u5931\u8d25\u540e\uff0c\u7528\u6237\u662f\u5426\u53ef\u4ee5\u91cd\u65b0\u4e0a\u4f20\u6570\u636e\uff0c\u4ee5\u53ca\u76f8\u5173\u7684\u6280\u672f\u7ec6\u8282\u548c\u6700\u4f73\u5b9e\u8df5\u3002 \u9a8c\u8bc1\u5931\u8d25\u7684\u539f\u56e0 \u9a8c\u8bc1\u5931\u8d25\u901a\u5e38\u662f\u7531\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u539f\u56e0\u9020\u6210\u7684\uff1a \u683c\u5f0f\u9519\u8bef\uff1a\u7528\u6237\u4e0a\u4f20\u7684\u6587\u4ef6\u683c\u5f0f\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u4f8b\u5982\u4e0a\u4f20\u4e86\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b\u3002 \u5927\u5c0f\u8d85\u9650\uff1a\u4e0a\u4f20\u7684\u6587\u4ef6\u8d85\u8fc7\u4e86\u7cfb\u7edf\u8bbe\u5b9a\u7684\u5927\u5c0f\u9650\u5236\u3002 \u5185\u5bb9\u4e0d\u5408\u89c4\uff1a\u6587\u4ef6\u5185\u5bb9\u4e0d\u7b26\u5408\u7279\u5b9a\u7684\u5b89\u5168\u6216\u5408\u89c4\u8981\u6c42\uff0c\u4f8b\u5982\u5305\u542b\u6076\u610f\u4ee3\u7801\u6216\u654f\u611f\u4fe1\u606f\u3002 \u7f3a\u5c11\u5fc5\u586b\u5b57\u6bb5\uff1a\u5728\u8868\u5355\u63d0\u4ea4\u65f6\uff0c\u7528\u6237\u672a\u586b\u5199\u6240\u6709\u5fc5\u586b\u5b57\u6bb5\u3002 \u91cd\u65b0\u4e0a\u4f20\u7684\u53ef\u80fd\u6027 \u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u9a8c\u8bc1\u5931\u8d25\u540e\u7528\u6237\u662f\u53ef\u4ee5\u91cd\u65b0\u4e0a\u4f20\u6570\u636e\u7684\u3002\u5177\u4f53\u6d41\u7a0b\u901a\u5e38\u5982\u4e0b\uff1a \u9519\u8bef\u63d0\u793a\uff1a\u7cfb\u7edf\u4f1a\u5411\u7528\u6237\u63d0\u4f9b\u660e\u786e\u7684\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u9a8c\u8bc1\u5931\u8d25\u7684\u539f\u56e0\u3002 \u4fee\u6539\u6570\u636e\uff1a\u7528\u6237\u6839\u636e\u63d0\u793a\u4fee\u6539\u4e0a\u4f20\u7684\u6570\u636e\uff0c\u786e\u4fdd\u7b26\u5408\u8981\u6c42\u3002 \u91cd\u65b0\u4e0a\u4f20\uff1a\u7528\u6237\u5728\u4fee\u6539\u540e\u53ef\u4ee5\u518d\u6b21\u5c1d\u8bd5\u4e0a\u4f20\u6570\u636e\u3002 \u6280\u672f\u5b9e\u73b0 \u5728\u6280\u672f\u5c42\u9762\uff0c\u91cd\u65b0\u4e0a\u4f20\u7684\u5b9e\u73b0\u901a\u5e38\u6d89\u53ca\u524d\u7aef\u548c\u540e\u7aef\u7684\u914d\u5408\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5728\u524d\u7aef\u5904\u7406\u6587\u4ef6\u4e0a\u4f20\u548c\u9a8c\u8bc1\uff1a function validateAndUpload(file) { const maxSize = 2 * 1024 * 1024; \/\/ 2MB const allowedTypes = [&#8216;image\/jpeg&#8217;, &#8216;image\/png&#8217;]; if (file.size &gt; maxSize) { alert(&#8216;\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\uff01&#8217;); return false; } if (!allowedTypes.includes(file.type)) { alert(&#8216;\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b\uff01&#8217;); return false; } \/\/ \u8fdb\u884c\u4e0a\u4f20 uploadFile(file); } function uploadFile(file) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9165","post","type-post","status-publish","format-standard","hentry","category-kyc"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/9165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=9165"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/9165\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=9165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=9165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=9165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}