测试跳转

master
wuzuowei 4 months ago
parent d73c12cea8
commit 592b43834c

@ -18,6 +18,7 @@ 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);
useEffect(() => { useEffect(() => {
console.log("token:" + paramValue, "pathValue:" + pathValue); console.log("token:" + paramValue, "pathValue:" + pathValue);
@ -27,7 +28,7 @@ const TechLoginView = () => {
const current = (date: string) => { const current = (date: string) => {
// console.log("date", date) console.log("date", date)
requestaxios requestaxios
@ -39,11 +40,11 @@ const TechLoginView = () => {
} }
}) })
.then(({ data }) => { .then(({ data }) => {
// console.log("data", data.code); 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)
@ -52,12 +53,12 @@ const TechLoginView = () => {
} else { } else {
message.error('获取财智系统用户信息报错!'); message.error('获取财智系统用户信息报错!');
window.location.href = "https://metal.dayesteel.com.cn"; // window.location.href = "https://metal.dayesteel.com.cn";
} }
}) })
.catch((reason) => { .catch((reason) => {
message.error('调取财智系统用户信息报错' + reason); message.error('调取财智系统用户信息报错' + reason);
window.location.href = "https://metal.dayesteel.com.cn"; // window.location.href = "https://metal.dayesteel.com.cn";
}); });
}; };
const doLogin = async (UserId: string) => { const doLogin = async (UserId: string) => {
@ -77,6 +78,7 @@ const TechLoginView = () => {
} }
let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000") let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000")
console.log("resultresult111111111111", result)
if (isString(result)) { if (isString(result)) {
message.error(result) message.error(result)
@ -85,10 +87,13 @@ 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)
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)
} }
if (jumpTo) { if (jumpTo) {
@ -125,6 +130,7 @@ const TechLoginView = () => {
} }
return ( return (
<> <>
2222222222222222
</>); </>);

Loading…
Cancel
Save