diff --git a/.env-cmdrc b/.env-cmdrc index 3409860..ef25452 100644 --- a/.env-cmdrc +++ b/.env-cmdrc @@ -9,9 +9,9 @@ }, "2fi-production": { "REACT_APP_ENV": "2fi-production", - "REACT_APP_URL": "http://20.2.170.164/", - "REACT_APP_BACKEND_PROTOCOL": "http", - "REACT_APP_BACKEND_HOST": "20.2.170.164", + "REACT_APP_URL": "https://forms.lioner.com/", + "REACT_APP_BACKEND_PROTOCOL": "https", + "REACT_APP_BACKEND_HOST": "forms.lioner.com", "REACT_APP_BACKEND_PORT": "8090", "REACT_APP_BACKEND_API_PATH": "/api" } diff --git a/src/auth/utils.js b/src/auth/utils.js index 143f099..75e0a83 100644 --- a/src/auth/utils.js +++ b/src/auth/utils.js @@ -10,6 +10,7 @@ export const hostname = process.env.REACT_APP_BACKEND_HOST const hostPort = process.env.REACT_APP_BACKEND_PORT export const hostPath = `${process.env.REACT_APP_BACKEND_PROTOCOL}://${hostname}:${hostPort}` export const apiPath = `${hostPath}/api` +export const appURL = `${process.env.REACT_APP_URL}` export const isUserLoggedIn = () => { return localStorage.getItem('userData') && localStorage.getItem(useJwt.jwtConfig.storageTokenKeyName) diff --git a/src/pages/pdf/PdfMaintainPage/index.js b/src/pages/pdf/PdfMaintainPage/index.js index c8b3d86..4b9ee57 100644 --- a/src/pages/pdf/PdfMaintainPage/index.js +++ b/src/pages/pdf/PdfMaintainPage/index.js @@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { Button, Grid } from '@mui/material'; import { GeneralConfirmWindow, notifySaveSuccess } from "../../../utils/CommonFunction"; import axios from 'axios'; -import {apiPath} from "../../../auth/utils"; +import {apiPath, appURL} from "../../../auth/utils"; import { GET_PDF_TEMPLATE_PATH, GET_PDF_PATH, @@ -107,7 +107,7 @@ function PDF() { // container: '#viewer', document: pdfUrl, // baseUrl: `./sdk/`, // Path to SDK assets - baseUrl: `http://localhost:3000/sdk/`, // Path to SDK + baseUrl: `${appURL}/sdk/`, // Path to SDK // baseUrl: `${window.location.protocol}//${window.location.host}/${import.meta.env.BASE_URL}`, // baseUrl: `https://cdn.jsdelivr.net/npm/pspdfkit@VERSION/dist/`, // Path to SDK assets so this is work? // baseUrl: `${process.env.PUBLIC_URL}/`, // Path to SDK assets