{"id":27872,"date":"2024-11-24T10:23:48","date_gmt":"2024-11-24T02:23:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27872\/"},"modified":"2024-11-24T10:23:48","modified_gmt":"2024-11-24T02:23:48","slug":"koa-%e4%b8%ad%e4%bd%bf%e7%94%a8-md5-updatepassword-%e4%bc%a0%e9%80%92%e5%8f%98%e9%87%8f%e5%87%ba%e7%8e%b0-internal-server-error-%e9%94%99%e8%af%af%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27872\/","title":{"rendered":"Koa \u4e2d\u4f7f\u7528 MD5.update(password) \u4f20\u9012\u53d8\u91cf\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173132568428799.jpg\" class=\"aligncenter\" title=\"Koa \u4e2d\u4f7f\u7528 MD5.update(password) \u4f20\u9012\u53d8\u91cf\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Koa \u4e2d\u4f7f\u7528 MD5.update(password) \u4f20\u9012\u53d8\u91cf\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>koa md5.update(password)\u4f20\u53d8\u91cf\u51fa\u9519\u7684\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728 Koa \u4e2d\u4f7f\u7528 crypto \u5e93\u5bf9\u5bc6\u7801\u8fdb\u884c MD5 \u52a0\u5bc6\u65f6\uff0c\u5982\u679c\u4f20\u53c2\u4e3a\u53d8\u91cf\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u7684\u9519\u8bef\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u53d8\u91cf\u5c1a\u672a\u521d\u59cb\u5316\u6216\u5176\u503c\u4e0d\u5408\u9002\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u7528 koa md5.update(password) \u4f20\u9012\u53d8\u91cf\u65f6\u89e3\u51b3\u9519\u8bef\u7684\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li> <strong>\u68c0\u67e5\u53d8\u91cf\u7684\u7c7b\u578b\uff1a<\/strong>\u786e\u4fdd\u53d8\u91cf\u662f\u5b57\u7b26\u4e32\u3002<\/li>\n<li> <strong>\u4f7f\u7528.toString() \u65b9\u6cd5\u8f6c\u6362\u53d8\u91cf\uff1a<\/strong>\u5982\u679c\u53d8\u91cf\u4e0d\u662f\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u4f7f\u7528 .toString() \u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\uff1amd5.update(password.toString())\u3002<\/li>\n<li> <strong>\u68c0\u67e5\u6570\u636e\u5e93\u5b57\u6bb5\u7684\u7c7b\u578b\uff1a<\/strong>\u786e\u4fdd\u6570\u636e\u5e93\u4e2d\u7528\u4e8e\u5b58\u50a8 MD5 \u5bc6\u7801\u7684\u5b57\u6bb5\u7c7b\u578b\u4e3a VARCHAR \u4e14\u957f\u5ea6\u8db3\u591f\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528 VARCHAR(20) \u5b57\u6bb5\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u622a\u65ad\uff0c\u4ece\u800c\u5bfc\u81f4\u9519\u8bef\u3002\u5efa\u8bae\u4f7f\u7528 VARCHAR(50) \u6216\u66f4\u957f\u7684\u5b57\u6bb5\u7c7b\u578b\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fKoa \u4e2d\u4f7f\u7528 MD5.update(password) \u4f20\u9012\u53d8\u91cf\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>koa md5.update(password)\u4f20\u53d8\u91cf\u51fa\u9519\u7684\u89e3\u51b3\u65b9\u6cd5 \u5728 Koa \u4e2d\u4f7f\u7528 crypto \u5e93\u5bf9\u5bc6\u7801\u8fdb\u884c MD5 \u52a0\u5bc6\u65f6\uff0c\u5982\u679c\u4f20\u53c2\u4e3a\u53d8\u91cf\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u7684\u9519\u8bef\u3002\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u53d8\u91cf\u5c1a\u672a\u521d\u59cb\u5316\u6216\u5176\u503c\u4e0d\u5408\u9002\u3002 \u4ee5\u4e0b\u662f\u7528 koa md5.update(password) \u4f20\u9012\u53d8\u91cf\u65f6\u89e3\u51b3\u9519\u8bef\u7684\u65b9\u6cd5\uff1a \u68c0\u67e5\u53d8\u91cf\u7684\u7c7b\u578b\uff1a\u786e\u4fdd\u53d8\u91cf\u662f\u5b57\u7b26\u4e32\u3002 \u4f7f\u7528.toString() \u65b9\u6cd5\u8f6c\u6362\u53d8\u91cf\uff1a\u5982\u679c\u53d8\u91cf\u4e0d\u662f\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u4f7f\u7528 .toString() \u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982\uff1amd5.update(password.toString())\u3002 \u68c0\u67e5\u6570\u636e\u5e93\u5b57\u6bb5\u7684\u7c7b\u578b\uff1a\u786e\u4fdd\u6570\u636e\u5e93\u4e2d\u7528\u4e8e\u5b58\u50a8 MD5 \u5bc6\u7801\u7684\u5b57\u6bb5\u7c7b\u578b\u4e3a VARCHAR \u4e14\u957f\u5ea6\u8db3\u591f\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528 VARCHAR(20) \u5b57\u6bb5\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u622a\u65ad\uff0c\u4ece\u800c\u5bfc\u81f4\u9519\u8bef\u3002\u5efa\u8bae\u4f7f\u7528 VARCHAR(50) \u6216\u66f4\u957f\u7684\u5b57\u6bb5\u7c7b\u578b\u3002 \u4ee5\u4e0a\u5c31\u662fKoa \u4e2d\u4f7f\u7528 MD5.update(password) \u4f20\u9012\u53d8\u91cf\u51fa\u73b0 &#8220;Internal Server Error&#8221; \u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27872","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27872","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=27872"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27872\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}