27 lines
895 B
TypeScript
27 lines
895 B
TypeScript
import { Outlet, useNavigate } from 'react-router-dom';
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
import { useSearchParams } from 'react-router-dom';
|
|
|
|
import { requestCrudService } from '@/service/request-axios-service';
|
|
const service = requestCrudService;
|
|
const userInfo = localStorage.getItem('userInfo');
|
|
const xkLinkUrl = import.meta.env.VITE_AIPI_XKLINKTO_URL;
|
|
interface TaskPgFromProps {
|
|
gopath: string
|
|
}
|
|
const TaskXkFrom: React.FC<TaskPgFromProps> = ({gopath}) => {
|
|
const [xkUrl, setXkUrl] = useState(xkLinkUrl);
|
|
useEffect(() => {
|
|
if(userInfo) {
|
|
const userData: any = JSON.parse(userInfo);
|
|
setXkUrl(`${xkLinkUrl}${gopath}?accessToken=${userData.accessToken}`);
|
|
}
|
|
}, [gopath]);
|
|
return (
|
|
<div className="h-full flex flex-col">
|
|
<iframe className="h-[calc(100vh-92px)]" src={xkUrl}></iframe>
|
|
</div>
|
|
);
|
|
}
|
|
export default TaskXkFrom
|