feat: 添加生产环境配置,重构 API 请求,更新部署脚本和配置
This commit is contained in:
@@ -6,6 +6,7 @@ import { X, Image as ImageIcon } from 'lucide-react'
|
||||
import Image from 'next/image'
|
||||
import { Spinner } from '@/components/ui/spinner'
|
||||
import COS from 'cos-js-sdk-v5'
|
||||
import { apiFetch } from '@/lib/api'
|
||||
|
||||
interface ImageUploaderProps {
|
||||
value: string
|
||||
@@ -38,7 +39,7 @@ export function ImageUploader({ value, onChange }: ImageUploaderProps) {
|
||||
|
||||
try {
|
||||
// Get temp key
|
||||
const keyRes = await fetch('/api/cos/temp-key')
|
||||
const keyRes = await apiFetch('/api/cos/temp-key')
|
||||
if (!keyRes.ok) {
|
||||
throw new Error('获取上传凭证失败')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user