超管后台 - 将所有http请求硬编码改为环境变量配置

This commit is contained in:
柳清爽
2025-04-23 10:35:33 +08:00
parent 4b5b3a7156
commit ede31de6b9
5 changed files with 11 additions and 12 deletions

View File

@@ -36,7 +36,7 @@ export default function EditProjectPage({ params }: { params: { id: string } })
useEffect(() => {
const fetchProjectDetail = async () => {
try {
const response = await fetch(`http://yishi.com/company/detail/${id}`)
const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/company/detail/${id}`)
const data = await response.json()
if (data.code === 200) {
@@ -71,7 +71,7 @@ export default function EditProjectPage({ params }: { params: { id: string } })
setIsSubmitting(true)
try {
const response = await fetch(`http://yishi.com/company/update`, {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/company/update`, {
method: "POST",
headers: {
"Content-Type": "application/json",