update: ENV

mack-mac
mackt 8 months ago
parent c1e49fdb27
commit 8405f0d01c

@ -6,7 +6,7 @@ const nextConfig = {
return [
{
source: '/queyueapi/:path*',
destination: `http://api.indie.cn:9012/:path*`,
destination: `${process.env.NEXT_PUBLIC_HOST}/:path*`,
},
];
},

@ -11,7 +11,7 @@ interface RequestOptions extends RequestInit {
// 发送数据请求
const request = async (url: string, config?: RequestOptions) => {
const method = config?.method || 'GET';
const finalUrl = method === 'POST' ? `/queyueapi${url}` : `http://api.indie.cn:9012/${url}`;
const finalUrl = method === 'POST' ? `/queyueapi${url}` : `${process.env.NEXT_PUBLIC_HOST}/${url}`;
const inital: RequestOptions = {
method: method,

Loading…
Cancel
Save