平台跳转

master
wuzuowei 4 months ago
parent 592b43834c
commit 4c92545972

@ -18,17 +18,17 @@ const TechLoginView = () => {
const paramValue = searchParams.get('token'); const paramValue = searchParams.get('token');
const pathValue = searchParams.get('path'); const pathValue = searchParams.get('path');
// const history = useHistory(); // const history = useHistory();
console.log("token111:" + paramValue, "pathValue111:" + pathValue, searchParams); // console.log("token111:" + paramValue, "pathValue111:" + pathValue, searchParams);
useEffect(() => { useEffect(() => {
console.log("token:" + paramValue, "pathValue:" + pathValue); // console.log("token:" + paramValue, "pathValue:" + pathValue);
current(paramValue); current(paramValue);
}, []) }, [])
const current = (date: string) => { const current = (date: string) => {
console.log("date", date) // console.log("date", date)
requestaxios requestaxios
@ -40,11 +40,11 @@ const TechLoginView = () => {
} }
}) })
.then(({ data }) => { .then(({ data }) => {
console.log("data", data.code, data); // console.log("data", data.code, data);
if (data.loginName != undefined) { if (data.loginName != undefined) {
//拿到账号密码之后进行登录 //拿到账号密码之后进行登录
console.log(data); // console.log(data);
let month = new Date().getTime() + 1000 * 24 * 3600 * 30 * 3 let month = new Date().getTime() + 1000 * 24 * 3600 * 30 * 3
utils.saveCookie('CZtoken', paramValue, month) utils.saveCookie('CZtoken', paramValue, month)
@ -78,7 +78,7 @@ const TechLoginView = () => {
} }
let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000") let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000")
console.log("resultresult111111111111", result) // console.log("resultresult111111111111", result)
if (isString(result)) { if (isString(result)) {
message.error(result) message.error(result)
@ -87,12 +87,12 @@ const TechLoginView = () => {
let redirect: any = history.location.query?.redirect let redirect: any = history.location.query?.redirect
let jumpTo: string | undefined = undefined let jumpTo: string | undefined = undefined
console.log("111111111111", redirect) // console.log("111111111111", redirect)
if (redirect) { if (redirect) {
let rd = decodeURIComponent(redirect) let rd = decodeURIComponent(redirect)
jumpTo = isUrl(rd) ? rd : undefined jumpTo = isUrl(rd) ? rd : undefined
console.log("22222222222", rd, jumpTo) // console.log("22222222222", rd, jumpTo)
} }
@ -130,7 +130,6 @@ const TechLoginView = () => {
} }
return ( return (
<> <>
2222222222222222
</>); </>);

Loading…
Cancel
Save