merchant-web/src/api/modules/mer_admin.js

67 lines
2.0 KiB
JavaScript
Raw Normal View History

2024-08-07 09:55:31 +00:00
import $http from '@/utils/httpRequest.js'
2024-08-09 06:14:44 +00:00
import city_data from '@/utils/country-level2-data.js'
2024-08-07 09:55:31 +00:00
export const mer_admin = {
/**
* 登录
* @param {object} params LoginParam
* @param {number} params.type
* @param {string} params.role
* @param {string} params.username
* @param {string} params.password
* @param {string} params.mobile
* @param {string} params.code
* @returns
*/
loginByAccount: (params) => {
return $http.post(`/auth/login`, {
...params,
type: 1
})
},
loginByMobile: (params) => {
return $http.post(`/merchant-api/auth/sms/login`, {
...params,
type: 2
})
},
getYZM(mobile) {
return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`);
},
getInfo() {
return $http.get(`/merchant-api/auth/info`);
},
//商品管理
//保存商品信息
2024-08-09 06:14:44 +00:00
saveProduct: (data) => {
return $http.post(`/merchant-api/product/save`, data);
2024-08-07 09:55:31 +00:00
},
//保存商品基本信息
2024-08-09 06:14:44 +00:00
saveProductBase: (data) => {
return $http.post(`/merchant-api/product/save/basic`, data);
2024-08-07 09:55:31 +00:00
},
//返回商品分类以及列表(聚合)
2024-08-09 06:14:44 +00:00
getPolyProduct: (data) => {
return $http.post(`/merchant-api/product/polymerization/list`, data);
2024-08-07 09:55:31 +00:00
},
//商品分页
2024-08-09 06:14:44 +00:00
getProductPage: (data) => {
return $http.post(`/merchant-api/product/page`, data);
2024-08-07 09:55:31 +00:00
},
//商户商品分类
2024-08-09 06:14:44 +00:00
getProductCategory: () => {
2024-08-07 09:55:31 +00:00
return $http.get(`/merchant-api/product/category/list?shopId=${JSON.parse(sessionStorage.getItem('userInfo')).shopId}`);
2024-08-09 06:14:44 +00:00
},
//获取销售单位
getSaleUnit: (data) => {
return $http.request({ url: `/merchant-api/product/unit/list`, method: 'get', params: data });
},
//文件上传
uploadFile:()=>{
return `${window.SITE_CONFIG['baseUrl']}/merchant-api/file/upload`
},
//直接获取城市数据
getCityOptions:()=>{
return city_data;
2024-08-07 09:55:31 +00:00
}
}