mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 02:47:25 +08:00
Merge branch 'uniapp-vue3' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp into uniapp-vue3
This commit is contained in:
@@ -37,7 +37,7 @@ export function getLogistics() {
|
|||||||
*/
|
*/
|
||||||
export function getAddressCode(cityCode, townName) {
|
export function getAddressCode(cityCode, townName) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: api.common + "/common/region/region",
|
url: `${api.buyer}/common/region/region`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params: { cityCode, townName },
|
params: { cityCode, townName },
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* 公共API
|
* 公共 API(由 buyer-api 提供)
|
||||||
*/
|
*/
|
||||||
import { http, Method } from "@/utils/request.js";
|
import { http, Method } from "@/utils/request.js";
|
||||||
import api from "@/config/api.js";
|
import api from "@/config/api.js";
|
||||||
@@ -10,16 +10,16 @@ import api from "@/config/api.js";
|
|||||||
*/
|
*/
|
||||||
export function getRegionsById(id = 0) {
|
export function getRegionsById(id = 0) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/common/region/item/${id}`,
|
url: `${api.buyer}/common/region/item/${id}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
message: false,
|
message: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取IM接口前缀
|
// 获取 IM 接口前缀
|
||||||
export function getIMDetail() {
|
export function getIMDetail() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/IM`,
|
url: `${api.buyer}/common/IM`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
message: false,
|
message: false,
|
||||||
});
|
});
|
||||||
@@ -29,14 +29,14 @@ export function getIMDetail() {
|
|||||||
* 文件上传地址
|
* 文件上传地址
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const upload = api.common + "/common/upload/file";
|
export const upload = `${api.buyer}/common/upload/file`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取主题色配置
|
* 获取主题色配置
|
||||||
*/
|
*/
|
||||||
export function getThemeSetting() {
|
export function getThemeSetting() {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/common/common/site/theme`,
|
url: `${api.buyer}/common/site/theme`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
message: false,
|
message: false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import { http, Method } from "@/utils/request.js";
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从ES中获取相关商品品牌名称,分类名称及属性
|
* 获取商品搜索筛选条件
|
||||||
*/
|
*/
|
||||||
export function getGoodsRelated(params) {
|
export function getGoodsRelated(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `/goods/goods/es/related`,
|
url: `/goods/goods/search/related`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -56,7 +56,7 @@ export function getGoodsRelated(params) {
|
|||||||
*/
|
*/
|
||||||
export function getGoodsList(params) {
|
export function getGoodsList(params) {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/goods/goods/es",
|
url: "/goods/goods/search",
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function getAutoCoup(){
|
|||||||
*/
|
*/
|
||||||
export function sendMobile(mobile,type='LOGIN') {
|
export function sendMobile(mobile,type='LOGIN') {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: `${api.common}/common/sms/${type}/${mobile}`,
|
url: `${api.buyer}/common/sms/${type}/${mobile}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,35 @@
|
|||||||
/**
|
/**
|
||||||
* base : 基础业务API
|
* buyer : 买家 API(baseURL 为 buyer + /buyer)
|
||||||
* buyer : 买家API
|
|
||||||
*/
|
*/
|
||||||
// 开发环境
|
// 开发环境
|
||||||
const dev = {
|
const dev = {
|
||||||
im: "https://im-api.pickmall.cn",
|
|
||||||
common: "https://common-api.pickmall.cn",
|
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
|
im: "https://im-api.pickmall.cn",
|
||||||
mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt",
|
mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt",
|
||||||
|
|
||||||
};
|
};
|
||||||
// 生产环境
|
// 生产环境
|
||||||
const prod = {
|
const prod = {
|
||||||
im: "https://im-api.pickmall.cn",
|
|
||||||
common: "https://common-api.pickmall.cn",
|
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt"
|
im: "https://im-api.pickmall.cn",
|
||||||
|
mqtt: "wss://lilishop-mqtt-pull.dllll.xyz/mqtt",
|
||||||
};
|
};
|
||||||
|
|
||||||
//默认生产环境
|
|
||||||
let api = dev;
|
let api = dev;
|
||||||
//如果是开发环境
|
|
||||||
if (process.env.NODE_ENV == "development") {
|
if (process.env.NODE_ENV == "development") {
|
||||||
api = dev;
|
api = dev;
|
||||||
} else {
|
} else {
|
||||||
api = prod;
|
api = prod;
|
||||||
}
|
}
|
||||||
//微信小程序,app的打包方式建议为生产环境,所以这块直接条件编译赋值
|
// 微信小程序、App 打包使用生产环境配置
|
||||||
// #ifdef MP-WEIXIN || APP-PLUS
|
// #ifdef MP-WEIXIN || APP-PLUS
|
||||||
api = prod;
|
api = prod;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
api.buyer += "/buyer";
|
const buyerHost = api.buyer;
|
||||||
api.common += "/common";
|
api.buyer = buyerHost + "/buyer";
|
||||||
api.im += "/im";
|
api.im = api.im + "/im";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...api,
|
...api,
|
||||||
|
buyerHost,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user