在~/plugins/axios.js 中右冻,按如下修改
import https from 'https';
export default function ({ $axios, store }) {
const agent = new https.Agent({
rejectUnauthorized: false
});
$axios.onRequest(config => {
if (process.env.NODE_ENV === 'development') { // 此處,視個人情況而定
config.httpsAgent = agent;
}
});
}
大前端知識庫收集分享 www.rjxgc.com 壹玖零Tech
搜羅各種前后端奇淫技巧,花式編程思想瓤的,日日更新忿晕,速來圍觀吧...