30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { Outlet, useNavigate } from 'react-router-dom';
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
import { useSearchParams } from 'react-router-dom';
|
|
|
|
const zncmUrl = import.meta.env.VITE_AIPI_CONSUMER_URL || '';
|
|
import { requestCrudService } from '@/service/request-axios-service';
|
|
const service = requestCrudService;
|
|
const userInfo = localStorage.getItem('userInfo');
|
|
const deerFlowUrl = 'https://ch1.b.uat.4.cn/xwtweb/#/login/';
|
|
interface TaskPgFromProps {
|
|
gopath: string
|
|
}
|
|
const GAFromNewQA: React.FC<TaskPgFromProps> = ({gopath}) => {
|
|
const [deerFlow, setDeerFlow] = useState('https://ch1.b.uat.4.cn/xwtweb/#/login/'); // http://localhost:5174/#/
|
|
useEffect(() => {
|
|
if(userInfo) {
|
|
const userName = JSON.parse(userInfo).userName;
|
|
const gaUrl = deerFlowUrl + userName + `?pathTo=${gopath}`
|
|
console.log('gaUrl', gaUrl)
|
|
setDeerFlow(gaUrl);
|
|
}
|
|
}, [gopath]);
|
|
return (
|
|
<div className="h-full flex flex-col">
|
|
<iframe className="h-[calc(100vh-92px)]" src={deerFlow}></iframe>
|
|
</div>
|
|
);
|
|
}
|
|
export default GAFromNewQA
|