{"id":152418,"date":"2020-09-07T12:15:23","date_gmt":"2020-09-07T04:15:23","guid":{"rendered":"http:\/\/4563.org\/?p=152418"},"modified":"2020-09-07T12:15:23","modified_gmt":"2020-09-07T04:15:23","slug":"%e5%90%8c%e4%b8%80%e5%a5%97%e4%b8%9a%e5%8a%a1%e9%80%bb%e8%be%91%ef%bc%8c%e5%b0%8f%e7%a8%8b%e5%ba%8ftoken%e5%92%8c-html%ef%bc%88session%ef%bc%89%e7%ab%af%ef%bc%8c%e5%a6%82%e6%9e%9c%e5%85%b1%e7%94%a8","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=152418","title":{"rendered":"\u540c\u4e00\u5957\u4e1a\u52a1\u903b\u8f91\uff0c\u5c0f\u7a0b\u5e8f(token)\u548c html\uff08session\uff09\u7aef\uff0c\u5982\u679c\u5171\u7528\u540c\u4e00\u540e\u53f0\uff0c\u767b\u5f55\u6001\u5982\u4f55\u505a\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u540c\u4e00\u5957\u4e1a\u52a1\u903b\u8f91\uff0c\u5c0f\u7a0b\u5e8f(token)\u548c html\uff08session\uff09\u7aef\uff0c\u5982\u679c\u5171\u7528\u540c\u4e00\u540e\u53f0\uff0c\u767b\u5f55\u6001\u5982\u4f55\u505a\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lianjin <\/span>  <span><i><\/i> 18<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u540c\u4e00\u5957\u4e1a\u52a1\u903b\u8f91\uff0c\u8981\u5b9e\u73b0\u5c0f\u7a0b\u5e8f\u7aef\u548c\u7f51\u9875\u7aef\u3002 \u540e\u7aef\u7528 python \u5199\u7684\uff0c\u5df2\u7ecf\u505a\u524d\u540e\u7aef\u5206\u79bb\uff0cMVP \u65b9\u5f0f\u3002html \u7aef\u7684\u767b\u5f55\u6001\u5224\u65ad\u662f\u7528\u7684 flask \u7684 g \u5bf9\u8c61\u3002 \u95ee\u9898\uff1a 1 \u3001\u662f\u540c\u4e00\u5957\u540e\u7aef\u597d\uff0c\u8fd8\u662f\u540e\u7aef\u903b\u8f91\u5404\u7528\u5404\u7684\uff1f 2 \u3001\u5982\u679c\u7528\u540c\u4e00\u5957\uff0c\u8be5\u7528\u81ea\u5b9a\u4e49\u767b\u5f55\u6001\u4e48\uff1f\u5982\u6709\uff0c\u6c42\u7ed9\u4e2a github \u6848\u4f8b\u5b66\u4e60\u4e0b\u3002 \u8c22\u8c22\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>10<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3061331\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vangkinva <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u65e2\u7136\u524d\u540e\u7aef\u5206\u79bb\uff0c\u5c31\u76f4\u63a5 jwt \u65b9\u6848\u54c8\uff0c\u7f51\u9875\u548c\u5c0f\u7a0b\u5e8f\u90fd\u7528 jwt\uff0c\u90fd\u662f\u5f88\u6210\u719f\u7684\u65b9\u6848\uff0c\u5c0f\u7a0b\u5e8f\u548c\u7f51\u9875\u7aef\u90fd\u5f88\u5bb9\u6613\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061332\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : winglight2016 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u7528\u8fc7 flask\uff0c\u4f46\u662f\u60f3\u6765\u5e94\u8be5\u6709 middleware \u6765\u505a\u9274\u6743\u5427\uff0c\u53ef\u4ee5\u4e3a\u4e0d\u540c\u5ba2\u6237\u7aef\u5199\u4e0d\u540c\u7684\u9274\u6743\u6a21\u5757\uff0c\u7528\u6237\u4fe1\u606f\u7edf\u4e00\u653e\u5728\u4e00\u4e2a\u5730\u65b9\u80fd\u83b7\u53d6\u5230\u5c31\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061333\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : amundsen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             jwt \u5c31\u884c\u4e86\uff0c\u5f88\u9002\u5408\u8fd9\u4e2a\u573a\u666f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061334\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Leon6868 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @amundsen \u4f46\u662f\u5982\u679c\u60f3\u63d0\u524d\u5220\u9664\u767b\u5f55\u72b6\u6001\uff0cjwt \u5c31\u6709\u70b9\u96be\u4e86\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061335\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SmartKeyerror <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u7ba1\u662f\u5c0f\u7a0b\u5e8f\u7aef\u8fd8\u662f H5 \u7aef\uff0c\u90fd\u4f7f\u7528\u540c\u4e00\u4e2a token \u8fdb\u884c\u767b\u5f55\u5c31\u597d\u4e86\uff0c\u4e0d\u7ba1\u8fd9\u4e2a token \u662f\u4f7f\u7528 JWT\uff0c\u8fd8\u662f\u81ea\u5b9a\u4e49\u7684 token \u3002<br \/>\u5982\u679c\u53ef\u4ee5\u7684\u8bdd\uff0c\u53ef\u4ee5\u505a\u4e00\u4e2a\u7edf\u4e00\u7528\u6237\u767b\u5f55\u4e2d\u5fc3\uff0c\u5f00\u53e6\u5916\u7684\u4e00\u4e2a\u5fae\u670d\u52a1\uff0c\u8be5\u670d\u52a1\u505a\u7684\u4e8b\u60c5\u5c31\u662f\u4fdd\u5b58 H5 \u7528\u6237\u4fe1\u606f\u3001\u5c0f\u7a0b\u5e8f\u7528\u6237\u4fe1\u606f\uff0c\u7ef4\u62a4 H5 \u7528\u6237\u548c\u5c0f\u7a0b\u5e8f\u7528\u6237\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4ee5\u53ca\u767b\u5f55\u3001\u767b\u5f55\u6001\u7684\u7ef4\u62a4\u3002<br \/>\u8fd9\u6837\u4e00\u6765\uff0c\u5982\u679c\u540e\u9762\u6709\u652f\u4ed8\u5b9d\u7528\u6237\u3001APP \u7528\u6237\u7684\u8bdd\uff0c\u4e5f\u80fd\u591f\u5f88\u597d\u7684\u517c\u5bb9\u3002\u4e1a\u52a1\u7aef\u65e0\u9700\u5173\u5fc3\u5177\u4f53\u767b\u5f55\u6765\u6e90\uff0c\u53ea\u9700\u8981\u62ff\u7740 token \u53bb\u8be5\u670d\u52a1\u6362\u53d6\u7528\u6237\u4fe1\u606f\u5373\u53ef(\u4ee5\u53ca\u5224\u5b9a\u767b\u5f55\u72b6\u6001)\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061336\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuanbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u90fd\u6539\u6210\u7528 token \u5c31\u884c\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061337\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : find456789 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 django\uff0c\u914d\u5408\u7b2c\u4e09\u65b9\u6846\u67b6 drf\uff0cdrf \u53ef\u4ee5\u914d\u7f6e\u540c\u65f6\u652f\u6301 session \u548c token\uff0c <\/p>\n<p>&#8220;`python<\/p>\n<p> &#8216;DEFAULT_AUTHENTICATION_CLASSES&#8217;: (<br \/> &#8216;rest_framework.authentication.TokenAuthentication&#8217;, #\u624b\u673a app<br \/> &#8216;rest_framework.authentication.SessionAuthentication&#8217;, # \u6d4f\u89c8\u5668\u7684\u5f02\u6b65\u8bf7\u6c42<br \/> ),<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061338\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MLeo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u505a\u4e00\u4e2a\u7edf\u7684\u767b\u5f55\u63a5\u53e3\uff0c\u4e0d\u7ba1\u662f token \u8fd8\u662f sessionId\uff0c\u76f4\u63a5\u8fd4\u52a0\u767b\u5f55\u4fe1\u606f\uff0c\u5176\u5b83\u7684\u4e1a\u52a1\u4ee3\u7801\u90fd\u662f\u4e00\u6837\u7684\u5c31\u53ef\u4ee5\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061339\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : amundsen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Leon6868 \u4e0d\u4f1a\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3061340\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : amundsen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Leon6868 \u6709\u4ec0\u4e48\u573a\u666f\u9700\u8981\u63d0\u524d\u5220\u9664\u5ba2\u6237\u7aef\u7684\u767b\u5f55\u6001\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u4e00\u5957\u4e1a\u52a1\u903b\u8f91\uff0c\u5c0f\u7a0b\u5e8f(token&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\/152418"}],"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=152418"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/152418\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152418"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}