2026-03-30 18:08:27 +08:00
|
|
|
|
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',
|
2026-03-31 18:09:37 +08:00
|
|
|
|
eventMyList: '/api/eventclient/my-events',
|
2026-03-30 18:08:27 +08:00
|
|
|
|
eventDetail: (id) => `/api/eventclient/${id}`,
|
2026-04-08 17:32:03 +08:00
|
|
|
|
eventRegistrationStatus: (registrationId) => `/api/eventclient/status/${registrationId}`,
|
2026-03-30 18:08:27 +08:00
|
|
|
|
apply: '/api/eventclient/apply',
|
2026-04-07 17:54:54 +08:00
|
|
|
|
calculateAmount: '/api/eventclient/calculate-amount',
|
2026-05-11 13:56:09 +08:00
|
|
|
|
calculateRefundAmount: '/api/eventclient/calculate-refund-amount',
|
2026-04-09 23:45:36 +08:00
|
|
|
|
cancelRegistrationRefund: '/api/eventclient/cancel-registration-refund',
|
2026-04-13 18:15:37 +08:00
|
|
|
|
couponValidate: '/api/eventclient/coupon/validate',
|
2026-05-09 17:26:30 +08:00
|
|
|
|
syncPayment: (registrationId) => `/api/eventclient/sync-payment/${registrationId}`,
|
|
|
|
|
|
cancelRegistration: (registrationId) => `/api/eventclient/cancel/${registrationId}`,
|
2026-03-30 18:08:27 +08:00
|
|
|
|
|
|
|
|
|
|
wechatLogin: '/api/oauth/login',
|
2026-03-31 23:27:35 +08:00
|
|
|
|
loginByCode: '/api/oauth/login',
|
2026-04-03 17:57:08 +08:00
|
|
|
|
// Refresh token endpoint (请按后端实际接口路径修改)
|
|
|
|
|
|
oauthRefreshToken: '/api/oauth/refresh-token',
|
2026-03-30 18:08:27 +08:00
|
|
|
|
oauthRegister: '/api/oauth/register',
|
2026-03-31 18:09:37 +08:00
|
|
|
|
oauthResetPassword: '/api/oauth/reset-password',
|
|
|
|
|
|
sendVerificationCode: '/api/sms/sendverificationcode',
|
2026-04-07 16:47:13 +08:00
|
|
|
|
/** 小程序 wx.login 的 code 换 openid(按后端实际路径修改) */
|
|
|
|
|
|
wechatOpenidByJsCode: '/api/wechat/jscode2session',
|
2026-03-30 18:08:27 +08:00
|
|
|
|
myProfile: '/api/my/profile',
|
2026-05-09 16:19:37 +08:00
|
|
|
|
updateProfile: '/api/my/avatar/url',
|
2026-03-30 18:08:27 +08:00
|
|
|
|
myAuth: '/api/my/auth',
|
2026-03-31 23:27:35 +08:00
|
|
|
|
myRegistrations: '/api/my/registrations',
|
2026-09-23 16:41:22 +08:00
|
|
|
|
myRegistrationDetail: (registrationId) => `/api/eventclient/my-registration/${registrationId}`,
|
2026-03-31 23:27:35 +08:00
|
|
|
|
myPoints: '/api/my/points',
|
|
|
|
|
|
myOrders: '/api/my/orders',
|
|
|
|
|
|
myTeams: '/api/my/teams',
|
2026-04-10 01:49:07 +08:00
|
|
|
|
myCertificates: '/api/my/certificates',
|
2026-08-07 11:28:38 +08:00
|
|
|
|
// 成绩查询、检录接口(后端接入时保持页面层无需改动)
|
|
|
|
|
|
scoreEvents: '/api/eventclient/scores/events',
|
2026-09-01 23:13:21 +08:00
|
|
|
|
scoreFilters: '/api/eventclient/scores/filters',
|
2026-08-07 11:28:38 +08:00
|
|
|
|
scoreQuery: '/api/eventclient/scores/query',
|
|
|
|
|
|
checkinContext: '/api/checkin/current',
|
|
|
|
|
|
checkinStatus: '/api/checkin/status',
|
2026-09-01 23:13:21 +08:00
|
|
|
|
checkinStart: '/api/checkin/start',
|
|
|
|
|
|
checkinScan: '/api/checkin/scan',
|
|
|
|
|
|
checkinOnStage: '/api/checkin/on-stage',
|
|
|
|
|
|
checkinProgress: '/api/checkin/progress',
|
|
|
|
|
|
refereeProfileOptions: '/api/referee/profile/options',
|
|
|
|
|
|
refereeProfile: '/api/referee/profile',
|
|
|
|
|
|
refereeProfileSubmit: '/api/referee/profile/submit',
|
2026-09-17 14:00:10 +08:00
|
|
|
|
refereeRegistrationCode: (code) => `/api/referee/registration-code/${encodeURIComponent(code)}`,
|
2026-09-01 23:13:21 +08:00
|
|
|
|
refereeApplicationQuota: '/api/referee/applications/quota',
|
2026-08-07 11:28:38 +08:00
|
|
|
|
refereeApplications: '/api/referee/applications',
|
|
|
|
|
|
refereeApply: '/api/referee/applications/apply',
|
2026-04-10 01:49:07 +08:00
|
|
|
|
fileUpload: '/api/file/upload',
|
2026-04-24 01:53:36 +08:00
|
|
|
|
uploadMaterial: '/api/eventclient/upload-material',
|
2026-04-10 01:49:07 +08:00
|
|
|
|
ocrIdCard: '/api/ocr/recognize/idcard',
|
2026-06-15 21:50:50 +08:00
|
|
|
|
ocrPassport: '/api/ocr/recognize/passport',
|
|
|
|
|
|
ocrHousehold: '/api/ocr/recognize/household'
|
2026-03-30 18:08:27 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
getBaseUrl,
|
|
|
|
|
|
API
|
|
|
|
|
|
};
|
|
|
|
|
|
|