{"id":114,"date":"2021-01-18T20:45:21","date_gmt":"2021-01-18T12:45:21","guid":{"rendered":"http:\/\/gjweb.top\/?p=114"},"modified":"2021-01-18T20:45:22","modified_gmt":"2021-01-18T12:45:22","slug":"vue%e6%89%93%e5%8c%85%e6%88%90%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83%e5%92%8c%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e4%b8%8d%e5%90%8c%e7%9a%84url","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=114","title":{"rendered":"vue\u6253\u5305\u6210\u751f\u4ea7\u73af\u5883\u548c\u5f00\u53d1\u73af\u5883\u4e0d\u540c\u7684URL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u8bbe\u7f6e\u4e0d\u540c\u7684\u63a5\u53e3\u5730\u5740<\/h2>\n\n\n\n<p>\u627e\u5230\u6587\u4ef6:\/config\/dev.env.js\uff08\u5f00\u53d1\u73af\u5883\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var merge = require('webpack-merge')\nvar prodEnv = require('.\/prod.env')\n\nmodule.exports = merge(prodEnv, {\n  NODE_ENV: '\"development\"',&lt;br&gt;\u3000\u3000\/\/\u6dfb\u52a0\n  API_ROOT: '\"\/\/192.168.1.8\/api\"'\n})<\/code><\/pre>\n\n\n\n<p>\u8bbe\u7f6e\u4ee3\u7801&#8221;\/config\/prod.env.js&#8221; \uff08\u751f\u4ea7\u73af\u5883\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>module.exports = {\n  NODE_ENV: '\"production\"',\n    \/\/\u6dfb\u52a0\n  API_ROOT: '\"\/\/www.baidu.com\/api\"'\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8c03\u7528axios\u7684\u6587\u4ef6\u4e0b\u4fee\u6539\uff08main.js\u4e2d\uff09<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>axios.defaults.baseURL = process.env.API_ROOT<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bbe\u7f6e\u4e0d\u540c\u7684\u63a5\u53e3\u5730\u5740 \u627e\u5230\u6587\u4ef6:\/config\/dev.env.js\uff08\u5f00\u53d1\u73af\u5883\uff09 \u8bbe\u7f6e\u4ee3\u7801&#8221;\/con [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-vue"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=114"}],"version-history":[{"count":0,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}