feat: 支持一键发布服务端
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user