{"id":38594,"date":"2025-05-20T17:43:57","date_gmt":"2025-05-20T09:43:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/38594.html"},"modified":"2025-05-20T17:43:57","modified_gmt":"2025-05-20T09:43:57","slug":"go%e7%94%b5%e5%95%86%e9%a1%b9%e7%9b%ae-ai%e6%a8%a1%e6%8b%9f%e9%9d%a2%e8%af%95%ef%bc%9a%e9%aa%8c%e8%af%81%e7%a0%81%e6%a8%a1%e5%9d%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/38594.html","title":{"rendered":"Go\u7535\u5546\u9879\u76ee--Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757"},"content":{"rendered":"<hr \/>\n<p>\u9762\u8bd5\u5b98: \u4f60\u597d&#xff0c;\u6211\u770b\u4e86\u4f60\u9879\u76ee\u4e2d\u7684\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u3002\u6211\u4eec\u6765\u804a\u804a\u5b83\u3002<\/p>\n<hr \/>\n<p>\u95ee\u9898 1: \u57fa\u7840\u7406\u89e3\u4e0e\u8bbe\u8ba1<\/p>\n<p>\u9762\u8bd5\u5b98: \u201c\u4f60\u80fd\u7b80\u8981\u63cf\u8ff0\u4e00\u4e0b\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u7684\u6574\u4f53\u5de5\u4f5c\u6d41\u7a0b\u5417&#xff1f;\u4ece\u7528\u6237\u8bf7\u6c42\u9a8c\u8bc1\u7801\u5230\u540e\u7aef\u5b8c\u6210\u9a8c\u8bc1&#xff0c;\u4e3b\u8981\u6d89\u53ca\u5230\u54ea\u4e9b\u7ec4\u4ef6\u548c\u6b65\u9aa4&#xff1f;\u201d<\/p>\n<p>\u6700\u4f73\u7b54\u6848\u793a\u4f8b:<\/p>\n<p>&#034;\u597d\u7684\u3002\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u7684\u6d41\u7a0b\u5927\u81f4\u5982\u4e0b&#xff1a;<\/p>\n<li>\u524d\u7aef\u8bf7\u6c42\u9a8c\u8bc1\u7801&#xff1a; \u7528\u6237\u8bbf\u95ee\u767b\u5f55\u9875\u540e&#xff0c;\u524d\u7aef\u4f1a\u5411\u540e\u7aef\u7279\u5b9a\u7684API&#xff08;\u4f8b\u5982 \/captcha&#xff09;\u53d1\u9001\u8bf7\u6c42&#xff0c;\u4ee5\u83b7\u53d6\u9a8c\u8bc1\u7801\u56fe\u7247\u3002<\/li>\n<li>\u540e\u7aef\u751f\u6210\u9a8c\u8bc1\u7801 (MakeCaptcha):\n<ul>\n<li>\u8be5API\u5bf9\u5e94\u7684Controller\u65b9\u6cd5\u4f1a\u8c03\u7528 models.MakeCaptcha()\u3002<\/li>\n<li>MakeCaptcha \u4f7f\u7528 base64Captcha \u5e93&#xff1a;\n<ul>\n<li>\u9996\u5148&#xff0c;\u5b83\u914d\u7f6e\u4e00\u4e2a Driver&#xff08;\u8fd9\u91cc\u662f DriverString&#xff09;&#xff0c;\u5b9a\u4e49\u9a8c\u8bc1\u7801\u7684\u6837\u5f0f\u3001\u5b57\u7b26\u96c6\u3001\u5927\u5c0f\u7b49\u3002<\/li>\n<li>\u7136\u540e&#xff0c;\u521b\u5efa\u4e00\u4e2a Captcha \u5b9e\u4f8b&#xff0c;\u8be5\u5b9e\u4f8b\u5173\u8054\u4e86\u914d\u7f6e\u597d\u7684 Driver \u548c\u4e00\u4e2a Store&#xff08;\u8fd9\u91cc\u662f DefaultMemStore&#xff0c;\u7528\u4e8e\u5185\u5b58\u5b58\u50a8&#xff09;\u3002<\/li>\n<li>\u8c03\u7528 Captcha \u5b9e\u4f8b\u7684 Generate() \u65b9\u6cd5\u3002\u8fd9\u4e2a\u65b9\u6cd5\u4f1a\u751f\u6210\u552f\u4e00\u7684\u9a8c\u8bc1\u7801ID\u3001Base64\u7f16\u7801\u7684\u56fe\u7247\u5b57\u7b26\u4e32\u4ee5\u53ca\u9a8c\u8bc1\u7801\u7684\u6b63\u786e\u7b54\u6848\u3002\u5173\u952e\u5728\u4e8e&#xff0c;\u7b54\u6848\u4f1a\u88ab\u5b58\u50a8\u5728 Store \u4e2d&#xff0c;\u4e0e\u9a8c\u8bc1\u7801ID\u5173\u8054\u3002<\/li>\n<\/ul>\n<\/li>\n<li>MakeCaptcha \u5c06\u9a8c\u8bc1\u7801ID\u548cBase64\u56fe\u7247\u5b57\u7b26\u4e32\u8fd4\u56de\u7ed9Controller\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u524d\u7aef\u5c55\u793a\u4e0e\u8bb0\u5f55&#xff1a; Controller\u5c06ID\u548c\u56fe\u7247\u6570\u636e\u4ee5JSON\u683c\u5f0f\u8fd4\u56de\u7ed9\u524d\u7aef\u3002\u524d\u7aef\u5c06\u56fe\u7247\u663e\u793a\u7ed9\u7528\u6237&#xff0c;\u5e76\u5c06\u9a8c\u8bc1\u7801ID\u4fdd\u5b58\u5728\u4e00\u4e2a\u9690\u85cf\u8868\u5355\u5b57\u6bb5\u4e2d\u3002<\/li>\n<li>\u7528\u6237\u63d0\u4ea4\u8868\u5355&#xff1a; \u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u770b\u5230\u7684\u9a8c\u8bc1\u7801\u5b57\u7b26\u540e\u63d0\u4ea4\u8868\u5355\u3002<\/li>\n<li>\u540e\u7aef\u9a8c\u8bc1 (DoLogin -&gt; VerifyCaptcha):\n<ul>\n<li>\u540e\u7aef\u7684\u767b\u5f55\u5904\u7406Controller\u65b9\u6cd5&#xff08;\u4f8b\u5982 DoLogin&#xff09;\u63a5\u6536\u5230\u8868\u5355\u6570\u636e&#xff0c;\u5176\u4e2d\u5305\u62ec\u7528\u6237\u8f93\u5165\u7684\u9a8c\u8bc1\u7801\u503c\u548c\u4e4b\u524d\u5b58\u50a8\u7684\u9a8c\u8bc1\u7801ID\u3002<\/li>\n<li>Controller\u8c03\u7528 models.VerifyCaptcha()\u3002<\/li>\n<li>VerifyCaptcha \u4f20\u5165\u9a8c\u8bc1\u7801ID\u548c\u7528\u6237\u8f93\u5165\u7684\u503c&#xff0c;\u5e76\u8c03\u7528 Store \u7684 Verify() \u65b9\u6cd5\u3002<\/li>\n<li>Store.Verify() \u6839\u636eID\u4ece\u5b58\u50a8\u4e2d\u68c0\u7d22\u51fa\u6b63\u786e\u7684\u7b54\u6848&#xff0c;\u4e0e\u7528\u6237\u8f93\u5165\u7684\u503c\u8fdb\u884c\u6bd4\u8f83&#xff0c;\u5e76\u6839\u636e\u914d\u7f6e&#xff08;\u8fd9\u91cc\u662f true&#xff09;\u5728\u9a8c\u8bc1\u540e\u6e05\u9664\u8be5ID\u7684\u5b58\u50a8&#xff0c;\u9632\u6b62\u91cd\u7528\u3002<\/li>\n<li>\u6700\u7ec8\u8fd4\u56de\u9a8c\u8bc1\u7ed3\u679c&#xff08;\u6210\u529f\u6216\u5931\u8d25&#xff09;\u7ed9Controller&#xff0c;Controller\u518d\u636e\u6b64\u54cd\u5e94\u524d\u7aef\u3002&#034;<\/li>\n<\/ul>\n<\/li>\n<p>\u8003\u5bdf\u70b9: \u5bf9\u6a21\u5757\u6574\u4f53\u6d41\u7a0b\u7684\u6e05\u6670\u7406\u89e3&#xff0c;\u5173\u952e\u7ec4\u4ef6&#xff08;Driver, Store, Controller, Model&#xff09;\u7684\u804c\u8d23\u8ba4\u77e5\u3002<\/p>\n<hr \/>\n<p>\u95ee\u9898 2: \u5173\u952e\u7ec4\u4ef6\u4e0e\u914d\u7f6e<\/p>\n<p>\u9762\u8bd5\u5b98: \u201c\u5728 models\/captcha.go \u4e2d&#xff0c;base64Captcha.Driver \u548c base64Captcha.DriverString \u6709\u4ec0\u4e48\u533a\u522b\u548c\u8054\u7cfb&#xff1f;\u4e3a\u4ec0\u4e48\u9700\u8981 var driver base64Captcha.Driver \u8fd9\u6837\u7684\u58f0\u660e&#xff1f;\u201d<\/p>\n<p>\u6700\u4f73\u7b54\u6848\u793a\u4f8b:<\/p>\n<p>&#034;base64Captcha.Driver \u662f\u4e00\u4e2aGo\u8bed\u8a00\u7684\u63a5\u53e3\u7c7b\u578b\u3002\u5b83\u5b9a\u4e49\u4e86\u4e00\u5957\u89c4\u8303\u6216\u5951\u7ea6&#xff0c;\u89c4\u5b9a\u4e86\u4e00\u4e2a\u201c\u9a8c\u8bc1\u7801\u9a71\u52a8\u201d\u5e94\u8be5\u5177\u5907\u54ea\u4e9b\u884c\u4e3a&#xff08;\u65b9\u6cd5&#xff09;&#xff0c;\u6bd4\u5982\u7ed8\u5236\u9a8c\u8bc1\u7801\u3001\u751f\u6210\u95ee\u9898\u548c\u7b54\u6848\u7b49\u3002\u4f7f\u7528\u63a5\u53e3\u7684\u597d\u5904\u5728\u4e8e\u89e3\u8026&#xff0c;\u4f7f\u5f97\u6838\u5fc3\u7684\u9a8c\u8bc1\u7801\u751f\u6210\u903b\u8f91\u53ef\u4ee5\u4e0e\u5177\u4f53\u7684\u9a71\u52a8\u5b9e\u73b0\u5206\u79bb\u3002<\/p>\n<p>base64Captcha.DriverString \u662f\u4e00\u4e2a\u7ed3\u6784\u4f53\u7c7b\u578b\u3002\u5b83\u662f base64Captcha \u5e93\u63d0\u4f9b\u7684\u4e00\u4e2a\u5177\u4f53\u7684 Driver \u5b9e\u73b0&#xff0c;\u4e13\u95e8\u7528\u4e8e\u751f\u6210\u57fa\u4e8e\u5b57\u7b26\u4e32\u7684\u9a8c\u8bc1\u7801\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u521d\u59cb\u5316\u8fd9\u4e2a\u7ed3\u6784\u4f53\u7684\u5b57\u6bb5\u6765\u914d\u7f6e\u5b57\u7b26\u4e32\u9a8c\u8bc1\u7801\u7684\u5404\u79cd\u5c5e\u6027&#xff0c;\u5982\u9ad8\u5ea6\u3001\u5bbd\u5ea6\u3001\u5b57\u7b26\u96c6\u3001\u5b57\u4f53\u3001\u80cc\u666f\u8272\u7b49\u3002<\/p>\n<p>\u8fd9\u4e24\u8005\u7684\u8054\u7cfb\u5728\u4e8e&#xff0c;DriverString \u7ed3\u6784\u4f53&#xff08;\u6216\u8005\u5176\u901a\u8fc7\u67d0\u4e2a\u65b9\u6cd5\u5982 ConvertFonts() \u8fd4\u56de\u7684\u7c7b\u578b&#xff09;\u5b9e\u73b0\u4e86 Driver \u63a5\u53e3\u3002<\/p>\n<p>\u4ee3\u7801\u4e2d var driver base64Captcha.Driver \u8fd9\u6837\u58f0\u660e\u7684\u610f\u4e49\u5728\u4e8e&#xff1a;<\/p>\n<li>\u591a\u6001\u6027&#xff1a; driver \u53d8\u91cf\u53ef\u4ee5\u6301\u6709\u4efb\u4f55\u5b9e\u73b0\u4e86 Driver \u63a5\u53e3\u7684\u5177\u4f53\u7c7b\u578b\u7684\u503c\u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u5982\u679c\u6211\u4eec\u672a\u6765\u60f3\u4ece\u5b57\u7b26\u4e32\u9a8c\u8bc1\u7801\u5207\u6362\u5230\u6570\u5b66\u516c\u5f0f\u9a8c\u8bc1\u7801&#xff08;\u5047\u8bbe\u6709 DriverMath \u5b9e\u73b0\u4e86 Driver \u63a5\u53e3&#xff09;&#xff0c;\u6211\u4eec\u53ea\u9700\u8981\u6539\u53d8\u8d4b\u7ed9 driver \u53d8\u91cf\u7684\u5177\u4f53\u5b9e\u4f8b&#xff0c;\u800c\u8c03\u7528 driver \u7684\u4ee3\u7801&#xff08;\u5982 base64Captcha.NewCaptcha(driver, store)&#xff09;\u4e0d\u9700\u8981\u4fee\u6539\u3002<\/li>\n<li>\u62bd\u8c61&#xff1a; \u5b83\u9690\u85cf\u4e86\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002NewCaptcha \u51fd\u6570\u53ea\u9700\u8981\u77e5\u9053\u5b83\u5f97\u5230\u7684\u662f\u4e00\u4e2a\u7b26\u5408 Driver \u89c4\u8303\u7684\u4e1c\u897f&#xff0c;\u800c\u4e0d\u9700\u8981\u5173\u5fc3\u5b83\u7a76\u7adf\u662f DriverString \u8fd8\u662f\u5176\u4ed6\u4ec0\u4e48\u3002<\/li>\n<p>\u6240\u4ee5&#xff0c;\u6d41\u7a0b\u662f\u5148\u521b\u5efa\u4e00\u4e2a\u5177\u4f53\u7684\u914d\u7f6e\u5bf9\u8c61 (driverString :&#061; base64Captcha.DriverString{&#8230;}), \u7136\u540e\u901a\u8fc7 driver &#061; driverString.ConvertFonts() \u5c06\u5176&#xff08;\u6216\u5176\u8f6c\u6362\u540e\u7684\u7ed3\u679c&#xff09;\u8d4b\u503c\u7ed9\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cf driver&#xff0c;\u4ee5\u4fbf\u540e\u7eed\u4ee5\u7edf\u4e00\u7684\u65b9\u5f0f\u4f7f\u7528\u3002&#034;<\/p>\n<p>\u8003\u5bdf\u70b9: \u5bf9Go\u63a5\u53e3\u548c\u7ed3\u6784\u4f53\u7684\u7406\u89e3&#xff0c;\u63a5\u53e3\u5728\u8bbe\u8ba1\u4e2d\u7684\u4f5c\u7528&#xff08;\u62bd\u8c61\u3001\u89e3\u8026\u3001\u591a\u6001&#xff09;\u3002<\/p>\n<hr \/>\n<p>\u95ee\u9898 3: \u72b6\u6001\u7ba1\u7406\u4e0e\u5b89\u5168\u6027<\/p>\n<p>\u9762\u8bd5\u5b98: \u201c\u9a8c\u8bc1\u7801\u7684\u7b54\u6848\u662f\u5982\u4f55\u5b58\u50a8\u548c\u9a8c\u8bc1\u7684&#xff1f;\u5f53\u524d\u5b9e\u73b0\u4e2d\u4f7f\u7528\u7684 base64Captcha.DefaultMemStore \u6709\u4ec0\u4e48\u7279\u70b9&#xff1f;\u5982\u679c\u7cfb\u7edf\u9700\u8981\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u4e0a&#xff0c;\u8fd9\u79cd\u5b58\u50a8\u65b9\u5f0f\u4f1a\u6709\u4ec0\u4e48\u95ee\u9898&#xff1f;\u4f60\u4f1a\u5982\u4f55\u6539\u8fdb&#xff1f;\u201d<\/p>\n<p>\u6700\u4f73\u7b54\u6848\u793a\u4f8b:<\/p>\n<p>&#034;\u9a8c\u8bc1\u7801\u7684\u7b54\u6848\u662f\u5728\u8c03\u7528 c.Generate() \u65b9\u6cd5\u65f6&#xff0c;\u7531 base64Captcha \u5e93\u5185\u90e8\u5904\u7406\u7684\u3002\u5b83\u4f1a\u5c06\u751f\u6210\u7684\u9a8c\u8bc1\u7801ID\u4e0e\u5176\u5bf9\u5e94\u7684\u6b63\u786e\u7b54\u6848\u5b58\u50a8\u5728\u4f20\u9012\u7ed9 NewCaptcha \u51fd\u6570\u7684 Store \u5b9e\u4f8b\u4e2d\u3002\u5728\u9a8c\u8bc1\u65f6&#xff0c;Store.Verify(id, answer, clear) \u65b9\u6cd5\u4f1a\u6839\u636eID\u4ece\u5b58\u50a8\u4e2d\u53d6\u51fa\u6b63\u786e\u7b54\u6848&#xff0c;\u4e0e\u7528\u6237\u63d0\u4ea4\u7684\u7b54\u6848\u8fdb\u884c\u6bd4\u8f83\u3002clear \u53c2\u6570\u4e3a true \u8868\u793a\u9a8c\u8bc1\u540e&#xff08;\u65e0\u8bba\u6210\u529f\u4e0e\u5426&#xff09;\u90fd\u4f1a\u6e05\u9664\u8be5\u6761\u76ee&#xff0c;\u786e\u4fdd\u9a8c\u8bc1\u7801\u7684\u4e00\u6b21\u6027\u3002<\/p>\n<p>\u5f53\u524d\u4f7f\u7528\u7684 base64Captcha.DefaultMemStore \u662f\u4e00\u4e2a\u57fa\u4e8e\u5185\u5b58\u7684\u5b58\u50a8\u5b9e\u73b0\u3002<\/p>\n<ul>\n<li>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u901f\u5ea6\u5feb&#xff1a; \u6570\u636e\u5b58\u50a8\u5728\u5185\u5b58\u4e2d&#xff0c;\u8bfb\u5199\u975e\u5e38\u8fc5\u901f\u3002<\/li>\n<li>\u7b80\u5355&#xff1a; \u65e0\u9700\u5916\u90e8\u4f9d\u8d56&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/li>\n<li>\u6613\u5931\u6027&#xff1a; \u5f53\u5e94\u7528\u7a0b\u5e8f\u91cd\u542f\u6216\u5d29\u6e83\u65f6&#xff0c;\u5185\u5b58\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u4f1a\u4e22\u5931\u3002\u8fd9\u610f\u5473\u7740\u6240\u6709\u672a\u9a8c\u8bc1\u7684\u9a8c\u8bc1\u7801\u90fd\u4f1a\u5931\u6548\u3002<\/li>\n<li>\u5355\u5b9e\u4f8b&#xff1a; \u6570\u636e\u5b58\u50a8\u5728\u5f53\u524dGo\u5e94\u7528\u7a0b\u5e8f\u8fdb\u7a0b\u7684\u5185\u5b58\u4e2d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u591a\u670d\u52a1\u5668\u90e8\u7f72\u7684\u95ee\u9898&#xff1a; \u5982\u679c\u7cfb\u7edf\u90e8\u7f72\u5230\u591a\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u4e0a&#xff0c;\u5e76\u4e14\u8fd9\u4e9b\u5b9e\u4f8b\u5206\u522b\u5904\u7406\u7528\u6237\u8bf7\u6c42&#xff08;\u4f8b\u5982\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u5668\u5206\u53d1&#xff09;&#xff0c;DefaultMemStore \u4f1a\u5bfc\u81f4\u4e25\u91cd\u95ee\u9898&#xff1a;<\/p>\n<li>\u9a8c\u8bc1\u4e0d\u4e00\u81f4&#xff1a; \u7528\u6237\u83b7\u53d6\u9a8c\u8bc1\u7801\u7684\u8bf7\u6c42\u53ef\u80fd\u7531\u670d\u52a1\u5668A\u5904\u7406&#xff08;\u9a8c\u8bc1\u7801ID\u548c\u7b54\u6848\u5b58\u50a8\u5728A\u7684\u5185\u5b58\u4e2d&#xff09;&#xff0c;\u4f46\u63d0\u4ea4\u767b\u5f55\u8868\u5355\u7684\u8bf7\u6c42\u53ef\u80fd\u88ab\u5206\u53d1\u5230\u670d\u52a1\u5668B\u3002\u670d\u52a1\u5668B\u7684\u5185\u5b58\u4e2d\u6ca1\u6709\u8be5\u9a8c\u8bc1\u7801ID\u7684\u4fe1\u606f&#xff0c;\u5bfc\u81f4\u9a8c\u8bc1\u5fc5\u5b9a\u5931\u8d25\u3002<\/li>\n<li>\u65e0\u6cd5\u5171\u4eab\u72b6\u6001&#xff1a; \u6bcf\u4e2a\u5b9e\u4f8b\u90fd\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u5185\u5b58\u5b58\u50a8\u3002<\/li>\n<\/li>\n<li>\n<p>\u6539\u8fdb\u65b9\u6848&#xff1a; \u4e3a\u4e86\u89e3\u51b3\u591a\u670d\u52a1\u5668\u90e8\u7f72\u7684\u95ee\u9898&#xff0c;\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u5171\u4eab\u7684\u3001\u6301\u4e45\u5316\u7684\u5b58\u50a8\u540e\u7aef\u3002base64Captcha \u5e93\u5141\u8bb8\u6211\u4eec\u5b9e\u73b0\u5e76\u4f7f\u7528\u81ea\u5b9a\u4e49\u7684 Store \u63a5\u53e3\u3002\u5e38\u89c1\u7684\u6539\u8fdb\u65b9\u6848\u5305\u62ec&#xff1a;<\/p>\n<li>Redis&#xff1a; \u5c06\u9a8c\u8bc1\u7801ID\u548c\u7b54\u6848\u5b58\u50a8\u5728Redis\u4e2d\u3002Redis\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\u5185\u5b58\u952e\u503c\u6570\u636e\u5e93&#xff0c;\u652f\u6301\u5206\u5e03\u5f0f\u8bbf\u95ee&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u914d\u7f6e\u6301\u4e45\u5316\u3002\u8fd9\u662f\u975e\u5e38\u5e38\u89c1\u7684\u9009\u62e9\u3002<\/li>\n<li>\u6570\u636e\u5e93&#xff1a; \u5982MySQL, PostgreSQL\u7b49\u3002\u867d\u7136\u53ef\u80fd\u6bd4Redis\u6162\u4e00\u70b9&#xff0c;\u4f46\u5bf9\u4e8e\u67d0\u4e9b\u5e94\u7528\u573a\u666f\u4e5f\u662f\u53ef\u884c\u7684&#xff0c;\u7279\u522b\u662f\u5982\u679c\u5e94\u7528\u5df2\u7ecf\u5728\u4f7f\u7528\u8fd9\u4e9b\u6570\u636e\u5e93\u3002<\/li>\n<li>\u5176\u4ed6\u5206\u5e03\u5f0f\u7f13\u5b58\u670d\u52a1&#xff1a; \u5982Memcached\u3002<\/li>\n<p>\u5b9e\u73b0\u65b9\u5f0f\u662f\u5b9a\u4e49\u4e00\u4e2a\u65b0\u7684\u7ed3\u6784\u4f53&#xff0c;\u8ba9\u5b83\u5b9e\u73b0 base64Captcha.Store \u63a5\u53e3\u7684 Set(id string, value string) error, Get(id string, clear bool) string, \u548c Verify(id, answer string, clear bool) bool \u65b9\u6cd5&#xff0c;\u8fd9\u4e9b\u65b9\u6cd5\u5185\u90e8\u4f7f\u7528\u9009\u62e9\u7684\u5171\u4eab\u5b58\u50a8&#xff08;\u5982Redis\u5ba2\u6237\u7aef&#xff09;\u8fdb\u884c\u6570\u636e\u64cd\u4f5c\u3002&#034;<\/p>\n<\/li>\n<\/ul>\n<p>\u8003\u5bdf\u70b9: \u5bf9\u72b6\u6001\u7ba1\u7406\u3001\u5b58\u50a8\u673a\u5236\u7684\u7406\u89e3&#xff0c;\u5206\u5e03\u5f0f\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u8ba4\u77e5&#xff0c;\u4ee5\u53ca\u89e3\u51b3\u95ee\u9898\u7684\u80fd\u529b\u3002<\/p>\n<hr \/>\n<p>\u95ee\u9898 4: \u9519\u8bef\u5904\u7406\u4e0e\u5065\u58ee\u6027<\/p>\n<p>\u9762\u8bd5\u5b98: \u201c\u5728 LoginController \u7684 Captcha \u65b9\u6cd5\u4e2d&#xff0c;\u5bf9\u4e8e models.MakeCaptcha() \u53ef\u80fd\u8fd4\u56de\u7684\u9519\u8bef&#xff0c;\u5f53\u524d\u7684\u5904\u7406\u65b9\u5f0f\u662f fmt.Println(err)\u3002\u4f60\u8ba4\u4e3a\u8fd9\u79cd\u9519\u8bef\u5904\u7406\u65b9\u5f0f\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u662f\u5426\u5408\u9002&#xff1f;\u5982\u679c\u4e0d\u5408\u9002&#xff0c;\u4f60\u4f1a\u5982\u4f55\u6539\u8fdb&#xff1f;\u201d<\/p>\n<p>\u6700\u4f73\u7b54\u6848\u793a\u4f8b:<\/p>\n<p>&#034;\u5f53\u524d fmt.Println(err) \u7684\u9519\u8bef\u5904\u7406\u65b9\u5f0f\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u662f\u4e0d\u5408\u9002\u7684\u3002<\/p>\n<ul>\n<li>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<li>\u4fe1\u606f\u4e22\u5931&#xff1a; \u9519\u8bef\u4fe1\u606f\u4ec5\u8f93\u51fa\u5230\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa&#xff08;\u63a7\u5236\u53f0&#xff09;\u3002\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u6211\u4eec\u901a\u5e38\u65e0\u6cd5\u76f4\u63a5\u76d1\u63a7\u6bcf\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7684\u63a7\u5236\u53f0\u8f93\u51fa\u3002<\/li>\n<li>\u7f3a\u4e4f\u7ed3\u6784\u5316&#xff1a; \u7b80\u5355\u7684\u6253\u5370\u4e0d\u5229\u4e8e\u9519\u8bef\u7684\u8ffd\u8e2a\u3001\u805a\u5408\u548c\u5206\u6790\u3002<\/li>\n<li>\u7528\u6237\u4f53\u9a8c\u5dee&#xff1a; \u5982\u679c\u751f\u6210\u9a8c\u8bc1\u7801\u5931\u8d25&#xff0c;\u524d\u7aef\u53ef\u80fd\u5f97\u4e0d\u5230\u6b63\u786e\u7684\u54cd\u5e94\u6216\u8005\u5f97\u5230\u4e00\u4e2a\u4e0d\u5b8c\u6574\u7684\u54cd\u5e94&#xff0c;\u7528\u6237\u53ef\u80fd\u4f1a\u770b\u5230\u4e00\u4e2a\u635f\u574f\u7684\u56fe\u7247\u6216\u529f\u80fd\u5f02\u5e38&#xff0c;\u4f46\u540e\u7aef\u6ca1\u6709\u7ed9\u524d\u7aef\u4e00\u4e2a\u660e\u786e\u7684\u9519\u8bef\u6307\u793a\u3002<\/li>\n<li>\u65e0\u6cd5\u544a\u8b66&#xff1a; \u65e0\u6cd5\u57fa\u4e8e\u8fd9\u7c7b\u9519\u8bef\u8bbe\u7f6e\u6709\u6548\u7684\u76d1\u63a7\u548c\u544a\u8b66\u673a\u5236\u3002<\/li>\n<\/li>\n<li>\n<p>\u6539\u8fdb\u5efa\u8bae&#xff1a;<\/p>\n<li>\u4f7f\u7528\u7ed3\u6784\u5316\u65e5\u5fd7&#xff1a; \u5f15\u5165\u4e00\u4e2a\u6210\u719f\u7684\u65e5\u5fd7\u5e93&#xff08;\u5982 logrus, zap, \u6216Go\u6807\u51c6\u5e93\u7684 log\/slog (Go 1.21&#043;)&#xff09;\u3002\u5c06\u9519\u8bef\u4fe1\u606f\u4ee5\u7ed3\u6784\u5316\u7684\u683c\u5f0f&#xff08;\u5982JSON&#xff09;\u8bb0\u5f55\u4e0b\u6765&#xff0c;\u5305\u542b\u65f6\u95f4\u6233\u3001\u9519\u8bef\u7ea7\u522b\u3001\u9519\u8bef\u4fe1\u606f\u3001\u8bf7\u6c42\u4e0a\u4e0b\u6587&#xff08;\u5982\u7528\u6237ID\u3001\u8bf7\u6c42ID\u7b49&#xff0c;\u5982\u679c\u9002\u7528&#xff09;\u3002<span class=\"token comment\">\/\/ \u793a\u4f8b\u4f7f\u7528 log\/slog<\/span><br \/>\n<span class=\"token keyword\">if<\/span> err <span class=\"token operator\">!&#061;<\/span> <span class=\"token boolean\">nil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    slog<span class=\"token punctuation\">.<\/span><span class=\"token function\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Failed to make captcha&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;error&#034;<\/span><span class=\"token punctuation\">,<\/span> err<span class=\"token punctuation\">.<\/span><span class=\"token function\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;requestId&#034;<\/span><span class=\"token punctuation\">,<\/span> c<span class=\"token punctuation\">.<\/span><span class=\"token function\">GetString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;X-Request-ID&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ \u5047\u8bbe\u6709\u8bf7\u6c42ID<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\u5411\u4e0a\u5c42\u8fd4\u56de\u9519\u8bef\u6216\u7279\u5b9a\u54cd\u5e94&#xff1a;\n<ul>\n<li>\u5982\u679c\u9519\u8bef\u662f\u53ef\u6062\u590d\u7684\u6216\u9700\u8981\u524d\u7aef\u7279\u6b8a\u5904\u7406\u7684&#xff0c;\u5e94\u8be5\u5c06\u9519\u8bef\u4fe1\u606f\u6216\u8005\u4e00\u4e2a\u7279\u5b9a\u7684\u9519\u8bef\u72b6\u6001\u7801\u548c\u9519\u8bef\u6d88\u606f\u8fd4\u56de\u7ed9\u524d\u7aef\u3002\u4f8b\u5982&#xff0c;\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u9519\u8bef\u4fe1\u606f\u7684JSON\u54cd\u5e94&#xff1a;<span class=\"token keyword\">if<\/span> err <span class=\"token operator\">!&#061;<\/span> <span class=\"token boolean\">nil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ log.Error(&#8230;) \/\/ \u8bb0\u5f55\u65e5\u5fd7<\/span><br \/>\n    c<span class=\"token punctuation\">.<\/span><span class=\"token function\">JSON<\/span><span class=\"token punctuation\">(<\/span>http<span class=\"token punctuation\">.<\/span>StatusInternalServerError<span class=\"token punctuation\">,<\/span> gin<span class=\"token punctuation\">.<\/span>H<span class=\"token punctuation\">{<\/span> <span class=\"token comment\">\/\/ \u6216\u8005\u66f4\u5177\u4f53\u7684\u9519\u8bef\u7801<\/span><br \/>\n        <span class=\"token string\">&#034;error&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Failed to generate captcha. Please try again.&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token comment\">\/\/ \u7ec8\u6b62\u540e\u7eed\u5904\u7406<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>\n <\/li>\n<li>\u8fd9\u6837\u524d\u7aef\u53ef\u4ee5\u6839\u636e\u54cd\u5e94\u6765\u63d0\u793a\u7528\u6237\u6216\u6267\u884c\u91cd\u8bd5\u903b\u8f91\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u9519\u8bef\u76d1\u63a7\u4e0e\u544a\u8b66&#xff1a; \u5c06\u7ed3\u6784\u5316\u7684\u65e5\u5fd7\u63a5\u5165\u5230\u96c6\u4e2d\u5f0f\u7684\u65e5\u5fd7\u7ba1\u7406\u7cfb\u7edf&#xff08;\u5982ELK Stack, Splunk, Grafana Loki&#xff09;\u548c\u9519\u8bef\u76d1\u63a7\u5e73\u53f0&#xff08;\u5982Sentry, Bugsnag&#xff09;\u3002\u8fd9\u6837\u53ef\u4ee5\u5bf9\u9519\u8bef\u8fdb\u884c\u805a\u5408\u3001\u5206\u6790&#xff0c;\u5e76\u8bbe\u7f6e\u544a\u8b66&#xff0c;\u5f53\u9519\u8bef\u7387\u8d85\u8fc7\u9608\u503c\u65f6\u53ca\u65f6\u901a\u77e5\u5f00\u53d1\u6216\u8fd0\u7ef4\u4eba\u5458\u3002<\/li>\n<li>\u4f18\u96c5\u964d\u7ea7&#xff08;\u53ef\u9009&#xff09;&#xff1a; \u5bf9\u4e8e\u67d0\u4e9b\u975e\u6838\u5fc3\u529f\u80fd\u7684\u9519\u8bef&#xff0c;\u53ef\u4ee5\u8003\u8651\u4f18\u96c5\u964d\u7ea7\u3002\u4f46\u5bf9\u4e8e\u9a8c\u8bc1\u7801\u8fd9\u79cd\u5b89\u5168\u76f8\u5173\u7684\u529f\u80fd&#xff0c;\u901a\u5e38\u662f\u786c\u5931\u8d25&#xff0c;\u5373\u751f\u6210\u5931\u8d25\u5c31\u4e0d\u80fd\u7ee7\u7eed\u3002<\/li>\n<\/li>\n<\/ul>\n<p>\u603b\u7ed3\u6765\u8bf4&#xff0c;\u751f\u4ea7\u73af\u5883\u7684\u9519\u8bef\u5904\u7406\u5e94\u8be5\u5173\u6ce8\u65e5\u5fd7\u7684\u5b8c\u6574\u6027\u3001\u7ed3\u6784\u5316\u3001\u53ef\u8ffd\u6eaf\u6027&#xff0c;\u4ee5\u53ca\u5bf9\u7528\u6237\u548c\u8fd0\u7ef4\u7684\u53cb\u597d\u6027\u3002&#034;<\/p>\n<p>\u8003\u5bdf\u70b9: \u5bf9\u9519\u8bef\u5904\u7406\u91cd\u8981\u6027\u7684\u8ba4\u8bc6&#xff0c;\u751f\u4ea7\u73af\u5883\u65e5\u5fd7\u548c\u76d1\u63a7\u7684\u6700\u4f73\u5b9e\u8df5&#xff0c;\u4ee5\u53ca\u4ee3\u7801\u5065\u58ee\u6027\u7684\u601d\u8003\u3002<\/p>\n<hr \/>\n<p>\u95ee\u9898 5: \u6269\u5c55\u6027\u4e0e\u53ef\u7ef4\u62a4\u6027<\/p>\n<p>\u9762\u8bd5\u5b98: \u201c\u5047\u8bbe\u73b0\u5728\u4ea7\u54c1\u8981\u6c42\u652f\u6301\u591a\u79cd\u7c7b\u578b\u7684\u9a8c\u8bc1\u7801&#xff0c;\u6bd4\u5982\u9664\u4e86\u5f53\u524d\u7684\u5b57\u7b26\u4e32\u9a8c\u8bc1\u7801&#xff0c;\u8fd8\u9700\u8981\u652f\u6301\u6570\u5b66\u516c\u5f0f\u9a8c\u8bc1\u7801&#xff08;\u4f8b\u5982 \u20182 &#043; 3 &#061; ?\u2019&#xff09;\u3002\u57fa\u4e8e\u73b0\u6709\u7684\u8bbe\u8ba1&#xff0c;\u4f60\u8ba4\u4e3a\u9700\u8981\u505a\u54ea\u4e9b\u6539\u52a8\u6765\u5b9e\u73b0\u8fd9\u4e2a\u9700\u6c42&#xff1f;\u6539\u52a8\u4f1a\u4e3b\u8981\u96c6\u4e2d\u5728\u54ea\u4e9b\u90e8\u5206&#xff1f;\u201d<\/p>\n<p>\u6700\u4f73\u7b54\u6848\u793a\u4f8b:<\/p>\n<p>&#034;\u57fa\u4e8e\u73b0\u6709\u7684\u8bbe\u8ba1&#xff0c;\u7279\u522b\u662f base64Captcha.Driver \u63a5\u53e3\u7684\u4f7f\u7528&#xff0c;\u5b9e\u73b0\u5bf9\u591a\u79cd\u7c7b\u578b\u9a8c\u8bc1\u7801\u7684\u652f\u6301\u662f\u76f8\u5bf9\u5bb9\u6613\u7684&#xff0c;\u6539\u52a8\u4f1a\u6bd4\u8f83\u96c6\u4e2d\u4e14\u5f71\u54cd\u8f83\u5c0f&#xff1a;<\/p>\n<li>\n<p>\u5b9e\u73b0\u65b0\u7684 Driver&#xff1a;<\/p>\n<ul>\n<li>\u6211\u4eec\u9700\u8981\u4e3a\u6570\u5b66\u516c\u5f0f\u9a8c\u8bc1\u7801\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7ed3\u6784\u4f53&#xff0c;\u4f8b\u5982 DriverMath\u3002<\/li>\n<li>\u8fd9\u4e2a DriverMath \u7ed3\u6784\u4f53\u5fc5\u987b\u5b9e\u73b0 base64Captcha.Driver \u63a5\u53e3\u6240\u5b9a\u4e49\u7684\u6240\u6709\u65b9\u6cd5\u3002\u8fd9\u53ef\u80fd\u5305\u62ec&#xff1a;\n<ul>\n<li>DrawCaptcha(content string) (item Item, err error): \u7ed8\u5236\u5305\u542b\u6570\u5b66\u516c\u5f0f\u7684\u56fe\u7247\u3002<\/li>\n<li>GenerateIdQuestionAnswer() (id, q, a string): \u751f\u6210\u552f\u4e00\u7684ID&#xff0c;\u6570\u5b66\u95ee\u9898\u5b57\u7b26\u4e32&#xff08;\u5982 \u201c2&#043;3\u201d&#xff09;&#xff0c;\u4ee5\u53ca\u6b63\u786e\u7b54\u6848\u5b57\u7b26\u4e32&#xff08;\u5982 \u201c5\u201d&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8fd9\u4e2a\u65b0\u7684 DriverMath \u7ed3\u6784\u4f53\u4e5f\u53ef\u4ee5\u6709\u81ea\u5df1\u7684\u914d\u7f6e\u5b57\u6bb5&#xff0c;\u6bd4\u5982\u6570\u5b57\u8303\u56f4\u3001\u64cd\u4f5c\u7b26\u7c7b\u578b\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4fee\u6539 models.MakeCaptcha (\u6216\u65b0\u589e\u7c7b\u4f3c\u51fd\u6570):<\/p>\n<ul>\n<li>\u65b9\u6848\u4e00 (\u4fee\u6539\u73b0\u6709\u51fd\u6570&#xff0c;\u589e\u52a0\u7c7b\u578b\u53c2\u6570): \u6211\u4eec\u53ef\u4ee5\u7ed9 MakeCaptcha \u51fd\u6570\u589e\u52a0\u4e00\u4e2a\u53c2\u6570&#xff0c;\u7528\u4e8e\u6307\u5b9a\u8981\u751f\u6210\u7684\u9a8c\u8bc1\u7801\u7c7b\u578b\u3002<span class=\"token keyword\">func<\/span> <span class=\"token function\">MakeCaptcha<\/span><span class=\"token punctuation\">(<\/span>captchaType <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">var<\/span> driver base64Captcha<span class=\"token punctuation\">.<\/span>Driver<br \/>\n    <span class=\"token keyword\">switch<\/span> captchaType <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;string&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        driverString <span class=\"token operator\">:&#061;<\/span> base64Captcha<span class=\"token punctuation\">.<\/span>DriverString<span class=\"token punctuation\">{<\/span><span class=\"token comment\">\/*&#8230;\u914d\u7f6e&#8230;*\/<\/span><span class=\"token punctuation\">}<\/span><br \/>\n        driver <span class=\"token operator\">&#061;<\/span> driverString<span class=\"token punctuation\">.<\/span><span class=\"token function\">ConvertFonts<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;math&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        driverMath <span class=\"token operator\">:&#061;<\/span> NewDriverMath<span class=\"token punctuation\">{<\/span><span class=\"token comment\">\/*&#8230;\u914d\u7f6e&#8230;*\/<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token comment\">\/\/ \u5047\u8bbe\u6211\u4eec\u521b\u5efa\u4e86 NewDriverMath<\/span><br \/>\n        driver <span class=\"token operator\">&#061;<\/span> driverMath <span class=\"token comment\">\/\/ \u6216\u8005 driverMath.ConvertFonts() \u5982\u679c\u9700\u8981<\/span><br \/>\n    <span class=\"token keyword\">default<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> fmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">Errorf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;unsupported captcha type: %s&#034;<\/span><span class=\"token punctuation\">,<\/span> captchaType<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    c <span class=\"token operator\">:&#061;<\/span> base64Captcha<span class=\"token punctuation\">.<\/span><span class=\"token function\">NewCaptcha<\/span><span class=\"token punctuation\">(<\/span>driver<span class=\"token punctuation\">,<\/span> store<span class=\"token punctuation\">)<\/span><br \/>\n    id<span class=\"token punctuation\">,<\/span> b64s<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">_<\/span><span class=\"token punctuation\">,<\/span> err <span class=\"token operator\">:&#061;<\/span> c<span class=\"token punctuation\">.<\/span><span class=\"token function\">Generate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> id<span class=\"token punctuation\">,<\/span> b64s<span class=\"token punctuation\">,<\/span> err<br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n \u76f8\u5e94\u7684&#xff0c;Controller\u8c03\u7528\u65f6\u4e5f\u9700\u8981\u4f20\u9012\u7c7b\u578b\u53c2\u6570\u3002<\/li>\n<li>\u65b9\u6848\u4e8c (\u4e3a\u6bcf\u79cd\u7c7b\u578b\u63d0\u4f9b\u5355\u72ec\u7684\u751f\u6210\u51fd\u6570): \u53ef\u4ee5\u4fdd\u7559\u73b0\u6709\u7684 MakeStringCaptcha&#xff0c;\u5e76\u65b0\u589e MakeMathCaptcha \u7b49\u3002<span class=\"token keyword\">func<\/span> <span class=\"token function\">MakeStringCaptcha<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">\/* &#8230;\u73b0\u6709\u903b\u8f91&#8230; *\/<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token keyword\">func<\/span> <span class=\"token function\">MakeMathCaptcha<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">error<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token comment\">\/* &#8230;\u4f7f\u7528 DriverMath \u7684\u903b\u8f91&#8230; *\/<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n Controller\u6839\u636e\u524d\u7aef\u8bf7\u6c42\u6216\u5176\u4ed6\u4e1a\u52a1\u903b\u8f91\u51b3\u5b9a\u8c03\u7528\u54ea\u4e2a\u751f\u6210\u51fd\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4fee\u6539 LoginController.Captcha (\u5982\u679c\u91c7\u7528\u65b9\u6848\u4e00):<\/p>\n<ul>\n<li>Controller\u7684 Captcha \u65b9\u6cd5\u53ef\u80fd\u9700\u8981\u4ece\u524d\u7aef\u8bf7\u6c42\u4e2d\u83b7\u53d6\u671f\u671b\u7684\u9a8c\u8bc1\u7801\u7c7b\u578b&#xff0c;\u6216\u8005\u6839\u636e\u914d\u7f6e\u6765\u51b3\u5b9a\u3002<\/li>\n<li>\u7136\u540e\u5c06\u8fd9\u4e2a\u7c7b\u578b\u4f20\u9012\u7ed9 models.MakeCaptcha(type)\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u524d\u7aef\u7684\u9002\u914d (\u53ef\u9009\u4f46\u901a\u5e38\u9700\u8981):<\/p>\n<ul>\n<li>\u5982\u679c\u4e0d\u540c\u7c7b\u578b\u7684\u9a8c\u8bc1\u7801\u5728\u524d\u7aef\u7684\u5c55\u793a\u6216\u4ea4\u4e92\u65b9\u5f0f\u4e0d\u540c&#xff08;\u4f8b\u5982&#xff0c;\u6570\u5b66\u516c\u5f0f\u9a8c\u8bc1\u7801\u53ef\u80fd\u65c1\u8fb9\u76f4\u63a5\u663e\u793a\u95ee\u9898&#xff0c;\u7528\u6237\u8f93\u5165\u7b54\u6848&#xff09;&#xff0c;\u524d\u7aef\u53ef\u80fd\u4e5f\u9700\u8981\u505a\u76f8\u5e94\u8c03\u6574\u3002<\/li>\n<li>\u5982\u679c\u53ea\u662f\u540e\u7aef\u751f\u6210\u4e0d\u540c\u7c7b\u578b\u7684\u56fe\u7247&#xff0c;\u800c\u7528\u6237\u4ea4\u4e92\u4e0d\u53d8&#xff08;\u90fd\u662f\u8f93\u5165\u770b\u5230\u7684\u5b57\u7b26\/\u6570\u5b57&#xff09;&#xff0c;\u524d\u7aef\u6539\u52a8\u53ef\u80fd\u8f83\u5c0f\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u6539\u52a8\u4e3b\u8981\u96c6\u4e2d\u5728&#xff1a;<\/p>\n<ul>\n<li>models \u5305&#xff1a; \u9700\u8981\u65b0\u589e\u5177\u4f53\u7684 Driver \u5b9e\u73b0 (\u5982 DriverMath)&#xff0c;\u5e76\u8c03\u6574\u6216\u65b0\u589e\u9a8c\u8bc1\u7801\u7684\u751f\u6210\u51fd\u6570\u3002<\/li>\n<li>controllers \u5305 (\u5c11\u91cf)&#xff1a; \u53ef\u80fd\u9700\u8981\u4fee\u6539 Captcha Controller\u65b9\u6cd5&#xff0c;\u4ee5\u5904\u7406\u4e0d\u540c\u7c7b\u578b\u7684\u8bf7\u6c42\u6216\u4f20\u9012\u7c7b\u578b\u53c2\u6570\u3002<\/li>\n<li>\u914d\u7f6e (\u5982\u679c\u9700\u8981\u52a8\u6001\u5207\u6362\u6216\u6709\u591a\u79cd\u914d\u7f6e)&#xff1a; \u53ef\u80fd\u9700\u8981\u5f15\u5165\u914d\u7f6e\u6587\u4ef6\u6216\u73af\u5883\u53d8\u91cf\u6765\u7ba1\u7406\u4e0d\u540c\u7c7b\u578b\u9a8c\u8bc1\u7801\u7684\u9ed8\u8ba4\u9009\u9879\u3002<\/li>\n<\/ul>\n<p>\u6838\u5fc3\u7684 base64Captcha.NewCaptcha \u548c Store \u90e8\u5206\u57fa\u672c\u4e0d\u9700\u8981\u6539\u52a8&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u4f9d\u8d56\u7684\u662f\u62bd\u8c61\u7684 Driver \u63a5\u53e3&#xff0c;\u8fd9\u5c31\u662f\u63a5\u53e3\u8bbe\u8ba1\u5e26\u6765\u7684\u597d\u5904\u3002&#034;<\/p>\n<p>\u8003\u5bdf\u70b9: \u5bf9\u73b0\u6709\u8bbe\u8ba1\u4f18\u70b9\u7684\u7406\u89e3&#xff08;\u63a5\u53e3\u5e26\u6765\u7684\u6269\u5c55\u6027&#xff09;&#xff0c;\u5b9e\u9645\u9700\u6c42\u53d8\u66f4\u65f6\u7684\u5206\u6790\u548c\u8bbe\u8ba1\u80fd\u529b&#xff0c;\u4ee3\u7801\u7ec4\u7ec7\u548c\u6a21\u5757\u5316\u601d\u8003\u3002<\/p>\n<hr \/>\n<p>\u8fd9\u4e9b\u95ee\u9898\u4ece\u57fa\u7840\u6982\u5ff5\u3001\u8bbe\u8ba1\u6a21\u5f0f\u3001\u5b9e\u9645\u90e8\u7f72\u3001\u4ee3\u7801\u8d28\u91cf\u5230\u7cfb\u7edf\u6269\u5c55\u6027\u7b49\u591a\u4e2a\u89d2\u5ea6\u5bf9\u5019\u9009\u4eba\u8fdb\u884c\u8003\u5bdf&#xff0c;\u80fd\u591f\u6bd4\u8f83\u5168\u9762\u5730\u4e86\u89e3\u5176\u6280\u672f\u6c34\u5e73\u548c\u7ecf\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb689\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5b83\u5b9a\u4e49\u4e86\u4e00\u5957\u89c4\u8303\u6216\u5951\u7ea6\uff0c\u89c4\u5b9a\u4e86\u4e00\u4e2a\u201c\u9a8c\u8bc1\u7801\u9a71\u52a8\u201d\u5e94\u8be5\u5177\u5907\u54ea\u4e9b\u884c\u4e3a\uff08\u65b9\u6cd5\uff09\uff0c\u6bd4\u5982\u7ed8\u5236\u9a8c\u8bc1\u7801\u3001\u751f\u6210\u95ee\u9898\u548c\u7b54\u6848\u7b49\u3002\u5bf9\u73b0\u6709\u8bbe\u8ba1\u4f18\u70b9\u7684\u7406\u89e3\uff08\u63a5\u53e3\u5e26\u6765\u7684\u6269\u5c55\u6027\uff09\uff0c\u5b9e\u9645\u9700\u6c42\u53d8\u66f4\u65f6\u7684\u5206\u6790\u548c\u8bbe\u8ba1\u80fd\u529b\uff0c\u4ee3\u7801\u7ec4\u7ec7\u548c\u6a21\u5757\u5316\u601d\u8003\u3002\u603b\u7ed3\u6765\u8bf4\uff0c\u751f\u4ea7\u73af\u5883\u7684\u9519\u8bef\u5904\u7406\u5e94\u8be5\u5173\u6ce8\u65e5\u5fd7\u7684\u5b8c\u6574\u6027\u3001\u7ed3\u6784\u5316\u3001\u53ef\u8ffd\u6eaf\u6027\uff0c\u4ee5\u53ca\u5bf9\u7528\u6237\u548c\u8fd0\u7ef4\u7684\u53cb\u597d\u6027\u3002\u5bf9\u72b6\u6001\u7ba1\u7406\u3001\u5b58\u50a8\u673a\u5236\u7684\u7406\u89e3\uff0c\u5206\u5e03\u5f0f\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u8ba4\u77e5\uff0c\u4ee5\u53ca\u89e3\u51b3\u95ee\u9898\u7684\u80fd\u529b\u3002\u5bf9\u9519\u8bef\u5904\u7406\u91cd\u8981\u6027\u7684\u8ba4\u8bc6\uff0c\u751f\u4ea7\u73af\u5883\u65e5\u5fd7\u548c\u76d1\u63a7\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4ee5\u53ca\u4ee3\u7801\u5065\u58ee\u6027\u7684\u601d\u8003\u3002\u4f60\u597d\uff0c\u6211\u770b\u4e86\u4f60\u9879\u76ee\u4e2d\u7684\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[746,3415,176],"topic":[],"class_list":["post-38594","post","type-post","status-publish","format-standard","hentry","category-server","tag-golang","tag-goai","tag-176"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \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\/38594.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb689\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5b83\u5b9a\u4e49\u4e86\u4e00\u5957\u89c4\u8303\u6216\u5951\u7ea6\uff0c\u89c4\u5b9a\u4e86\u4e00\u4e2a\u201c\u9a8c\u8bc1\u7801\u9a71\u52a8\u201d\u5e94\u8be5\u5177\u5907\u54ea\u4e9b\u884c\u4e3a\uff08\u65b9\u6cd5\uff09\uff0c\u6bd4\u5982\u7ed8\u5236\u9a8c\u8bc1\u7801\u3001\u751f\u6210\u95ee\u9898\u548c\u7b54\u6848\u7b49\u3002\u5bf9\u73b0\u6709\u8bbe\u8ba1\u4f18\u70b9\u7684\u7406\u89e3\uff08\u63a5\u53e3\u5e26\u6765\u7684\u6269\u5c55\u6027\uff09\uff0c\u5b9e\u9645\u9700\u6c42\u53d8\u66f4\u65f6\u7684\u5206\u6790\u548c\u8bbe\u8ba1\u80fd\u529b\uff0c\u4ee3\u7801\u7ec4\u7ec7\u548c\u6a21\u5757\u5316\u601d\u8003\u3002\u603b\u7ed3\u6765\u8bf4\uff0c\u751f\u4ea7\u73af\u5883\u7684\u9519\u8bef\u5904\u7406\u5e94\u8be5\u5173\u6ce8\u65e5\u5fd7\u7684\u5b8c\u6574\u6027\u3001\u7ed3\u6784\u5316\u3001\u53ef\u8ffd\u6eaf\u6027\uff0c\u4ee5\u53ca\u5bf9\u7528\u6237\u548c\u8fd0\u7ef4\u7684\u53cb\u597d\u6027\u3002\u5bf9\u72b6\u6001\u7ba1\u7406\u3001\u5b58\u50a8\u673a\u5236\u7684\u7406\u89e3\uff0c\u5206\u5e03\u5f0f\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u8ba4\u77e5\uff0c\u4ee5\u53ca\u89e3\u51b3\u95ee\u9898\u7684\u80fd\u529b\u3002\u5bf9\u9519\u8bef\u5904\u7406\u91cd\u8981\u6027\u7684\u8ba4\u8bc6\uff0c\u751f\u4ea7\u73af\u5883\u65e5\u5fd7\u548c\u76d1\u63a7\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4ee5\u53ca\u4ee3\u7801\u5065\u58ee\u6027\u7684\u601d\u8003\u3002\u4f60\u597d\uff0c\u6211\u770b\u4e86\u4f60\u9879\u76ee\u4e2d\u7684\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/38594.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-20T09:43:57+00:00\" \/>\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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/38594.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/38594.html\",\"name\":\"Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-20T09:43:57+00:00\",\"dateModified\":\"2025-05-20T09:43:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/38594.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/38594.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/38594.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go\u7535\u5546\u9879\u76ee--Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757\"}]},{\"@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":"Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \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\/38594.html","og_locale":"zh_CN","og_type":"article","og_title":"Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb689\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5b83\u5b9a\u4e49\u4e86\u4e00\u5957\u89c4\u8303\u6216\u5951\u7ea6\uff0c\u89c4\u5b9a\u4e86\u4e00\u4e2a\u201c\u9a8c\u8bc1\u7801\u9a71\u52a8\u201d\u5e94\u8be5\u5177\u5907\u54ea\u4e9b\u884c\u4e3a\uff08\u65b9\u6cd5\uff09\uff0c\u6bd4\u5982\u7ed8\u5236\u9a8c\u8bc1\u7801\u3001\u751f\u6210\u95ee\u9898\u548c\u7b54\u6848\u7b49\u3002\u5bf9\u73b0\u6709\u8bbe\u8ba1\u4f18\u70b9\u7684\u7406\u89e3\uff08\u63a5\u53e3\u5e26\u6765\u7684\u6269\u5c55\u6027\uff09\uff0c\u5b9e\u9645\u9700\u6c42\u53d8\u66f4\u65f6\u7684\u5206\u6790\u548c\u8bbe\u8ba1\u80fd\u529b\uff0c\u4ee3\u7801\u7ec4\u7ec7\u548c\u6a21\u5757\u5316\u601d\u8003\u3002\u603b\u7ed3\u6765\u8bf4\uff0c\u751f\u4ea7\u73af\u5883\u7684\u9519\u8bef\u5904\u7406\u5e94\u8be5\u5173\u6ce8\u65e5\u5fd7\u7684\u5b8c\u6574\u6027\u3001\u7ed3\u6784\u5316\u3001\u53ef\u8ffd\u6eaf\u6027\uff0c\u4ee5\u53ca\u5bf9\u7528\u6237\u548c\u8fd0\u7ef4\u7684\u53cb\u597d\u6027\u3002\u5bf9\u72b6\u6001\u7ba1\u7406\u3001\u5b58\u50a8\u673a\u5236\u7684\u7406\u89e3\uff0c\u5206\u5e03\u5f0f\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u8ba4\u77e5\uff0c\u4ee5\u53ca\u89e3\u51b3\u95ee\u9898\u7684\u80fd\u529b\u3002\u5bf9\u9519\u8bef\u5904\u7406\u91cd\u8981\u6027\u7684\u8ba4\u8bc6\uff0c\u751f\u4ea7\u73af\u5883\u65e5\u5fd7\u548c\u76d1\u63a7\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4ee5\u53ca\u4ee3\u7801\u5065\u58ee\u6027\u7684\u601d\u8003\u3002\u4f60\u597d\uff0c\u6211\u770b\u4e86\u4f60\u9879\u76ee\u4e2d\u7684\u8fd9\u4e2a\u9a8c\u8bc1\u7801\u6a21\u5757\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/38594.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-20T09:43:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/38594.html","url":"https:\/\/www.wsisp.com\/helps\/38594.html","name":"Go\u7535\u5546\u9879\u76ee-Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-20T09:43:57+00:00","dateModified":"2025-05-20T09:43:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/38594.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/38594.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/38594.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Go\u7535\u5546\u9879\u76ee--Ai\u6a21\u62df\u9762\u8bd5\uff1a\u9a8c\u8bc1\u7801\u6a21\u5757"}]},{"@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\/38594","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=38594"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/38594\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=38594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=38594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=38594"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=38594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}