소스 검색

updated the key of adobe API

master
[email protected] 1 개월 전
부모
커밋
3e716a05b7
3개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. +3
    -1
      .env-cmdrc
  2. +1
    -0
      src/auth/utils.js
  3. +3
    -3
      src/pages/pdf/PdfViewer/index.js

+ 3
- 1
.env-cmdrc 파일 보기

@@ -5,6 +5,7 @@
"REACT_APP_BACKEND_PROTOCOL": "http",
"REACT_APP_BACKEND_HOST": "localhost",
"REACT_APP_BACKEND_PORT": "8090",
"REACT_APP_ADOBE_API_KEY": "97e02339319940a28d1181b1a06076a2",
"REACT_APP_BACKEND_API_PATH": "/api"
},
"2fi-production": {
@@ -12,7 +13,8 @@
"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_PORT": "8090",
"REACT_APP_ADOBE_API_KEY": "ee4433f258a74641ae6d502fd41cf703",
"REACT_APP_BACKEND_API_PATH": "/api"
}
}

+ 1
- 0
src/auth/utils.js 파일 보기

@@ -11,6 +11,7 @@ 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 adobeAPIKey = `${process.env.REACT_APP_ADOBE_API_KEY}`

export const isUserLoggedIn = () => {
return localStorage.getItem('userData') && localStorage.getItem(useJwt.jwtConfig.storageTokenKeyName)


+ 3
- 3
src/pages/pdf/PdfViewer/index.js 파일 보기

@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { useParams } from 'react-router-dom'; // Import useParams
import { apiPath, GET_PDF_PATH } from "../../../auth/utils";
import { apiPath, adobeAPIKey } from "../../../auth/utils";

const PdfViewer = ({ pdfUrl, formCode }) => {
const { id } = useParams();
@@ -45,7 +45,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => {
const loadAdobeSDK = () => {
if (window.AdobeDC) {
const adobeDCView = new window.AdobeDC.View({
clientId: '97e02339319940a28d1181b1a06076a2',
clientId: `${adobeAPIKey}`,
divId: 'adobe-dc-view',
});

@@ -73,7 +73,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => {
window.AdobeDC.View.Enum.CallbackType.SAVE_API,
async (metaData, content, options) => {
try {
const saveUrl = `http://localhost:8090/api/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`;
const saveUrl = `${apiPath}/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`;
console.log('Saving to:', saveUrl);
console.log('Authorization header:', `Bearer ${token}`);
const response = await fetch(saveUrl, {


불러오는 중...
취소
저장