{"id":5048,"date":"2023-01-05T11:45:03","date_gmt":"2023-01-05T03:45:03","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=5048"},"modified":"2023-01-05T11:45:03","modified_gmt":"2023-01-05T03:45:03","slug":"%e5%ad%b8%e7%bf%92typescript%e4%b8%ad%e5%ad%97%e4%b8%b2%e7%9a%84%e8%a7%a3%e7%a2%bc%e6%96%b9%e6%b3%95%ef%bc%9adecodeuri%e8%88%87decodeuricomponent","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/%e5%ad%b8%e7%bf%92typescript%e4%b8%ad%e5%ad%97%e4%b8%b2%e7%9a%84%e8%a7%a3%e7%a2%bc%e6%96%b9%e6%b3%95%ef%bc%9adecodeuri%e8%88%87decodeuricomponent\/","title":{"rendered":"\u5b78\u7fd2TypeScript\u4e2d\u5b57\u4e32\u7684\u89e3\u78bc\u65b9\u6cd5\uff1adecodeURI\u8207decodeURIComponent"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, decodeURI, decodeURIComponent\"><\/p>\n<h1>TypeScript \u5b57\u4e32\u7684\u89e3\u78bc(decodeURI, decodeURIComponent)<\/h1>\n<p>TypeScript \u662f\u4e00\u7a2e JavaScript \u7684\u8d85\u96c6\uff0c\u5b83\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u958b\u767c\u51fa\u66f4\u512a\u79c0\u7684\u7a0b\u5f0f\u78bc\u3002\u5176\u4e2d\u4e00\u500b\u529f\u80fd\u5c31\u662f\u63d0\u4f9b\u4e86 decodeURI \u548c decodeURIComponent \u5169\u500b\u51fd\u5f0f\uff0c\u53ef\u4ee5\u7528\u4f86\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\u3002<\/p>\n<h2>decodeURI \u548c decodeURIComponent \u7684\u5dee\u5225<\/h2>\n<p>decodeURI \u548c decodeURIComponent \u5169\u500b\u51fd\u5f0f\u90fd\u53ef\u4ee5\u7528\u4f86\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\uff0c\u4f46\u662f\u5b83\u5011\u4e4b\u9593\u6709\u4e00\u500b\u91cd\u8981\u7684\u5dee\u5225\uff0c\u5c31\u662f decodeURI \u53ea\u6703\u5c0d\u7279\u5b9a\u7684\u5b57\u5143\u9032\u884c\u89e3\u78bc\uff0c\u800c decodeURIComponent \u5247\u6703\u5c0d\u6240\u6709\u7684\u5b57\u5143\u9032\u884c\u89e3\u78bc\u3002<\/p>\n<p>decodeURI \u53ea\u6703\u5c0d\u4ee5\u4e0b\u5b57\u5143\u9032\u884c\u89e3\u78bc\uff1a<\/p>\n<ul>\n<li>%20\uff1a\u7a7a\u683c<\/li>\n<li>%21\uff1a\u611f\u5606\u865f<\/li>\n<li>%24\uff1a\u7f8e\u5143\u7b26\u865f<\/li>\n<li>%26\uff1a\u548c\u7b26\u865f<\/li>\n<li>%27\uff1a\u55ae\u5f15\u865f<\/li>\n<li>%28\uff1a\u5de6\u62ec\u865f<\/li>\n<li>%29\uff1a\u53f3\u62ec\u865f<\/li>\n<li>%2A\uff1a\u661f\u865f<\/li>\n<li>%2B\uff1a\u52a0\u865f<\/li>\n<li>%2C\uff1a\u9017\u865f<\/li>\n<li>%2F\uff1a\u659c\u7dda<\/li>\n<li>%3A\uff1a\u5192\u865f<\/li>\n<li>%3B\uff1a\u5206\u865f<\/li>\n<li>%3D\uff1a\u7b49\u865f<\/li>\n<li>%3F\uff1a\u554f\u865f<\/li>\n<li>%40\uff1a\u96d9\u5f15\u865f<\/li>\n<\/ul>\n<p>\u800c decodeURIComponent \u5247\u6703\u5c0d\u6240\u6709\u7684\u5b57\u5143\u9032\u884c\u89e3\u78bc\uff0c\u5305\u62ec\u4e0a\u9762\u63d0\u5230\u7684\u5b57\u5143\u4ee5\u53ca\u5176\u4ed6\u7684\u5b57\u5143\u3002<\/p>\n<h2>decodeURI \u548c decodeURIComponent \u7684\u4f7f\u7528<\/h2>\n<p>decodeURI \u548c decodeURIComponent \u90fd\u662f TypeScript \u7684\u5167\u5efa\u51fd\u5f0f\uff0c\u53ef\u4ee5\u7528\u4f86\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\u3002\u5b83\u5011\u7684\u4f7f\u7528\u65b9\u6cd5\u90fd\u662f\u4e00\u6a23\u7684\uff0c\u53ea\u9700\u8981\u5c07\u8981\u89e3\u78bc\u7684\u5b57\u4e32\u4f5c\u70ba\u53c3\u6578\u50b3\u5165\u51fd\u5f0f\u4e2d\uff0c\u5c31\u53ef\u4ee5\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\u3002<\/p>\n<pre class=\"brush: typescript\">\nlet encodedString = '%E4%B8%AD%E6%96%87';\nlet decodedString = decodeURI(encodedString);\nconsole.log(decodedString); \/\/ \u4e2d\u6587\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u4f7f\u7528 decodeURI \u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\uff0c\u6700\u5f8c\u5f97\u5230\u7684\u7d50\u679c\u5c31\u662f\u4e2d\u6587\u5b57\u4e32\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>TypeScript \u63d0\u4f9b\u4e86 decodeURI \u548c decodeURIComponent \u5169\u500b\u51fd\u5f0f\uff0c\u53ef\u4ee5\u7528\u4f86\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\u3002decodeURI \u53ea\u6703\u5c0d\u7279\u5b9a\u7684\u5b57\u5143\u9032\u884c\u89e3\u78bc\uff0c\u800c decodeURIComponent \u5247\u6703\u5c0d\u6240\u6709\u7684\u5b57\u5143\u9032\u884c\u89e3\u78bc\u3002\u5b83\u5011\u7684\u4f7f\u7528\u65b9\u6cd5\u90fd\u662f\u4e00\u6a23\u7684\uff0c\u53ea\u9700\u8981\u5c07\u8981\u89e3\u78bc\u7684\u5b57\u4e32\u4f5c\u70ba\u53c3\u6578\u50b3\u5165\u51fd\u5f0f\u4e2d\uff0c\u5c31\u53ef\u4ee5\u5c0d\u5b57\u4e32\u9032\u884c\u89e3\u78bc\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u66f4\u591a TypeScript \u76f8\u95dc\u6587\u7ae0<\/h2>\n<ul>\n<li><a href=\"https:\/\/example.com\/typescript-intro\" target=\"_blank\" rel=\"noopener\">TypeScript \u5165\u9580\u6559\u5b78<\/a><\/li>\n<li><a href=\"https:\/\/example.com\/typescript-basics\" target=\"_blank\" rel=\"noopener\">TypeScript \u57fa\u790e\u6559\u5b78<\/a><\/li>\n<li><a href=\"https:\/\/example.com\/typescript-advanced\" target=\"_blank\" rel=\"noopener\">TypeScript \u9032\u968e\u6559\u5b78<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2TypeScript\u4e2d\u5b57\u4e32\u7684\u89e3\u78bc\u65b9\u6cd5\uff0cdecodeURI\u8207decodeURIComponent\uff0c\u53ef\u4ee5\u5c07\u7de8\u78bc\u904e\u7684\u5b57\u4e32\u89e3\u78bc\u6210\u539f\u672c\u7684\u5b57\u4e32\uff0c\u8b93\u958b\u767c\u8005\u53ef\u4ee5\u66f4\u6709\u6548\u7387\u7684\u4f7f\u7528\u5b57\u4e32\uff0c\u66f4\u52a0\u4e86\u89e3TypeScript\u4e2d\u5b57\u4e32\u7684\u89e3\u78bc\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[187],"tags":[186],"class_list":["post-5048","post","type-post","status-publish","format-standard","hentry","category-typescript","tag-typescript"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1jq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=5048"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5048\/revisions"}],"predecessor-version":[{"id":5049,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5048\/revisions\/5049"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=5048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=5048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=5048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}