瀏覽代碼

added the appURL for path in utils, updated the server env settings

master
[email protected] 1 月之前
父節點
當前提交
9dfc1a33f0
共有 3 個文件被更改,包括 6 次插入5 次删除
  1. +3
    -3
      .env-cmdrc
  2. +1
    -0
      src/auth/utils.js
  3. +2
    -2
      src/pages/pdf/PdfMaintainPage/index.js

+ 3
- 3
.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"
}

+ 1
- 0
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)


+ 2
- 2
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


Loading…
取消
儲存