lilishop-uniapp/config/api.js

39 lines
874 B
JavaScript
Raw Normal View History

2021-05-13 11:03:32 +08:00
/**
* base : 基础业务API
* buyer : 买家API
*/
// 开发环境
const dev = {
common: "https://common-api.pickmall.cn",
2021-06-04 17:32:39 +08:00
buyer: "https://buyer-api.pickmall.cn",
// common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888',
2021-05-13 11:03:32 +08:00
};
// 生产环境
2021-06-04 17:32:39 +08:00
const prod = {
// common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.109:8888',
2021-05-13 11:03:32 +08:00
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
2021-05-13 11:03:32 +08:00
};
//默认生产环境
let api = dev;
2021-05-13 11:03:32 +08:00
//如果是开发环境
if (process.env.NODE_ENV == "development") {
api = dev;
} else {
api = prod;
}
//微信小程序app的打包方式只能是生产环境所以这块直接条件编译赋值
// #ifdef MP-WEIXIN || APP-PLUS
api = prod;
// #endif
api.buyer += "/buyer";
api.common += "/common";
export default {
...api,
};