vue2.0配置代理API在开发和生产环境中运行
发布时间
阅读量:
阅读量
业务场景:由于仅需在内网中调用接口,无需使用ngix,因此生产环境不存在跨域问题,无需通过api代理进行处理;然而在本地环境则存在跨域问题,需要配置代理。
实现需求:本地环境需提供api接口,而生产环境则不提供api接口。


以下是实现方法:
1、 config/index.js

'use strict'
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory
全部评论 (0)
还没有任何评论哟~
