{"id":991,"date":"2025-01-16T00:40:12","date_gmt":"2025-01-15T16:40:12","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=991"},"modified":"2025-01-16T00:40:12","modified_gmt":"2025-01-15T16:40:12","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-go-%e6%9e%84%e5%bb%ba%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8e-otp-%e7%9a%84%e8%ba%ab%e4%bb%bd%e9%aa%8c%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/01\/16\/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-go-%e6%9e%84%e5%bb%ba%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8e-otp-%e7%9a%84%e8%ba%ab%e4%bb%bd%e9%aa%8c%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Go \u6784\u5efa\u4e00\u4e2a\u57fa\u4e8e OTP \u7684\u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u57fa\u4e8e\u4e00\u6b21\u6027\u5bc6\u7801\uff08OTP\uff0cOne-Time Password\uff09\u7684\u8eab\u4efd\u9a8c\u8bc1\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5b89\u5168\u63aa\u65bd\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u591a\u56e0\u7d20\u8eab\u4efd\u9a8c\u8bc1\uff08MFA\uff09\u4e2d\uff0c\u4ee5\u63d0\u9ad8\u7528\u6237\u8d26\u6237\u7684\u5b89\u5168\u6027\u3002OTP \u662f\u4e00\u79cd\u77ed\u65f6\u95f4\u6709\u6548\u7684\u5bc6\u7801\uff0c\u5b83\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21\uff0c\u6709\u6548\u671f\u901a\u5e38\u5f88\u77ed\uff08\u4f8b\u5982 30 \u79d2\uff09\u3002\u5728 Go \u4e2d\u5b9e\u73b0 OTP \u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668\u53ef\u4ee5\u4f7f\u7528\u73b0\u6210\u7684\u5e93\uff0c\u5982 <code>github.com\/pquerna\/otp<\/code>\uff0c\u6765\u751f\u6210\u548c\u9a8c\u8bc1 OTP\u3002<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Go \u6784\u5efa\u4e00\u4e2a\u57fa\u4e8e OTP \u7684\u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668\uff0c\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4ec0\u4e48\u662f OTP\uff1f<\/li>\n\n\n\n<li>\u4f7f\u7528 OTP \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u7684\u5de5\u4f5c\u539f\u7406<\/li>\n\n\n\n<li>\u5982\u4f55\u5728 Go \u4e2d\u751f\u6210\u548c\u9a8c\u8bc1 OTP<\/li>\n\n\n\n<li>\u6784\u5efa OTP \u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668\u7684\u6b65\u9aa4<\/li>\n\n\n\n<li>\u5b9e\u73b0\u57fa\u4e8e TOTP\uff08\u65f6\u95f4\u4e00\u6b21\u6027\u5bc6\u7801\uff09\u548c HOTP\uff08\u8ba1\u6570\u4e00\u6b21\u6027\u5bc6\u7801\uff09\u7684\u8eab\u4efd\u9a8c\u8bc1<\/li>\n\n\n\n<li>\u5b9e\u9645\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>\u4ec0\u4e48\u662f OTP\uff1f<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">OTP\uff08\u4e00\u6b21\u6027\u5bc6\u7801\uff09\u662f\u4e00\u79cd\u57fa\u4e8e\u65f6\u95f4\u6216\u8ba1\u6570\u5668\u751f\u6210\u7684\u52a8\u6001\u5bc6\u7801\u3002OTP \u7684\u7279\u70b9\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5355\u6b21\u4f7f\u7528<\/strong>\uff1a\u6bcf\u6b21\u751f\u6210\u7684 OTP \u90fd\u662f\u552f\u4e00\u7684\uff0c\u4e14\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21\u3002<\/li>\n\n\n\n<li><strong>\u77ed\u65f6\u6709\u6548<\/strong>\uff1aOTP \u901a\u5e38\u6709\u6548\u671f\u5f88\u77ed\uff08\u5982 30 \u79d2\u6216 60 \u79d2\uff09\uff0c\u786e\u4fdd\u5bc6\u7801\u4e0d\u4f1a\u957f\u65f6\u95f4\u88ab\u6076\u610f\u4f7f\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">OTP \u5e38\u7528\u4e8e\u53cc\u56e0\u7d20\u8ba4\u8bc1\uff082FA\uff09\u548c\u591a\u56e0\u7d20\u8ba4\u8bc1\uff08MFA\uff09\u4e2d\uff0c\u901a\u5e38\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u8ba4\u8bc1\u6b65\u9aa4\u6765\u589e\u5f3a\u5b89\u5168\u6027\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>OTP \u7684\u5de5\u4f5c\u539f\u7406<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">OTP \u901a\u5e38\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u751f\u6210\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>TOTP\uff08\u65f6\u95f4\u4e00\u6b21\u6027\u5bc6\u7801\uff09<\/strong>\uff1a\u57fa\u4e8e\u5f53\u524d\u65f6\u95f4\u548c\u5bc6\u94a5\u751f\u6210 OTP\u3002TOTP \u4f7f\u7528\u6807\u51c6\u7684\u65f6\u95f4\u7a97\u53e3\uff08\u901a\u5e38\u4e3a 30 \u79d2\uff09\uff0c\u56e0\u6b64\u5373\u4f7f OTP \u88ab\u7a83\u53d6\uff0c\u653b\u51fb\u8005\u4e5f\u5f88\u96be\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u5b83\u5728\u77ed\u65f6\u95f4\u5185\u4f1a\u8fc7\u671f\u3002<\/li>\n\n\n\n<li><strong>HOTP\uff08\u8ba1\u6570\u4e00\u6b21\u6027\u5bc6\u7801\uff09<\/strong>\uff1a\u57fa\u4e8e\u8ba1\u6570\u5668\u503c\u548c\u5bc6\u94a5\u751f\u6210 OTP\u3002\u6bcf\u6b21\u751f\u6210\u7684 OTP \u90fd\u4e0e\u4e00\u4e2a\u9012\u589e\u7684\u8ba1\u6570\u5668\u503c\u76f8\u5173\uff0c\u4f7f\u7528\u540e\uff0c\u8ba1\u6570\u5668\u503c\u4f1a\u9012\u589e\uff0c\u4fdd\u8bc1\u6bcf\u6b21 OTP \u4e0d\u91cd\u590d\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u5982\u4f55\u5728 Go \u4e2d\u751f\u6210\u548c\u9a8c\u8bc1 OTP<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u5b9e\u73b0 OTP \u8eab\u4efd\u9a8c\u8bc1\u529f\u80fd\uff0cGo \u4e2d\u6709\u591a\u4e2a\u73b0\u6210\u7684\u5e93\u53ef\u4ee5\u4f7f\u7528\uff0c\u5176\u4e2d <code>github.com\/pquerna\/otp<\/code> \u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u5e93\uff0c\u5b83\u652f\u6301 TOTP \u548c HOTP\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3.1 <strong>\u5b89\u88c5 otp \u5e93<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u5b89\u88c5 <code>otp<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e82\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go get github.com\/pquerna\/otp<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.2 <strong>\u751f\u6210 TOTP \u5bc6\u94a5<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">TOTP \u5bc6\u94a5\u662f\u7528\u4e8e\u751f\u6210 OTP \u7684\u5171\u4eab\u5bc6\u94a5\u3002\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u5fc5\u987b\u4f7f\u7528\u76f8\u540c\u7684\u5bc6\u94a5\uff0c\u670d\u52a1\u5668\u7528\u4e8e\u751f\u6210 OTP\uff0c\u5ba2\u6237\u7aef\u7528\u4e8e\u9a8c\u8bc1 OTP\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"github.com\/pquerna\/otp\/totp\"\n)\n\nfunc main() {\n    \/\/ \u751f\u6210\u4e00\u4e2a\u65b0\u7684 TOTP \u5bc6\u94a5\n    key, err := totp.Generate(totp.GenerateOpts{\n        Issuer:      \"MyApp\",\n        AccountName: \"user@example.com\",\n    })\n    if err != nil {\n        fmt.Println(\"Error generating TOTP key:\", err)\n        return\n    }\n\n    \/\/ \u8f93\u51fa\u5bc6\u94a5\u548c QR \u7801 URL\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u626b\u63cf QR \u7801\u6765\u6ce8\u518c\uff09\n    fmt.Println(\"TOTP Key:\", key.Secret())\n    fmt.Println(\"QR Code URL:\", key.URL())\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.3 <strong>\u9a8c\u8bc1 TOTP<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65e6\u7528\u6237\u626b\u63cf\u4e86 QR \u7801\u5e76\u5c06\u5176\u4e0e\u5ba2\u6237\u7aef\u5e94\u7528\uff08\u4f8b\u5982 Google Authenticator\uff09\u540c\u6b65\uff0c\u5c31\u53ef\u4ee5\u751f\u6210 OTP\u3002\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u9a8c\u8bc1\u7528\u6237\u63d0\u4f9b\u7684 OTP\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"github.com\/pquerna\/otp\/totp\"\n)\n\nfunc main() {\n    \/\/ \u5047\u8bbe\u8fd9\u662f\u4ece\u5ba2\u6237\u7aef\u83b7\u53d6\u7684 OTP \u5bc6\u94a5\n    secret := \"JBSWY3DPEHPK3PXP\" \/\/ \u4ece\u751f\u6210\u7684 TOTP \u5bc6\u94a5\u4e2d\u63d0\u53d6\n\n    \/\/ \u5047\u8bbe\u8fd9\u662f\u7528\u6237\u8f93\u5165\u7684 OTP\n    userOTP := \"123456\"\n\n    \/\/ \u9a8c\u8bc1\u7528\u6237\u8f93\u5165\u7684 OTP\n    valid := totp.Validate(userOTP, secret)\n    if valid {\n        fmt.Println(\"OTP is valid!\")\n    } else {\n        fmt.Println(\"Invalid OTP!\")\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u6784\u5efa OTP \u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668\u7684\u6b65\u9aa4<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u5c06\u6784\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 OTP \u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1\u5668\uff0c\u5177\u5907\u4ee5\u4e0b\u529f\u80fd\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u751f\u6210 OTP \u5bc6\u94a5\uff0c\u5e76\u5c06\u5176\u8fd4\u56de\u7ed9\u7528\u6237\u3002<\/li>\n\n\n\n<li>\u63a5\u6536\u7528\u6237\u7684 OTP \u8f93\u5165\uff0c\u5e76\u9a8c\u8bc1\u5176\u6709\u6548\u6027\u3002<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b65\u9aa4 1: \u521b\u5efa HTTP \u670d\u52a1\u5668<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 HTTP \u670d\u52a1\u5668\uff0c\u4f7f\u7528\u6807\u51c6\u5e93 <code>net\/http<\/code> \u6765\u5904\u7406\u8bf7\u6c42\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"encoding\/json\"\n    \"fmt\"\n    \"net\/http\"\n    \"github.com\/pquerna\/otp\/totp\"\n)\n\n\/\/ \u751f\u6210 TOTP \u5bc6\u94a5\nfunc generateOTP(w http.ResponseWriter, r *http.Request) {\n    \/\/ \u751f\u6210\u5bc6\u94a5\n    key, err := totp.Generate(totp.GenerateOpts{\n        Issuer:      \"MyApp\",\n        AccountName: \"user@example.com\",\n    })\n    if err != nil {\n        http.Error(w, \"Error generating OTP key\", http.StatusInternalServerError)\n        return\n    }\n\n    \/\/ \u8fd4\u56de\u751f\u6210\u7684\u5bc6\u94a5\u548c QR \u7801 URL\n    response := map&#91;string]string{\n        \"secret\": key.Secret(),\n        \"qr_url\": key.URL(),\n    }\n\n    w.Header().Set(\"Content-Type\", \"application\/json\")\n    json.NewEncoder(w).Encode(response)\n}\n\n\/\/ \u9a8c\u8bc1\u7528\u6237\u8f93\u5165\u7684 OTP\nfunc verifyOTP(w http.ResponseWriter, r *http.Request) {\n    \/\/ \u4ece\u8bf7\u6c42\u4f53\u83b7\u53d6 OTP \u548c\u5bc6\u94a5\n    var requestBody struct {\n        OTP    string `json:\"otp\"`\n        Secret string `json:\"secret\"`\n    }\n\n    if err := json.NewDecoder(r.Body).Decode(&amp;requestBody); err != nil {\n        http.Error(w, \"Invalid request body\", http.StatusBadRequest)\n        return\n    }\n\n    \/\/ \u9a8c\u8bc1 OTP\n    valid := totp.Validate(requestBody.OTP, requestBody.Secret)\n    if valid {\n        fmt.Fprintln(w, \"OTP is valid!\")\n    } else {\n        http.Error(w, \"Invalid OTP!\", http.StatusUnauthorized)\n    }\n}\n\nfunc main() {\n    http.HandleFunc(\"\/generate\", generateOTP)\n    http.HandleFunc(\"\/verify\", verifyOTP)\n\n    fmt.Println(\"Server started at :8080\")\n    http.ListenAndServe(\":8080\", nil)\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u6b65\u9aa4 2: \u542f\u52a8\u670d\u52a1\u5668<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7 <code>go run<\/code> \u542f\u52a8 Go \u670d\u52a1\u5668\uff0c\u60a8\u5c06\u80fd\u5728 <code>http:\/\/localhost:8080<\/code> \u4e0a\u8bbf\u95ee\u5b83\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6d4b\u8bd5\u63a5\u53e3\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u751f\u6210 OTP \u5bc6\u94a5<\/strong>\uff1a<br>\u8bf7\u6c42\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   curl http:\/\/localhost:8080\/generate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u54cd\u5e94\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   {\n     \"secret\": \"JBSWY3DPEHPK3PXP\",\n     \"qr_url\": \"otpauth:\/\/totp\/MyApp:user@example.com?secret=JBSWY3DPEHPK3PXP&amp;issuer=MyApp\"\n   }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528\u6237\u53ef\u4ee5\u4f7f\u7528 Google Authenticator \u6216\u5176\u4ed6\u652f\u6301 TOTP \u7684\u5e94\u7528\u7a0b\u5e8f\u626b\u63cf\u751f\u6210\u7684\u4e8c\u7ef4\u7801\u3002<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u9a8c\u8bc1 OTP<\/strong>\uff1a<br>\u8bf7\u6c42\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   curl -X POST http:\/\/localhost:8080\/verify -d '{\"otp\":\"123456\", \"secret\":\"JBSWY3DPEHPK3PXP\"}' -H \"Content-Type: application\/json\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u54cd\u5e94\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   OTP is valid!<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6216\u8005\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   Invalid OTP!<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u6784\u5efa\u57fa\u4e8e HOTP \u7684\u9a8c\u8bc1<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u4e86 TOTP\uff0c<code>otp<\/code> \u5e93\u8fd8\u652f\u6301\u57fa\u4e8e\u8ba1\u6570\u5668\u7684 HOTP \u8eab\u4efd\u9a8c\u8bc1\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528 HOTP \u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u7684\u57fa\u672c\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"fmt\"\n    \"github.com\/pquerna\/otp\/hotp\"\n)\n\nfunc main() {\n    \/\/ \u751f\u6210\u4e00\u4e2a HOTP \u5bc6\u94a5\n    key, err := hotp.Generate(hotp.GenerateOpts{\n        Issuer:      \"MyApp\",\n        AccountName: \"user@example.com\",\n    })\n    if err != nil {\n        fmt.Println(\"Error generating HOTP key:\", err)\n        return\n    }\n\n    \/\/ \u7528\u6237\u8f93\u5165\u7684 OTP\n    userOTP := \"123456\"\n\n    \/\/ \u6821\u9a8c OTP\n    counter := uint64(1) \/\/ \u4f7f\u7528\u9012\u589e\u7684\u8ba1\u6570\u5668\u503c\n    valid := hotp.Validate(userOTP, key.Secret(), counter)\n    if valid {\n        fmt.Println(\"OTP is valid!\")\n    } else {\n        fmt.Println(\"Invalid OTP!\")\n    }\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4f7f\u7528 Go \u548c\u73b0\u6210\u7684 <code>otp<\/code> \u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u4e00\u4e2a\u9ad8\u6548\u4e14\u5b89\u5168\u7684\u57fa\u4e8e OTP \u7684\u8eab\u4efd\u9a8c\u8bc1\u7cfb\u7edf\u3002\u65e0\u8bba\u662f TOTP \u8fd8\u662f HOTP\uff0cGo \u90fd\u63d0\u4f9b\u4e86\u7b80\u5355\u800c\u5f3a\u5927\u7684\u652f\u6301\u6765\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\u3002\u7ed3\u5408\u591a\u56e0\u7d20\u8ba4\u8bc1\uff08MFA\uff09\uff0cOTP \u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7528\u6237\u8d26\u6237\u7684\u5b89\u5168\u6027\uff0c\u9632\u6b62\u56e0\u5bc6\u7801\u6cc4\u9732\u800c\u5e26\u6765\u7684\u5b89\u5168\u98ce\u9669\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u4e8e\u4e00\u6b21\u6027\u5bc6\u7801\uff08OTP\uff0cOne-Time Password\uff09\u7684\u8eab\u4efd\u9a8c\u8bc1\u662f\u4e00\u79cd\u5e38\u7528\u7684\u5b89\u5168\u63aa\u65bd\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u591a\u56e0\u7d20\u8eab [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-991","post","type-post","status-publish","format-standard","hentry","category-golang"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=991"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/991\/revisions"}],"predecessor-version":[{"id":992,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/991\/revisions\/992"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}