{"id":12048,"date":"2026-01-22T20:52:22","date_gmt":"2026-01-22T12:52:22","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12048"},"modified":"2026-01-26T11:23:45","modified_gmt":"2026-01-26T03:23:45","slug":"promise-try-withresolvers","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2026\/01\/promise-try-withresolvers\/","title":{"rendered":"Promise.try()\u548cPromise.withResolvers()\u4f5c\u7528\u901f\u89c8"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12048\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=12048<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4f46\u9700\u8981\u4fdd\u7559\u539f\u4f5c\u8005\u3001\u51fa\u5904\u4ee5\u53ca\u6587\u4e2d\u94fe\u63a5\uff0cAI\u6293\u53d6\u4fdd\u7559\u539f\u6587\u5730\u5740\uff0c\u4efb\u4f55\u7f51\u7ad9\u5747\u53ef\u6458\u8981\u805a\u5408\uff0c\u5546\u7528\u8bf7\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p>\u672c\u6587\u4ecb\u7ecd\u4e24\u4e2aPromise\u76f8\u5173\u7684\u65b0\u7279\u6027\u3002<\/p>\n<h3>\u4e00\u3001Promise.try()\u7684\u4f5c\u7528<\/h3>\n<p>\u4e4b\u524d\u6211\u4eec\u8fd0\u884c\u4e00\u6bb5\u4ee3\u7801\uff0c\u6216\u8005\u4e00\u4e2a\u51fd\u6570\uff0c\u60f3\u8981\u6355\u83b7\u9519\u8bef\u7684\u65f6\u5019\uff0c\u5f80\u5f80\u4f7f\u7528\u7684\u662f<code>try...catch()<\/code>\uff0c\u5bf9\u5427\u3002<\/p>\n<p>\u4f46\u662f<code>try...catch()<\/code>\u5462\u6709\u4e2a\u5c0f\u95ee\u9898\uff0c\u90a3\u5c31\u662f\u5982\u679c\u91cc\u9762\u6709\u5f02\u6b65\u64cd\u4f5c\uff0c\u5982 setTimeout\u3001Promise \u5185\u90e8\uff0c\u90a3\u4e48\u8fd9\u4e2a\u9519\u8bef\u5c31\u6355\u83b7\u4e0d\u4e86\u3002<\/p>\n<p><code>Promise.try()<\/code>\u7684\u4f5c\u7528\u4e4b\u4e00\u5c31\u662f\u7edf\u4e00\u540c\u6b65\u4e0e\u5f02\u6b65\u9519\u8bef\u5904\u7406\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>try {\r\n  new Promise(resolve =&gt; resolve(callback());\r\n} catch (e) {\r\n  \/\/ \u9519\u8bef\u63d0\u793a\r\n}<\/pre>\n<p>\u5982\u679c\u8fd9\u91cc\u7684<code>callback<\/code>\u662f\u5f02\u6b65\u7684\uff0c\u90a3\u4e48\u4e0a\u9762\u7684\u5b9e\u73b0\u662f\u65e0\u6cd5\u6355\u83b7\u9519\u8bef\u7684\u3002<\/p>\n<p>\u4f46\u662f\u4e0b\u9762\u7684\u53ef\u4ee5\uff1a<\/p>\n<pre>Promise.try(callback)\r\n  .then(result =&gt; console.log(result))\r\n  .catch(error =&gt; console.log(error))\r\n  .finally(() =&gt; console.log(\"All settled.\"));<\/pre>\n<p><span class=\"s\">\/\/zxx: \u5982\u679c\u4f7f\u7528 async\/await \u8bed\u6cd5\uff0c\u8bf7\u4e0d\u8981\u4f7f\u7528 Promise.try\uff0c\u800c\u5e94\u6539\u7528 try\/catch\/finally \u5757<\/span><\/p>\n<p><strong>\u66f4\u65b0\u4e8e2026\u5e741\u670826\u65e5<\/strong><\/p>\n<p><code>Promise.try()<\/code>\u4e5f\u4e0d\u80fd\u6355\u83b7<code>setTimeout<\/code>\u5185\u90e8\u7684\u9519\u8bef\uff0c\u9664\u975e\u5728 <code>setTimeout<\/code> \u5185\u90e8\u8fd4\u56de <code>Promise<\/code>\u3002<\/p>\n<p>Promise.try() \u53ea\u80fd\u6355\u83b7\u540c\u6b65\u6267\u884c\u6216\u8fd4\u56de Promise \u7684\u5f02\u6b65\u9519\u8bef\uff0c\u4f46 setTimeout \u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6267\u884c\u4e0a\u4e0b\u6587\u3002<\/p>\n<pre>\/\/ \u274c \u65e0\u6cd5\u6355\u83b7\r\nPromise.try(() =&gt; {\r\n  setTimeout(() =&gt; {\r\n    throw new Error('\u8fd9\u4e2a\u9519\u8bef\u65e0\u6cd5\u88ab\u6355\u83b7');\r\n  }, 1000);\r\n}).catch(err =&gt; {\r\n  console.log('\u6c38\u8fdc\u4e0d\u4f1a\u6267\u884c', err);\r\n});\r\n\r\n\/\/ setTimeout \u7684\u56de\u8c03\u5728 Promise \u5df2\u7ecf resolve \u4e4b\u540e\u624d\u6267\u884c<\/pre>\n<p>\u5177\u4f53\u89c1\u4e0b\u8868\uff1a<\/p>\n<table role=\"table\" class=\"params_table\" style=\"border-spacing:1px\">\n<thead>\n<tr>\n<th>\u573a\u666f<\/th>\n<th>Promise.try() \u80fd\u5426\u6355\u83b7<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u540c\u6b65\u9519\u8bef<\/td>\n<td>\u2705 \u53ef\u4ee5<\/td>\n<\/tr>\n<tr>\n<td>\u8fd4\u56de\u7684 Promise \u9519\u8bef<\/td>\n<td>\u2705 \u53ef\u4ee5<\/td>\n<\/tr>\n<tr>\n<td>setTimeout \u5185\u90e8\u9519\u8bef<\/td>\n<td>\u274c \u4e0d\u53ef\u4ee5<\/td>\n<\/tr>\n<tr>\n<td>setInterval \u5185\u90e8\u9519\u8bef<\/td>\n<td>\u274c \u4e0d\u53ef\u4ee5<\/td>\n<\/tr>\n<tr>\n<td>\u4e8b\u4ef6\u56de\u8c03\u5185\u90e8\u9519\u8bef<\/td>\n<td>\u274c \u4e0d\u53ef\u4ee5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e8c\u3001Promise.try()\u7684\u8bed\u6cd5<\/h3>\n<p>\u8bed\u6cd5\u4f7f\u7528\u793a\u610f\u5982\u4e0b\uff1a<\/p>\n<pre>Promise.try(func)\r\nPromise.try(func, arg1)\r\nPromise.try(func, arg1, arg2)\r\nPromise.try(func, arg1, arg2, \/* \u2026, *\/ argN)<\/pre>\n<p>\u4f1a\u8fd4\u56de\u4e00\u4e2a Promise\uff0c\u5176\u72b6\u6001\u53ef\u4ee5\u662f\uff1a<\/p>\n<ul>\n<li>\u5df2\u5151\u73b0\u7684\uff0c\u5982\u679c <code>func<\/code> \u540c\u6b65\u5730\u8fd4\u56de\u4e00\u4e2a\u503c\u3002\n<li>\u5df2\u62d2\u7edd\u7684\uff0c\u5982\u679c <code>func<\/code> \u540c\u6b65\u5730\u629b\u51fa\u4e00\u4e2a\u9519\u8bef\u3002<\/li>\n<li>\u5f02\u6b65\u5151\u73b0\u6216\u62d2\u7edd\u7684\uff0c\u5982\u679c <code>func<\/code> \u8fd4\u56de\u4e00\u4e2a promise\u3002<\/li>\n<\/li>\n<\/ul>\n<p>\u5982\u679c\u56de\u8c03\u51fd\u6570\u6709\u53c2\u6570\uff0c\u8be5\u600e\u4e48\u529e\uff1f\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u4e4b\u4e00\u6765\u5904\u7406\u6b64\u95ee\u9898\uff1a<\/p>\n<pre>\/\/ \u521b\u5efa\u4e86\u989d\u5916\u7684\u95ed\u5305\uff0c\u4f46\u662f\u4e5f\u662f\u53ef\u4ee5\u8fd0\u884c\u7684\r\nPromise.try(() =&gt; callback(param1, param2));\r\n\r\n\/\/ \u4e0d\u521b\u5efa\u95ed\u5305\uff0c\u540c\u6837\u53ef\u4ee5\u8fd0\u884c\r\nPromise.try(callback, param1, param2);<\/pre>\n<p>\u66f4\u63a8\u8350\u4f7f\u7528\u540e\u9762\u7684\u7528\u6cd5\u3002<\/p>\n<h4>\u517c\u5bb9\u6027<\/h4>\n<p>\u76ee\u524d\u6240\u6709\u73b0\u4ee3\u6d4f\u89c8\u5668\u90fd\u5df2\u7ecf\u652f\u6301\u4e86\uff0c\u517c\u5bb9\u6027\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u4e0d\u652f\u6301\u7684\u6d4f\u89c8\u5668\u4e5f\u53ef\u4ee5<a href=\"https:\/\/github.com\/tc39\/proposal-promise-try\" rel=\"noopener\" target=\"_blank\">\u5f15\u5165polyfill<\/a>\u8fdb\u884c\u517c\u5bb9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202601\/2026-1-22_201929.png\" width=\"572\" height=\"352\" alt=\"Promise.try()\u517c\u5bb9\u6027\" class=\"alignnone size-medium\" \/><\/p>\n<h3>\u4e09\u3001Promise.withResolvers()\u7684\u4f5c\u7528<\/h3>\n<p><code>Promise.withResolvers()<\/code> \u662f ECMAScript 2024 \u4e2d\u65b0\u589e\u7684\u4e00\u4e2a\u9759\u6001\u65b9\u6cd5\uff0c\u5176\u6838\u5fc3\u4f5c\u7528\u662f\u5c06 Promise \u7684\u521b\u5efa\u4e0e\u5176\u72b6\u6001\u63a7\u5236\uff08resolve \u548c reject\uff09\u89e3\u8026\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u540c\u65f6\u83b7\u5f97\u4e00\u4e2a\u65b0\u7684 Promise \u5b9e\u4f8b\u4ee5\u53ca\u4e0e\u5176\u7ed1\u5b9a\u7684\u3001\u7528\u4e8e\u63a7\u5236\u5176\u72b6\u6001\u7684\u51fd\u6570\u3002<\/p>\n<p>\u4f7f\u7528\u793a\u610f\uff1a<\/p>\n<pre>function createControllablePromise() {\r\n  \/\/ \u8fd4\u56de { promise, resolve, reject }\r\n  return Promise.withResolvers();\r\n}\r\n\r\nconst { promise, resolve, reject } = createControllablePromise();\r\n\r\n\/\/ 2\u79d2\u540e\u624b\u52a8 resolve\r\nsetTimeout(() =&gt; {\r\n  resolve('\u6210\u529f\u4e86\uff01');\r\n}, 2000);\r\n\r\npromise.then(result =&gt; {\r\n  console.log(result); \/\/ \u5e94\u8be5\u8f93\u51fa: \u6210\u529f\u4e86\uff01\r\n});<\/pre>\n<h4>\u5bf9\u6bd4\u6848\u4f8b<\/h4>\n<p>\u4f20\u7edf\u5b9e\u73b0\uff1a<\/p>\n<pre>function withTimeout(asyncOperation, timeoutMs) {\r\n  \/\/ \u5fc5\u987b\u9884\u5148\u58f0\u660e\u53d8\u91cf\uff0c\u7528\u4e8e\u5728\u5916\u90e8\u5b58\u50a8\u63a7\u5236\u51fd\u6570\r\n  let resolveRef, rejectRef;\r\n\r\n  \/\/ \u521b\u5efa\u63a7\u5236\u8d85\u65f6\u7684Promise\r\n  const timeoutPromise = new Promise((resolve, reject) =&gt; {\r\n    \/\/ \u5728\u6784\u9020\u51fd\u6570\u5185\u90e8\uff0c\u5c06\u5185\u90e8\u7684resolve\u548creject\u8d4b\u503c\u7ed9\u5916\u90e8\u53d8\u91cf\r\n    resolveRef = resolve;\r\n    rejectRef = reject;\r\n\r\n    \/\/ \u8bbe\u7f6e\u8d85\u65f6\u5b9a\u65f6\u5668\r\n    setTimeout(() =&gt; {\r\n      reject(new Error(`\u64cd\u4f5c\u8d85\u65f6\uff0c\u8d85\u8fc7 ${timeoutMs}ms`));\r\n    }, timeoutMs);\r\n  });\r\n\r\n  \/\/ \u6267\u884c\u5b9e\u9645\u7684\u5f02\u6b65\u64cd\u4f5c\r\n  asyncOperation()\r\n    .then((result) =&gt; {\r\n      \/\/ \u5f02\u6b65\u64cd\u4f5c\u6210\u529f\uff0c\u624b\u52a8\u89e3\u51b3\u8d85\u65f6Promise\r\n      resolveRef(result);\r\n    })\r\n    .catch((error) =&gt; {\r\n      \/\/ \u5f02\u6b65\u64cd\u4f5c\u5931\u8d25\uff0c\u624b\u52a8\u62d2\u7edd\u8d85\u65f6Promise\r\n      rejectRef(error);\r\n    });\r\n\r\n  \/\/ \u8fd4\u56de\u8fd9\u4e2a\u53d7\u8d85\u65f6\u63a7\u5236\u7684Promise\r\n  return timeoutPromise;\r\n}<\/pre>\n<p>\u6539\u4e3a\u4f7f\u7528<code>Promise.withResolvers()<\/code>\u65b9\u6cd5\u540e\uff1a<\/p>\n<pre>function withTimeout(asyncOperation, timeoutMs) {\r\n  \/\/ \u4e00\u884c\u4ee3\u7801\u540c\u65f6\u83b7\u5f97Promise\u5b9e\u4f8b\u53ca\u5176\u63a7\u5236\u51fd\u6570\r\n  const { promise, resolve, reject } = Promise.withResolvers();\r\n\r\n  \/\/ \u8bbe\u7f6e\u8d85\u65f6\u5b9a\u65f6\u5668\r\n  setTimeout(() =&gt; {\r\n    reject(new Error(`\u64cd\u4f5c\u8d85\u65f6\uff0c\u8d85\u8fc7 ${timeoutMs}ms`));\r\n  }, timeoutMs);\r\n\r\n  \/\/ \u6267\u884c\u5b9e\u9645\u7684\u5f02\u6b65\u64cd\u4f5c\r\n  asyncOperation()\r\n    .then((result) =&gt; {\r\n      \/\/ \u5f02\u6b65\u64cd\u4f5c\u6210\u529f\uff0c\u89e3\u51b3Promise\r\n      resolve(result);\r\n    })\r\n    .catch((error) =&gt; {\r\n      \/\/ \u5f02\u6b65\u64cd\u4f5c\u5931\u8d25\uff0c\u62d2\u7eddPromise\r\n      reject(error);\r\n    });\r\n\r\n  \/\/ \u8fd4\u56dePromise\r\n  return promise;\r\n}\r\n<\/pre>\n<p>\u53ef\u4ee5\u770b\u5230<code>Promise.withResolvers()<\/code>\u7684\u5b9e\u73b0\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\uff0c\u6b64API\u7279\u522b\u9002\u7528\u4e8e\u4e8b\u4ef6\u76d1\u542c\u3001\u6d41\u5904\u7406\u3001\u961f\u5217\u7ba1\u7406\u3001\u8d85\u65f6\u63a7\u5236\u7b49\u9ad8\u7ea7\u5f02\u6b65\u573a\u666f\u3002<\/p>\n<h4>\u517c\u5bb9\u6027<\/h4>\n<p>Promise.withResolvers()\u65b9\u6cd5\u7684\u7684\u517c\u5bb9\u6027\u8981\u6bd4Promise.try()\u66f4\u597d\u4e00\u4e9b\uff0c\u652f\u6301\u66f4\u65e9\u4e00\u4e9b\uff0c\u5982\u4e0b\u622a\u56fe\u6240\u793a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202601\/2026-1-22_203152.png\" width=\"574\" height=\"396\" alt=\"\u517c\u5bb9\u6027\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5df2\u7ecf\u5feb\u8981\u53ef\u4ee5\u653e\u5fc3\u4f7f\u7528\u4e86\u3002<\/p>\n<h3>\u56db\u3001\u7ed3\u8bed\u8bf4\u660e<\/h3>\n<p>\u672c\u6587\u4ecb\u7ecd\u7684\u4e24\u4e2a\u7279\u6027\u90fd\u5c5e\u4e8e\u8bed\u6cd5\u5c42\u9762\u589e\u5f3a\u7684\u7279\u6027\uff0c\u901a\u8fc7\u63d0\u4f9b\u66f4\u4f18\u96c5\u7684\u8bed\u6cd5\uff0c\u663e\u8457\u63d0\u5347\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u3001\u53ef\u7ef4\u62a4\u6027\u3002\u5b83\u4ee3\u8868\u4e86 JavaScript \u5f02\u6b65\u7f16\u7a0b\u5411\u66f4\u7b80\u6d01\u3001\u66f4\u76f4\u89c2\u65b9\u5411\u6f14\u8fdb\u7684\u91cd\u8981\u4e00\u6b65\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u5728\u6211\u770b\u6765\uff0c\u76ee\u524d\u5f88\u591a\u524d\u7aef\u7279\u6027\u662f\u8fc7\u76db\u7684\u3002<\/p>\n<p>\u6bcf\u5e74\u524d\u7aef\u9886\u57df\u7684\u65b0\u7279\u6027\u6ca1\u6709100\u4e5f\u670980\uff0c\u4f46\u662f\u5728\u751f\u4ea7\u73af\u5883\u4f7f\u7528\u7684\uff0c\u5be5\u5be5\u65e0\u51e0\u3002<\/p>\n<p>\u7b49\u4ee5\u540eAI\u76db\u884c\u4e4b\u540e\uff0c\u66f4\u56de\u4e8b\u5982\u6b64\uff0c\u56e0\u4e3aAI\u6240\u4f7f\u7528\u7684\u6280\u672f\u5b9e\u73b0\uff0c\u4e00\u5b9a\u662f\u4f20\u7edf\u7684\uff0c\u7a33\u5065\u7684\u5b9e\u73b0\u65b9\u5f0f\u3002<\/p>\n<p>\u6240\u8c13\u7684\u66f4\u9ad8\u6548\u66f4\u7b80\u6d01\uff0c\u5f88\u96be\u53cd\u5e94\u5230\u771f\u5b9e\u751f\u4ea7\u73af\u5883\u4e2d\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u76ee\u524d\u6765\u770b\uff0c\u4e2a\u4f53\u7684\u5b66\u4e60\u8fd8\u662f\u4e0d\u80fd\u505c\u6b62\u7684\u3002<\/p>\n<p>\u597d\u5566\uff0c\u5c31\u8fd9\u6837\u5427\u3002<\/p>\n<p>\u611f\u8c22\u9605\u8bfb\uff0c\u6b22\u8fce\u4ea4\u6d41\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202601\/2026-1-22_204509.jpeg\" width=\"175\" height=\"130\" alt=\"\u611f\u8c22\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=12048\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=12048<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202601\/2026-1-22_204956.png\" width=\"160\" height=\"105\" alt=\"Promise\u5c01\u9762\u56fe\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>Promise\u65b0\u652f\u6301\u4e86\u4e24\u4e2a\u9759\u6001\u65b9\u6cd5Promise.try()\u548cPromise.withResolvers()\uff0c\u4e0d\u77e5\u9053\u6709\u591a\u5c11\u4eba\u77e5\u9053\u8fd9\u4e24\u4e2a\u65b9\u6cd5\u662f\u5e72\u561b\u7528\u7684\uff1f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1284],"tags":[1240,903,185,2096],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12048"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=12048"}],"version-history":[{"count":7,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12048\/revisions"}],"predecessor-version":[{"id":12074,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/12048\/revisions\/12074"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=12048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=12048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=12048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}