update: ENV

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

@ -6,7 +6,7 @@ const nextConfig = {
return [ return [
{ {
source: '/queyueapi/:path*', 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 request = async (url: string, config?: RequestOptions) => {
const method = config?.method || 'GET'; 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 = { const inital: RequestOptions = {
method: method, method: method,

Loading…
Cancel
Save