2023-12-07 19:05:27 +08:00
|
|
|
|
|
|
|
|
|
import axios from "axios";
|
2023-12-08 18:51:02 +08:00
|
|
|
|
import { ElMessage } from 'element-plus'
|
2023-12-07 19:05:27 +08:00
|
|
|
|
// 创建axios 实例
|
|
|
|
|
const instacne = axios.create({
|
|
|
|
|
baseURL: "https://crmeb-test.shop.lihaink.cn/",
|
|
|
|
|
timeout: 30000,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 请求拦截
|
|
|
|
|
instacne.interceptors.request.use(
|
|
|
|
|
(config) => {
|
|
|
|
|
// 在发送请求之前做什么
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
},
|
|
|
|
|
(err) => {
|
|
|
|
|
return Promise.reject(err);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 响应拦截
|
|
|
|
|
instacne.interceptors.response.use(
|
|
|
|
|
(res) => {
|
2023-12-08 18:51:02 +08:00
|
|
|
|
|
|
|
|
|
if (res.data.status != 200) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: res.data.message,
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return Promise.reject(res.data.message);
|
|
|
|
|
|
|
|
|
|
}
|
2023-12-07 19:05:27 +08:00
|
|
|
|
// 对响应的数据做什么
|
|
|
|
|
return res.data;
|
|
|
|
|
},
|
|
|
|
|
(err) => {
|
|
|
|
|
return Promise.reject(err);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getUserNumApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/user_merchat_count', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getOrderNumApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/order_statistics', { params })
|
|
|
|
|
}
|
|
|
|
|
export function getSalesRankApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/sales_ranking', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getTodayOrderAmountApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/curr_day_order_amount', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getProductCountApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/product_count', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getViewCountApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/view_count', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getUserTradeCountApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/user_trade_count', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getProductCategoryListApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/product_category_list', { params })
|
|
|
|
|
}
|
2023-12-08 00:06:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getProductListApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/product_list', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function merchant_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/merchant_list', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function order_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/order_list', { params })
|
|
|
|
|
}
|
|
|
|
|
export function order_list_count_titleApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/order_list_count_title', { params })
|
|
|
|
|
}
|
|
|
|
|
export function refund_order_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/refund_order_list', { params })
|
|
|
|
|
}
|
|
|
|
|
export function take_order_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/take_order_list', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function take_order_count_titleApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/take_order_count_title', { params })
|
|
|
|
|
}
|
2023-12-07 19:05:27 +08:00
|
|
|
|
|
2023-12-08 18:51:02 +08:00
|
|
|
|
|
|
|
|
|
export function financial_record_titleApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/financial_record_title', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function financial_recordApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/financial_record', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function product_status_filterApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/product_status_filter', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function financial_record_detailApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/financial_record_detail/1', { params })
|
|
|
|
|
}
|
|
|
|
|
export function financial_record_detailApi2(params) {
|
|
|
|
|
return instacne.get('/api/dataview/financial_record_detail/2', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function bill_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/bill_list', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function withdraw_listApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/withdraw_list', { params })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function street_currday_order_countApi(params) {
|
|
|
|
|
return instacne.get('/api/dataview/street_currday_order_count', { params })
|
|
|
|
|
}
|
|
|
|
|
export function loginApi(params) {
|
|
|
|
|
return instacne.post('/api/dataview/login', params)
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
////api/dataview/login {
|
|
|
|
|
// "account": "泸县",
|
|
|
|
|
// "password": "luxian"
|
|
|
|
|
// }
|