{"id":127696,"date":"2020-06-16T22:44:33","date_gmt":"2020-06-16T14:44:33","guid":{"rendered":"http:\/\/4563.org\/?p=127696"},"modified":"2020-06-16T22:44:33","modified_gmt":"2020-06-16T14:44:33","slug":"%e4%b8%80%e4%b8%aa-console-log-%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=127696","title":{"rendered":"\u4e00\u4e2a console. log \u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e00\u4e2a console. log \u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gramyang <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u521a\u5f00\u59cb\u5b66 js\uff0c\u9047\u5230\u4e00\u4e2a\u95ee\u9898\uff1a\u5728 vue \u4e2d\u4f7f\u7528 axios \u505a\u8bf7\u6c42\uff0c\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u7528 alert \u5f39\u7a97\u663e\u793a\u4e00\u4e0b\uff0c\u7ed3\u679c\u6570\u636e\u62a5\u7a7a\u4e14\u62a5 provisional request headers \u3002<br \/>\u5176\u4e2d\u5b58\u5728\u8de8\u57df\u7684\u95ee\u9898\uff0c\u4f46\u662f\u540e\u7aef\u8fdb\u884c\u4e86\u5904\u7406\u3002<br \/>\u6298\u817e\u4e86\u534a\u5929\u90fd\u627e\u4e0d\u5230\u539f\u56e0\uff0c\u540e\u6765\u628a alert \u6539\u6210 console. log\uff0c\u95ee\u9898\u89e3\u51b3\u4e86\u3002\u3002\u3002<br \/>\u8fd9\u662f\u4ec0\u4e48\u539f\u7406\uff1f      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>15<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2185952\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : oukichi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ee3\u7801\u4e5f\u4e0d\u8d34\uff0cHTTP \u8bf7\u6c42\u4e5f\u4e0d\u8d34\uff0c\u4f60\u8ba9\u522b\u4eba\u600e\u4e48\u5e2e\u4f60\u554a\u5144\u5f1f\u3002<br \/>\u6211\u53ea\u80fd\u8bf4\u8fd9\u4e2a\u548c alert \u4ee5\u53ca console.log \u534a\u6bdb\u94b1\u5173\u7cfb\u4e5f\u4e48\u6709                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185953\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : gramyang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @oukichi \u5c31\u662f\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u524d\u7aef axios\uff0c\u540e\u7aef gin \u8de8\u57df\uff0c\u540c\u6837\u7684\u4ee3\u7801\u7528 alert \u5c31\u62a5\u9519\uff0c\u7528 console. log \u5c31\u53ef\u4ee5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185954\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zarte <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u731c\u4f60\u6253\u5370\u7684\u65f6\u5019\u53d8\u91cf\u786e\u5b9e\u662f\u7a7a\u7684\uff0cconsole.log \u6bd4\u8f83\u7279\u522b\u5728\u4f60\u70b9\u5f00\u67e5\u770b\u7684\u65f6\u5019\u83b7\u53d6\u7684\u662f\u5f53\u524d\u503c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185955\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : gramyang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zarte \u5bf9\uff0c\u8bf4 console. log \u6709\u5ef6\u8fdf\u6027                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185956\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 1iuh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u662f\u6709\u5ef6\u8fdf\uff0c \u4f60\u8f93\u51fa\u7684\u5982\u679c\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c \u4f60\u770b\u5230\u7684\u503c\u662f\u5f53\u524d\u7684\u503c\uff0c\u800c\u4e0d\u662f\u4f60\u8f93\u51fa\u7684\u65f6\u5019\u7684\u503c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185957\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : crystom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u662f\u7684\uff0c\u6253\u5370\u4e4b\u524d json \u4e00\u4e0b\u624d\u80fd\u786e\u5b9a\u503c\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185958\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shintendo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u70b9\u8fdb\u6765\u524d\u5c31\u77e5\u9053\u662f\u6253\u5370\u5bf9\u8c61\u7684\u95ee\u9898\uff0cconsole.log \u4e5f\u5c31\u8fd9\u70b9\u95ee\u9898\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185959\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xingyue <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c03\u8bd5\u5efa\u8bae\uff1a<br \/>1. debugger;<br \/>2. console.log(JSON.stringify(response));<\/p>\n<p>\u4f46\u662f\u4f60\u7684\u95ee\u9898\u6211\u5c1d\u8bd5\u590d\u73b0\u4f46\u662f\u65e0\u6cd5\u590d\u73b0\uff0c\u6309\u7406\u8bf4 alert(response)\u81f3\u5c11\u4e5f\u663e\u793a\u4e2a[object Object],\u56e0\u4e3a\u8bf7\u6c42\u662f\u5df2\u7ecf\u62ff\u5230\u6570\u636e\u5e76\u901a\u8fc7\u4e86 axios \u7684\u89e3\u6790\u4e86\u7684\uff1b<br \/>\u8d34\u4e00\u4e2a demo \u5730\u5740\uff1a https:\/\/codesandbox.io\/s\/elegant-field-e0r0v?file=\/src\/App.vue                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185960\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhw2590582 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             alert \u6253\u5370\u662f\u4e94\u5e74\u591a\u4ee5\u524d\u624d\u7528\u7684 debug \u65b9\u6cd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185961\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : VDimos <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             console.log \u6253\u5370\u7684\u662f\u5185\u5b58\u5730\u5740\uff0c\u70b9\u51fb\u5c55\u5f00\u5b83\u4ece\u5185\u5b58\u4e2d\u8bfb\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185962\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhuweiyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             log \u548c alert \u4e4b\u524d\uff0c\u5148 JSON.stringify \u3002<\/p>\n<p>\u4e0d\u8fc7 provisional request headers \u80af\u5b9a\u8ddf\u4f60\u8fd9\u4e2a\u6ca1\u5173\u7cfb\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185963\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wxsm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bf9\u4e8e obj \u6765\u8bf4\uff0cconsole \u6253\u5370\u7684\u662f\u5f15\u7528\uff0c\u5e76\u4e0d\u662f\u5feb\u7167\u3002alert \u662f\u5feb\u7167\uff0c\u5c31\u8fd9\u70b9\u533a\u522b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185964\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Chenamy2017 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             #5 \u8bf4\u7684\u5bf9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185965\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jmyz0455 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u4e86\u89e3\u4e00\u4e0b\u5f15\u7528\u5bf9\u8c61                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2185966\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shpasspass <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u662f\u5728\u5fae\u4fe1\u91cc\u6253\u5f00\u7684\u7f51\u9875\uff0c\u4e00\u5f00\u59cb alert \u7684\u8bdd\uff0c\u4f1a\u6709\u5f88\u5927\u6982\u7387\u4e0d\u5f39 alert \u51fa\u6765                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a console. log \u7684&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\/127696"}],"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=127696"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/127696\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127696"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}