小程序前端接入微信登录与环境配置

This commit is contained in:
stu2not
2026-04-16 18:18:48 +08:00
parent 1b4c47f77a
commit db888df50f
7 changed files with 81 additions and 58 deletions

View File

@@ -1,7 +1,7 @@
import Taro from '@tarojs/taro'
import { API_BASE_URL } from '@/config/env'
// const BASE_URL = 'http://175.24.73.253:8001' // 改为实际后端IP
const BASE_URL = 'http://127.0.0.1:8001'
const BASE_URL = API_BASE_URL
class ApiError extends Error {
constructor(public status: number, message: string) {
@@ -53,4 +53,4 @@ export function getToken(): string {
export function getCurrentUserId(): number {
return Taro.getStorageSync('user_id') || 0
}
}