{"id":52594,"date":"2024-12-03T10:48:56","date_gmt":"2024-12-03T02:48:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52594\/"},"modified":"2024-12-03T10:48:56","modified_gmt":"2024-12-03T02:48:56","slug":"%e5%b1%82%e6%ac%a1%e6%89%81%e5%b9%b3%e5%8c%96%ef%bc%9a%e7%ae%a1%e7%90%86%e8%bd%af%e4%bb%b6%e8%ae%be%e8%ae%a1%e5%a4%8d%e6%9d%82%e6%80%a7%e7%9a%84%e7%a7%98%e8%af%80","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52594\/","title":{"rendered":"\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u79ef\u7d2f\u77e5\u8bc6\uff0c\u80dc\u8fc7\u79ef\u84c4\u91d1\u94f6\uff01\u6bd5\u7adf\u5728\u6587\u7ae0\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u662f\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u6ca1\u6709\u638c\u63e1\u597d\u800c\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u57fa\u7840\u77e5\u8bc6\u70b9\u7684\u79ef\u7d2f\u662f\u5f88\u91cd\u8981\u7684\u3002\u4e0b\u9762\u672c\u6587\u300a\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0\u300b\uff0c\u5c31\u5e26\u5927\u5bb6\u8bb2\u89e3\u4e00\u4e0b\u77e5\u8bc6\u70b9\uff0c\u82e5\u662f\u4f60\u5bf9\u672c\u6587\u611f\u5174\u8da3\uff0c\u6216\u8005\u662f\u60f3\u641e\u61c2\u5176\u4e2d\u67d0\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5c31\u8bf7\u4f60\u7ee7\u7eed\u5f80\u4e0b\u770b\u5427~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241121\/1732195674673f355a23b3b.jpg\" class=\"aligncenter\" title=\"\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0\u63d2\u56fe\" alt=\"\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0\u63d2\u56fe\" \/><\/p>\n<p>\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u53d1\u73b0\u81ea\u5df1\u5728\u517c\u987e\u4e24\u4e2a\u770b\u4f3c\u77db\u76fe\u7684\u9700\u6c42\uff1a\u4ee5\u5bf9\u4eba\u7c7b\u601d\u7ef4\u6709\u610f\u4e49\u7684\u65b9\u5f0f\u7ec4\u7ec7\u4ee3\u7801\uff0c\u4ee5\u53ca\u5728\u8fd0\u884c\u65f6\u6709\u6548\u5730\u5904\u7406\u4ee3\u7801\u3002\u672c\u6587\u63a2\u8ba8\u4e86\u5206\u5c42\u7ed3\u6784\u53ca\u5176\u6241\u5e73\u5316\u7ed3\u6784\u5982\u4f55\u670d\u52a1\u4e8e\u4e0d\u540c\u7684\u76ee\u7684\uff0c\u4ee5\u53ca\u7406\u89e3\u8fd9\u79cd\u4e8c\u5143\u6027\u5982\u4f55\u4f7f\u6211\u4eec\u6210\u4e3a\u66f4\u597d\u7684\u5f00\u53d1\u4eba\u5458\u3002<\/p>\n<h2> \u4ee3\u7801\u7ec4\u7ec7\u7684\u53cc\u91cd\u6027\u8d28 <\/h2>\n<p>\u5f53\u6211\u4eec\u5f00\u53d1\u8f6f\u4ef6\u65f6\uff0c\u6211\u4eec\u5728\u4e24\u4e2a\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li> <strong>\u8bbe\u8ba1\u65f6\u95f4<\/strong>\uff1a\u6211\u4eec\u7ec4\u7ec7\u3001\u7406\u89e3\u548c\u7ef4\u62a4\u4ee3\u7801\u7684\u5730\u65b9<\/li>\n<li> <strong>\u8fd0\u884c\u65f6<\/strong>\uff1a\u6211\u4eec\u5904\u7406\u548c\u6267\u884c\u4ee3\u7801\u7684\u5730\u65b9<\/li>\n<\/ol>\n<p>\u8fd9\u4e9b\u73af\u5883\u6709\u4e0d\u540c\u7684\u8981\u6c42\uff0c\u5728\u4e00\u79cd\u60c5\u51b5\u4e0b\u6548\u679c\u6700\u597d\u7684\u65b9\u6cd5\u53ef\u80fd\u5bf9\u53e6\u4e00\u79cd\u60c5\u51b5\u5374\u4e0d\u662f\u6700\u4f73\u7684\u3002\u8ba9\u6211\u4eec\u6765\u63a2\u7a76\u4e00\u4e0b\u539f\u56e0\u3002<\/p>\n<h2> \u8bbe\u8ba1\u4e2d\u5c42\u6b21\u7ed3\u6784\u7684\u529b\u91cf <\/h2>\n<p>\u5c42\u6b21\u7ed3\u6784\u662f\u4eba\u7c7b\u8ba4\u77e5\u7684\u81ea\u7136\u73b0\u8c61\u3002\u6211\u4eec\u672c\u80fd\u5730\u5c06\u4fe1\u606f\u7ec4\u7ec7\u5728\u6811\u548c\u5d4c\u5957\u7c7b\u522b\u4e2d\u3002\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u8fd9\u4f53\u73b0\u5728\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n<ul>\n<li>\u76ee\u5f55\u7ed3\u6784<\/li>\n<li>\u5957\u9910\u7ec4\u7ec7<\/li>\n<li>\u7c7b\u7ee7\u627f<\/li>\n<li>\u6210\u5206\u7ec4\u6210<\/li>\n<li>\u9886\u57df\u5efa\u6a21<\/li>\n<\/ul>\n<p>\u8003\u8651\u4e00\u4e2a\u5178\u578b\u7684 react \u5e94\u7528\u7a0b\u5e8f\u7684\u8def\u7531\u7ed3\u6784\uff1a<\/p>\n<pre>src\/\n  routes\/\n    public\/\n      homeroute.js\n      aboutroute.js\n    private\/\n      dashboardroute.js\n      profileroute.js\n    common\/\n      notfoundroute.js\n<\/pre>\n<p>\u6b64\u5c42\u6b21\u7ed3\u6784\u7acb\u5373\u8fdb\u884c\u901a\u4fe1\uff1a<\/p>\n<ul>\n<li>\u516c\u5171\u548c\u79c1\u4eba\u8def\u7ebf\u7684\u5206\u79bb<\/li>\n<li>\u76f8\u5173\u7ec4\u4ef6\u7684\u903b\u8f91\u5206\u7ec4<\/li>\n<li>\u8bbf\u95ee\u63a7\u5236\u8fb9\u754c<\/li>\n<li>\u6574\u4f53\u5e94\u7528\u7ed3\u6784<\/li>\n<\/ul>\n<h2> \u8fd0\u884c\u65f6\u6241\u5e73\u5316\u7ed3\u6784\u7684\u6548\u7387 <\/h2>\n<p>\u867d\u7136\u5c42\u6b21\u7ed3\u6784\u975e\u5e38\u9002\u5408\u7ec4\u7ec7\uff0c\u4f46\u5728\u8fd0\u884c\u65f6\u5904\u7406\u65b9\u9762\uff0c\u6241\u5e73\u7ed3\u6784\u901a\u5e38\u4f1a\u63d0\u4f9b\u663e\u7740\u7684\u4f18\u52bf\uff1a<\/p>\n<ol>\n<li> <strong>\u7b80\u5316\u5904\u7406<\/strong>\uff1a\u7ebf\u6027\u6570\u7ec4\u66f4\u5bb9\u6613\u904d\u5386\u3001\u8fc7\u6ee4\u548c\u53d8\u6362<\/li>\n<li> <strong>\u964d\u4f4e\u590d\u6742\u6027<\/strong>\uff1a\u65e0\u9700\u5904\u7406\u5d4c\u5957\u7ed3\u6784\u6216\u9012\u5f52\u64cd\u4f5c<\/li>\n<li> <strong>\u66f4\u597d\u7684\u6027\u80fd<\/strong>\uff1a\u65e0\u9700\u904d\u5386\u5c42\u6b21\u7ed3\u6784\u5373\u53ef\u76f4\u63a5\u8bbf\u95ee\u5143\u7d20<\/li>\n<li> <strong>\u66f4\u8f7b\u677e\u7684\u72b6\u6001\u7ba1\u7406<\/strong>\uff1a\u66f4\u6241\u5e73\u7684\u7ed3\u6784\u66f4\u5bb9\u6613\u66f4\u65b0\u548c\u7ef4\u62a4<\/li>\n<li> <strong>\u7b80\u5316\u7684\u7b97\u6cd5<\/strong>\uff1a\u8bb8\u591a\u64cd\u4f5c\u53d8\u6210\u7b80\u5355\u7684\u8fed\u4ee3\u800c\u4e0d\u662f\u9012\u5f52\u904d\u5386<\/li>\n<\/ol>\n<h2> \u73b0\u5b9e\u793a\u4f8b\uff1a\u8def\u7ebf\u7ba1\u7406 <\/h2>\n<p>\u8ba9\u6211\u4eec\u770b\u4e00\u4e0b\u8be5\u539f\u5219\u7684\u5b9e\u9645\u5e94\u7528\u793a\u4f8b\u3002\u8fd9\u662f\u4e00\u4e2a\u5f25\u5408\u5206\u5c42\u8def\u7531\u7ec4\u7ec7\u548c\u8fd0\u884c\u65f6\u5904\u7406\u4e4b\u95f4\u5dee\u8ddd\u7684\u5b9e\u7528\u7a0b\u5e8f\uff1a<\/p>\n<pre>import { readdirsync, statsync } from 'fs';\nimport { join } from 'path';\n\nexport const deepmaproutes = async (routesdir) =&gt; {\n  const routes = [];\n\n  const traversedir = async (currentdir) =&gt; {\n    const files = readdirsync(currentdir);\n\n    for (const file of files) {\n      const filepath = join(currentdir, file);\n      const stat = statsync(filepath);\n\n      if (stat.isdirectory()) {\n        await traversedir(filepath);\n      } else if (\n        stat.isfile() &amp;&amp; \n        (file.endswith('.jsx') || file.endswith('.js')) &amp;&amp; \n        !file.startswith('index')\n      ) {\n        const module = await import(filepath);\n        if (array.isarray(module.default)) {\n          routes.push(...module.default);\n        } else if (module.default) {\n          routes.push(module.default);\n        }\n      }\n    }\n  };\n\n  await traversedir(routesdir);\n  return routes;\n};\n<\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u6211\u4eec\u7ec4\u7ec7\u826f\u597d\u7684\u5206\u5c42\u8def\u7531\u7ed3\u6784\u8f6c\u6362\u4e3a\u4e00\u4e2a\u975e\u5e38\u9002\u5408\u8fd0\u884c\u65f6\u5904\u7406\u7684\u5e73\u9762\u6570\u7ec4\u3002\u597d\u5904\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u7b80\u5316\u7684\u8def\u7ebf\u5339\u914d<\/li>\n<li>\u66f4\u8f7b\u677e\u7684\u8def\u7ebf\u6388\u6743\u68c0\u67e5<\/li>\n<li>\u7b80\u5316\u7684\u5bfc\u822a\u5904\u7406<\/li>\n<li>\u7b80\u5316\u7684\u8def\u7531\u4fee\u6539\u548c\u8fc7\u6ee4<\/li>\n<\/ul>\n<h2> \u8def\u7ebf\u4e4b\u5916\uff1a\u5176\u4ed6\u5e94\u7528 <\/h2>\n<p>\u8fd9\u79cd\u5177\u6709\u8fd0\u884c\u65f6\u6241\u5e73\u5316\u7684\u5206\u5c42\u7ec4\u7ec7\u539f\u5219\u9002\u7528\u4e8e\u8bb8\u591a\u5176\u4ed6\u573a\u666f\uff1a<\/p>\n<h3> 1. \u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c <\/h3>\n<pre>\/\/ hierarchical for organization\ndocuments\/\n  work\/\n    projects\/\n  personal\/\n    finances\/\n\n\/\/ flattened for processing\n[\n  'documents\/work\/projects\/project1.doc',\n  'documents\/personal\/finances\/budget.xlsx'\n]\n<\/pre>\n<h3> 2. \u83dc\u5355\u7ed3\u6784 <\/h3>\n<pre>\/\/ hierarchical for ui\nmenu\/\n  file\/\n    new\/\n    open\/\n  edit\/\n    copy\/\n    paste\/\n\n\/\/ flattened for command processing\n[\n  { id: 'new', shortcut: 'ctrl+n' },\n  { id: 'open', shortcut: 'ctrl+o' },\n  { id: 'copy', shortcut: 'ctrl+c' }\n]\n<\/pre>\n<h3> 3. \u7ec4\u4ef6\u5e93 <\/h3>\n<pre>\/\/ Hierarchical for documentation\ncomponents\/\n  inputs\/\n    text\/\n    select\/\n  displays\/\n    card\/\n    modal\/\n\n\/\/ Flattened for registration\n{\n  'TextInput': TextInputComponent,\n  'SelectInput': SelectInputComponent,\n  'Card': CardComponent,\n  'Modal': ModalComponent\n}\n<\/pre>\n<h2> \u5b9e\u65bd\u6700\u4f73\u5b9e\u8df5 <\/h2>\n<p>\u5b9e\u73b0\u6b64\u6a21\u5f0f\u65f6\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u51c6\u5219\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u4fdd\u6301\u771f\u76f8\u6765\u6e90\u7684\u5206\u5c42<\/strong>\uff1a\u4ee5\u5bf9\u5f00\u53d1\u4eba\u5458\u6709\u610f\u4e49\u7684\u5206\u5c42\u7ed3\u6784\u7ef4\u62a4\u60a8\u7684\u4e3b\u8981\u7ec4\u7ec7\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u65f6\u5c55\u5e73<\/strong>\uff1a\u521b\u5efa\u5728\u521d\u59cb\u5316\u6216\u6784\u5efa\u671f\u95f4\u8fd0\u884c\u7684\u5c55\u5e73\u5b9e\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7ef4\u62a4\u5143\u6570\u636e<\/strong>\uff1a\u5c55\u5e73\u65f6\uff0c\u5982\u679c\u9700\u8981\uff0c\u5c06\u91cd\u8981\u7684\u5206\u5c42\u4fe1\u606f\u4fdd\u7559\u4e3a\u5143\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7f13\u5b58\u6241\u5e73\u5316\u7ed3\u679c<\/strong>\uff1a\u5982\u679c\u6241\u5e73\u5316\u7684\u8ba1\u7b97\u6210\u672c\u5f88\u9ad8\uff0c\u5219\u7f13\u5b58\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8003\u8651\u53ef\u9006\u6027<\/strong>\uff1a\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u91cd\u5efa\u5c42\u6b21\u7ed3\u6784\uff0c\u56e0\u6b64\u7ef4\u62a4\u5fc5\u8981\u7684\u4fe1\u606f\u3002<\/p>\n<\/li>\n<\/ol>\n<h2> \u7ed3\u8bba <\/h2>\n<p>\u4f7f\u7528\u5206\u5c42\u7ed3\u6784\u548c\u6241\u5e73\u5316\u7ed3\u6784\u7684\u80fd\u529b\u662f\u5f00\u53d1\u4eba\u5458\u6b66\u5668\u5e93\u4e2d\u7684\u5f3a\u5927\u5de5\u5177\u3002\u867d\u7136\u5c42\u6b21\u7ed3\u6784\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u7ec4\u7ec7\u548c\u7406\u89e3\u4ee3\u7801\uff0c\u4f46\u6241\u5e73\u7ed3\u6784\u901a\u5e38\u63d0\u4f9b\u5728\u8fd0\u884c\u65f6\u5904\u7406\u4ee3\u7801\u7684\u6700\u6709\u6548\u65b9\u6cd5\u3002<\/p>\n<p>\u8bb0\u4f4f\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528\u5c42\u6b21\u7ed3\u6784\u8fdb\u884c\u7ec4\u7ec7\u548c\u7406\u89e3<\/li>\n<li>\u4f7f\u7528\u6241\u5e73\u7ed3\u6784\u8fdb\u884c\u5904\u7406\u548c\u8fd0\u884c\u65f6\u64cd\u4f5c<\/li>\n<li>\u6784\u5efa\u5de5\u5177\u4ee5\u6839\u636e\u9700\u8981\u5728\u8fd9\u4e9b\u8868\u793a\u4e4b\u95f4\u8fdb\u884c\u8f6c\u6362<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u67e5\u770b\u548c\u64cd\u4f5c\u6570\u636e\u7ed3\u6784\u7684\u8ba4\u77e5\u7075\u6d3b\u6027\u53ef\u4ee5\u5e26\u6765\u66f4\u5e72\u51c0\u3001\u66f4\u6613\u4e8e\u7ef4\u62a4\u4e14\u66f4\u9ad8\u6548\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u60a8\u662f\u5426\u9047\u5230\u8fc7\u8bc1\u660e\u6b64\u6a21\u5f0f\u6709\u7528\u7684\u5176\u4ed6\u573a\u666f\uff1f\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u4e2d\u5206\u4eab\u60a8\u7684\u7ecf\u9a8c\uff01<\/p>\n<hr>\n<p>\u6587\u4e2d\u5173\u4e8e\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300a\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664    <\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u4ec0\u4e48\u5e73\u677f\u7535\u8111\u80fd\u73a9dnf\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0 \u6536\u85cf \u79ef\u7d2f\u77e5\u8bc6\uff0c\u80dc\u8fc7\u79ef\u84c4\u91d1\u94f6\uff01\u6bd5\u7adf\u5728\u6587\u7ae0\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u90fd\u662f\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u6ca1\u6709\u638c\u63e1\u597d\u800c\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u57fa\u7840\u77e5\u8bc6\u70b9\u7684\u79ef\u7d2f\u662f\u5f88\u91cd\u8981\u7684\u3002\u4e0b\u9762\u672c\u6587\u300a\u5c42\u6b21\u6241\u5e73\u5316\uff1a\u7ba1\u7406\u8f6f\u4ef6\u8bbe\u8ba1\u590d\u6742\u6027\u7684\u79d8\u8bc0\u300b\uff0c\u5c31\u5e26\u5927\u5bb6\u8bb2\u89e3\u4e00\u4e0b\u77e5\u8bc6\u70b9\uff0c\u82e5\u662f\u4f60\u5bf9\u672c\u6587\u611f\u5174\u8da3\uff0c\u6216\u8005\u662f\u60f3\u641e\u61c2\u5176\u4e2d\u67d0\u4e2a\u77e5\u8bc6\u70b9\uff0c\u5c31\u8bf7\u4f60\u7ee7\u7eed\u5f80\u4e0b\u770b\u5427~ \u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u53d1\u73b0\u81ea\u5df1\u5728\u517c\u987e\u4e24\u4e2a\u770b\u4f3c\u77db\u76fe\u7684\u9700\u6c42\uff1a\u4ee5\u5bf9\u4eba\u7c7b\u601d\u7ef4\u6709\u610f\u4e49\u7684\u65b9\u5f0f\u7ec4\u7ec7\u4ee3\u7801\uff0c\u4ee5\u53ca\u5728\u8fd0\u884c\u65f6\u6709\u6548\u5730\u5904\u7406\u4ee3\u7801\u3002\u672c\u6587\u63a2\u8ba8\u4e86\u5206\u5c42\u7ed3\u6784\u53ca\u5176\u6241\u5e73\u5316\u7ed3\u6784\u5982\u4f55\u670d\u52a1\u4e8e\u4e0d\u540c\u7684\u76ee\u7684\uff0c\u4ee5\u53ca\u7406\u89e3\u8fd9\u79cd\u4e8c\u5143\u6027\u5982\u4f55\u4f7f\u6211\u4eec\u6210\u4e3a\u66f4\u597d\u7684\u5f00\u53d1\u4eba\u5458\u3002 \u4ee3\u7801\u7ec4\u7ec7\u7684\u53cc\u91cd\u6027\u8d28 \u5f53\u6211\u4eec\u5f00\u53d1\u8f6f\u4ef6\u65f6\uff0c\u6211\u4eec\u5728\u4e24\u4e2a\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u64cd\u4f5c\uff1a \u8bbe\u8ba1\u65f6\u95f4\uff1a\u6211\u4eec\u7ec4\u7ec7\u3001\u7406\u89e3\u548c\u7ef4\u62a4\u4ee3\u7801\u7684\u5730\u65b9 \u8fd0\u884c\u65f6\uff1a\u6211\u4eec\u5904\u7406\u548c\u6267\u884c\u4ee3\u7801\u7684\u5730\u65b9 \u8fd9\u4e9b\u73af\u5883\u6709\u4e0d\u540c\u7684\u8981\u6c42\uff0c\u5728\u4e00\u79cd\u60c5\u51b5\u4e0b\u6548\u679c\u6700\u597d\u7684\u65b9\u6cd5\u53ef\u80fd\u5bf9\u53e6\u4e00\u79cd\u60c5\u51b5\u5374\u4e0d\u662f\u6700\u4f73\u7684\u3002\u8ba9\u6211\u4eec\u6765\u63a2\u7a76\u4e00\u4e0b\u539f\u56e0\u3002 \u8bbe\u8ba1\u4e2d\u5c42\u6b21\u7ed3\u6784\u7684\u529b\u91cf \u5c42\u6b21\u7ed3\u6784\u662f\u4eba\u7c7b\u8ba4\u77e5\u7684\u81ea\u7136\u73b0\u8c61\u3002\u6211\u4eec\u672c\u80fd\u5730\u5c06\u4fe1\u606f\u7ec4\u7ec7\u5728\u6811\u548c\u5d4c\u5957\u7c7b\u522b\u4e2d\u3002\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u8fd9\u4f53\u73b0\u5728\u51e0\u4e2a\u65b9\u9762\uff1a \u76ee\u5f55\u7ed3\u6784 \u5957\u9910\u7ec4\u7ec7 \u7c7b\u7ee7\u627f \u6210\u5206\u7ec4\u6210 \u9886\u57df\u5efa\u6a21 \u8003\u8651\u4e00\u4e2a\u5178\u578b\u7684 react \u5e94\u7528\u7a0b\u5e8f\u7684\u8def\u7531\u7ed3\u6784\uff1a src\/ routes\/ public\/ homeroute.js aboutroute.js private\/ dashboardroute.js profileroute.js common\/ notfoundroute.js \u6b64\u5c42\u6b21\u7ed3\u6784\u7acb\u5373\u8fdb\u884c\u901a\u4fe1\uff1a \u516c\u5171\u548c\u79c1\u4eba\u8def\u7ebf\u7684\u5206\u79bb \u76f8\u5173\u7ec4\u4ef6\u7684\u903b\u8f91\u5206\u7ec4 \u8bbf\u95ee\u63a7\u5236\u8fb9\u754c \u6574\u4f53\u5e94\u7528\u7ed3\u6784 \u8fd0\u884c\u65f6\u6241\u5e73\u5316\u7ed3\u6784\u7684\u6548\u7387 \u867d\u7136\u5c42\u6b21\u7ed3\u6784\u975e\u5e38\u9002\u5408\u7ec4\u7ec7\uff0c\u4f46\u5728\u8fd0\u884c\u65f6\u5904\u7406\u65b9\u9762\uff0c\u6241\u5e73\u7ed3\u6784\u901a\u5e38\u4f1a\u63d0\u4f9b\u663e\u7740\u7684\u4f18\u52bf\uff1a \u7b80\u5316\u5904\u7406\uff1a\u7ebf\u6027\u6570\u7ec4\u66f4\u5bb9\u6613\u904d\u5386\u3001\u8fc7\u6ee4\u548c\u53d8\u6362 \u964d\u4f4e\u590d\u6742\u6027\uff1a\u65e0\u9700\u5904\u7406\u5d4c\u5957\u7ed3\u6784\u6216\u9012\u5f52\u64cd\u4f5c \u66f4\u597d\u7684\u6027\u80fd\uff1a\u65e0\u9700\u904d\u5386\u5c42\u6b21\u7ed3\u6784\u5373\u53ef\u76f4\u63a5\u8bbf\u95ee\u5143\u7d20 \u66f4\u8f7b\u677e\u7684\u72b6\u6001\u7ba1\u7406\uff1a\u66f4\u6241\u5e73\u7684\u7ed3\u6784\u66f4\u5bb9\u6613\u66f4\u65b0\u548c\u7ef4\u62a4 \u7b80\u5316\u7684\u7b97\u6cd5\uff1a\u8bb8\u591a\u64cd\u4f5c\u53d8\u6210\u7b80\u5355\u7684\u8fed\u4ee3\u800c\u4e0d\u662f\u9012\u5f52\u904d\u5386 \u73b0\u5b9e\u793a\u4f8b\uff1a\u8def\u7ebf\u7ba1\u7406 \u8ba9\u6211\u4eec\u770b\u4e00\u4e0b\u8be5\u539f\u5219\u7684\u5b9e\u9645\u5e94\u7528\u793a\u4f8b\u3002\u8fd9\u662f\u4e00\u4e2a\u5f25\u5408\u5206\u5c42\u8def\u7531\u7ec4\u7ec7\u548c\u8fd0\u884c\u65f6\u5904\u7406\u4e4b\u95f4\u5dee\u8ddd\u7684\u5b9e\u7528\u7a0b\u5e8f\uff1a import { readdirsync, statsync } from &#8216;fs&#8217;; import { join } from [&hellip;]<\/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-52594","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52594","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=52594"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52594\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}