feat: 支持一键发布服务端

This commit is contained in:
richarjiang
2026-04-04 15:39:26 +08:00
parent 2b3b636c54
commit 982e569fa3
45 changed files with 852 additions and 34 deletions

View File

@@ -1,6 +1,16 @@
import type { ApiResponse, PaginatedData } from '@mp-pilates/shared'
const BASE_URL = 'http://localhost:3000/api'
const BASE_URL = (() => {
try {
const { miniProgram } = uni.getAccountInfoSync()
if (miniProgram.envVersion !== 'develop') {
return 'https://focus.richarjiang.com/api'
}
} catch {
// 非小程序环境,使用开发地址
}
return 'http://localhost:3000/api'
})()
interface RequestOptions {
readonly url: string