| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- /**
- * API配置
- */
- // 判断是否为开发环境
- // @ts-ignore
- const isDevelopment = import.meta.env.DEV || false;
- /** 客服电话 */
- export const CUSTOMER_SERVICE_PHONE = '400-0755-315';
- /** 应用版本号(与 package.json 同步) */
- export const APP_VERSION = 'v1.62.11';
- export const API_CONFIG = {
- // 后端API基础URL
- // 注意:上线生产环境时需替换为正式域名
- baseUrl: 'https://dev-haha.kuaiyuman.cn/api',
- // baseUrl: 'http://192.168.10.100:7077/api', // 本地开发
- // baseUrl: 'http://localhost:7077/api', // 本地开发
- // 请求超时时间(毫秒)
- timeout: 10000,
- // 是否显示请求日志
- enableLog: isDevelopment
- };
- /**
- * API接口路径
- * 各 API 文件从此处引用路径常量,避免硬编码
- */
- export const API_PATHS = {
- // 用户相关
- loginMiniappPhone: '/login/miniapp-phone',
- getUserInfo: '/login/user-info',
- logout: '/login/logout',
-
- // 设备相关
- scanDoor: '/device/scan-open',
- checkDeviceStatus: '/device/status',
- getDeviceProducts: (deviceId: string) => `/device/products/${deviceId}`,
-
- // 订单相关
- getOrders: '/order/list',
- getOrderDetail: '/order/detail',
- cancelOrder: '/order/cancel',
-
- // 支付分相关
- createPayscoreOrder: '/payscore/create',
-
- // 优惠券相关
- getMyCoupons: '/coupon/my',
- getCouponDetail: (id: string) => `/coupon/${id}`,
- receiveCoupon: (templateId: string) => `/coupon/receive/${templateId}`,
- getCouponCount: '/coupon/count',
- getAvailableCoupons: '/coupon/available',
- getUsableCoupons: '/coupon/usable',
-
- // 状态轮询相关
- pollDeviceStatus: '/status/device',
- pollRecognizeResult: '/status/recognize',
- pollOrderInfo: '/status/order',
- pollAllStatus: '/status/all',
-
- // 公告相关
- getAnnouncementList: '/announcement/list',
- getAnnouncementDetail: '/announcement/detail',
-
- // 补货员相关
- replenisherWechatLogin: '/replenisher/login/wechat',
- replenisherBind: '/replenisher/login/bind',
- replenisherMyInfo: '/replenisher/my-info'
- };
|