const getBaseUrl = () => { const app = getApp(); return app && app.globalData && app.globalData.baseUrl ? app.globalData.baseUrl : ''; }; const API = { banners: '/api/eventclient/banners', eventList: '/api/eventclient/list', eventMyList: '/api/eventclient/my-events', eventDetail: (id) => `/api/eventclient/${id}`, eventRegistrationStatus: (registrationId) => `/api/eventclient/status/${registrationId}`, myRegistrationDetail: (registrationId) => `/api/eventclient/my-registration/${registrationId}`, apply: '/api/eventclient/apply', calculateAmount: '/api/eventclient/calculate-amount', cancelRegistrationRefund: '/api/eventclient/cancel-registration-refund', couponValidate: '/api/eventclient/coupon/validate', wechatLogin: '/api/oauth/login', loginByCode: '/api/oauth/login', // Refresh token endpoint (请按后端实际接口路径修改) oauthRefreshToken: '/api/oauth/refresh-token', oauthRegister: '/api/oauth/register', oauthResetPassword: '/api/oauth/reset-password', sendVerificationCode: '/api/sms/sendverificationcode', /** 小程序 wx.login 的 code 换 openid(按后端实际路径修改) */ wechatOpenidByJsCode: '/api/wechat/jscode2session', myProfile: '/api/my/profile', myAuth: '/api/my/auth', myRegistrations: '/api/my/registrations', myPoints: '/api/my/points', myOrders: '/api/my/orders', myTeams: '/api/my/teams', myCertificates: '/api/my/certificates', fileUpload: '/api/file/upload', uploadMaterial: '/api/eventclient/upload-material', ocrIdCard: '/api/ocr/recognize/idcard', ocrPassport: '/api/ocr/recognize/passport' }; module.exports = { getBaseUrl, API };