request: fix mixed content for user query
This commit is contained in:
parent
7bbde70631
commit
6375bc8cb2
@ -16,14 +16,15 @@ WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
ARG NEXT_PUBLIC_URL_CRM_GRAPHQL_PROXY
|
||||
ARG NEXT_PUBLIC_COLOR_PRIMARY
|
||||
ARG NEXT_PUBLIC_COLOR_SECONDARY
|
||||
ARG NEXT_PUBLIC_COLOR_TERTIARTY
|
||||
ARG NEXT_PUBLIC_FAVICON
|
||||
ARG NEXT_TELEMETRY_DISABLED
|
||||
ARG NEXT_PUBLIC_URL_CRM_GRAPHQL_PROXY
|
||||
ARG NEXT_PUBLIC_URL_CRM_GRAPHQL_DIRECT
|
||||
ARG NEXT_PUBLIC_URL_GET_USER
|
||||
ARG NEXT_PUBLIC_URL_GET_USER_PROXY
|
||||
ARG NEXT_PUBLIC_URL_GET_USER_DIRECT
|
||||
|
||||
# Next.js collects completely anonymous telemetry data about general usage.
|
||||
# Learn more here: https://nextjs.org/telemetry
|
||||
|
||||
@ -4,10 +4,13 @@ import axios from 'axios';
|
||||
import { love } from './tools';
|
||||
import type { User } from './types';
|
||||
|
||||
// prettier-ignore
|
||||
const uri = typeof window === 'undefined'
|
||||
? process.env.NEXT_PUBLIC_URL_GET_USER_DIRECT
|
||||
: process.env.NEXT_PUBLIC_URL_GET_USER_PROXY;
|
||||
|
||||
export async function getUser(config: AxiosRequestConfig) {
|
||||
const user = await axios
|
||||
.get<User>(process.env.NEXT_PUBLIC_URL_GET_USER || '', config)
|
||||
.then((res) => love(res.data));
|
||||
const user = await axios.get<User>(uri!, config).then((res) => love(res.data));
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@ -32,6 +32,10 @@ const nextConfig = {
|
||||
source: process.env.NEXT_PUBLIC_URL_CRM_GRAPHQL_PROXY,
|
||||
destination: process.env.NEXT_PUBLIC_URL_CRM_GRAPHQL_DIRECT,
|
||||
},
|
||||
{
|
||||
source: process.env.NEXT_PUBLIC_URL_GET_USER_PROXY,
|
||||
destination: process.env.NEXT_PUBLIC_URL_GET_USER_DIRECT,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user