{"id":280153,"date":"2021-01-13T18:55:18","date_gmt":"2021-01-13T10:55:18","guid":{"rendered":"http:\/\/4563.org\/?p=280153"},"modified":"2021-01-13T18:55:18","modified_gmt":"2021-01-13T10:55:18","slug":"nuxt-%e6%a1%88%e4%be%8b-%e4%b8%ad-session-%e6%98%af%e6%80%8e%e4%b9%88%e9%aa%8c%e8%af%81%e7%9a%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=280153","title":{"rendered":"nuxt \u6848\u4f8b \u4e2d session \u662f\u600e\u4e48\u9a8c\u8bc1\u7684"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  nuxt \u6848\u4f8b \u4e2d session \u662f\u600e\u4e48\u9a8c\u8bc1\u7684               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 1277840534 <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        ( https:\/\/codesandbox.io\/s\/github\/nuxt\/nuxt.js\/tree\/dev\/examples\/auth-routes?from-embed=&amp;file=\/api\/index.js)<br \/>\u8bf7\u95ee\u8fd9\u4e2a\u6848\u4f8b\u91cc\u9762\u7684 session \u662f\u600e\u4e48\u505a\u5230\u9a8c\u8bc1 secret \u9875\u9762\u7684\uff0c\u5b83\u5df2\u7ecf\u88ab\u9884\u5148\u52a0\u8f7d\u4e86\uff0c\u800c\u4e14\u8fdb\u5165\u8fd9\u4e2a\u9875\u9762\u63a7\u5236\u53f0\u5e76\u6ca1\u6709\u770b\u5230\u6709\u8bf7\u6c42\u3002      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4939706\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MENGKE <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u95ee\u9898\u662f\u4ec0\u4e48\u610f\u601d\uff0c\u9a8c\u8bc1\u9875\u9762\uff1f\u8fd8\u662f\u9a8c\u8bc1 session \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4939707\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MENGKE <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u5e94\u8be5\u662f\u60f3\u95ee\u600e\u4e48\u5224\u65ad\u7684\u7b49\u6ca1\u767b\u5f55\u5427\uff1f\u90a3\u4e0d\u662f\u6709\u4e2a\u4e2d\u95f4\u4ef6\u53bb\u505a\u9274\u6743\u5417\uff0cstore \u4e2d\u6ca1\u6709 authUser \u7684\u8bdd\u629b\u51fa 403 \u9519\u8bef\u3002\u767b\u5f55\u7684\u65f6\u5019\u5982\u679c\u8d26\u53f7\u5bc6\u7801\u7b49\u4e8e demo \u54cd\u5e94\u56de username\uff0c\u5ba2\u6237\u7aef\u6536\u5230\u54cd\u5e94\u5b58\u5230 store \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4939708\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 1277840534 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @MENGKE \u767b\u9646\u4e86\u624d\u80fd\u8fdb\u5165 secret \u9875\u9762\u7684\uff0c\u4f46\u662f\u8fd9\u4e2a\u9875\u9762\u5df2\u7ecf\u63d0\u524d\u4e0b\u8f7d\u4e0b\u6765\u4e86\uff0c\u90a3\u767b\u9646\u5b8c\u6210\u4e4b\u540e\u4ed6\u662f\u600e\u4e48\u63a7\u5236\u662f\u5426\u80fd\u591f\u8fdb\u5165\u8fd9\u4e2a\u9875\u9762\u7684\u5462\uff1f\u540e\u53f0\u7528\u4e86 express.session\uff0c\u8fdb\u5165\u8fd9\u4e2a secret \u9875\u9762\u5e76\u6ca1\u6709\u53d1\u51fa\u8bf7\u6c42,\u90a3\u8fd9\u4e2a session \u53c8\u662f\u600e\u4e48\u5728\u767b\u9646\u6210\u529f\u4e4b\u540e\u53bb\u9a8c\u8bc1\u5b83\u7684\u5462\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>nuxt \u6848\u4f8b \u4e2d session&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/280153"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280153"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/280153\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280153"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}