|
|
@ -9,7 +9,6 @@ import utils from "@/microhost/common"
|
|
|
|
import { isString } from 'lodash'
|
|
|
|
import { isString } from 'lodash'
|
|
|
|
import user from 'mock/user';
|
|
|
|
import user from 'mock/user';
|
|
|
|
import UserModel from '@/models/user';
|
|
|
|
import UserModel from '@/models/user';
|
|
|
|
import { FrameMessage as message1 } from '@/library/union';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TechLoginView = () => {
|
|
|
|
const TechLoginView = () => {
|
|
|
|
const cookieLoginKey = "_defs_ln"
|
|
|
|
const cookieLoginKey = "_defs_ln"
|
|
|
@ -18,9 +17,10 @@ const TechLoginView = () => {
|
|
|
|
const searchParams = new URLSearchParams(window.location.search);
|
|
|
|
const searchParams = new URLSearchParams(window.location.search);
|
|
|
|
const paramValue = searchParams.get('token');
|
|
|
|
const paramValue = searchParams.get('token');
|
|
|
|
const pathValue = searchParams.get('path');
|
|
|
|
const pathValue = searchParams.get('path');
|
|
|
|
|
|
|
|
// const history = useHistory();
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
console.log("token:" + paramValue, pathValue);
|
|
|
|
console.log("token:" + paramValue, "pathValue:" + pathValue);
|
|
|
|
current(paramValue);
|
|
|
|
current(paramValue);
|
|
|
|
|
|
|
|
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
@ -60,89 +60,6 @@ const TechLoginView = () => {
|
|
|
|
window.location.href = "http://172.15.89.232:8080";
|
|
|
|
window.location.href = "http://172.15.89.232:8080";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 跳转ccfowe
|
|
|
|
|
|
|
|
const gomsglog = () => {
|
|
|
|
|
|
|
|
let body: message1 = new message1();
|
|
|
|
|
|
|
|
body.code = '@host#control#openPage';
|
|
|
|
|
|
|
|
body.data = {
|
|
|
|
|
|
|
|
newPage: false,
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
// recordData: JSON.stringify(record),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
moduleId: '41f852c5-dfa3-3057-c62d-197d82f71b58', //要打开的模块id(系统配置-导航菜单-找到所在模块的id)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
body.msg = '跳转';
|
|
|
|
|
|
|
|
body.to = 'iBKLinker-union-framework';
|
|
|
|
|
|
|
|
body.from = 'prd';
|
|
|
|
|
|
|
|
window.top?.postMessage(body, '*');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("财智跳转待办6666666666666666", window.top?.postMessage(body, '*'), body)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// const doLoginccfowe = async (UserId: string) => {
|
|
|
|
|
|
|
|
// let loginId = UserId;
|
|
|
|
|
|
|
|
// // let password = values.password;
|
|
|
|
|
|
|
|
// // if (!loginId || !loginId.trim()) {
|
|
|
|
|
|
|
|
// // message.error('请输入用户名');
|
|
|
|
|
|
|
|
// // return;
|
|
|
|
|
|
|
|
// // } else if (!password || !password.trim()) {
|
|
|
|
|
|
|
|
// // message.error('请输入密码');
|
|
|
|
|
|
|
|
// // return;
|
|
|
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (isRemembered.current) {
|
|
|
|
|
|
|
|
// let month = new Date().getTime() + 1000 * 24 * 3600 * 30 * 3
|
|
|
|
|
|
|
|
// utils.saveCookie(cookieLoginKey, loginId, month)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000")
|
|
|
|
|
|
|
|
// console.log("财智跳转", loginId, result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (isString(result)) {
|
|
|
|
|
|
|
|
// message.error(result)
|
|
|
|
|
|
|
|
// return
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// let redirect: any = history.location.query?.redirect
|
|
|
|
|
|
|
|
// let jumpTo: string | undefined = undefined
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("财智跳转1111111111", redirect, jumpTo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (redirect) {
|
|
|
|
|
|
|
|
// let rd = decodeURIComponent(redirect)
|
|
|
|
|
|
|
|
// jumpTo = isUrl(rd) ? rd : undefined
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (jumpTo) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else {
|
|
|
|
|
|
|
|
// let routes = await MicroApps.BuildRouteTree(loginId)
|
|
|
|
|
|
|
|
// console.log("财智跳转2222222222222", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!routes || routes.length == 0) {
|
|
|
|
|
|
|
|
// history.push("/noauth")
|
|
|
|
|
|
|
|
// console.log("财智跳转333333333333333", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else {
|
|
|
|
|
|
|
|
// jumpTo = "/" //routes[0].defaultPath && routes[0].defaultPath.length > 0 ? routes[0].defaultPath : "/welcome"
|
|
|
|
|
|
|
|
// console.log("财智跳转4444444444444", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// history.push(`/animate?url=${encodeURIComponent(jumpTo)}`)
|
|
|
|
|
|
|
|
// console.log("财智跳转55555555555", redirect, jumpTo, `/animate?url=${encodeURIComponent(jumpTo)}`)
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// gomsglog()
|
|
|
|
|
|
|
|
// }, 100000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const doLogin = async (UserId: string) => {
|
|
|
|
const doLogin = async (UserId: string) => {
|
|
|
|
let loginId = UserId;
|
|
|
|
let loginId = UserId;
|
|
|
|
// let password = values.password;
|
|
|
|
// let password = values.password;
|
|
|
@ -160,7 +77,6 @@ const TechLoginView = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000")
|
|
|
|
let result = await MicroApps.GetRuntimeUser().doLogin(loginId, "000000")
|
|
|
|
// console.log("财智跳转", loginId, result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isString(result)) {
|
|
|
|
if (isString(result)) {
|
|
|
|
message.error(result)
|
|
|
|
message.error(result)
|
|
|
@ -170,9 +86,6 @@ 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("财智跳转1111111111", redirect, jumpTo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (redirect) {
|
|
|
|
if (redirect) {
|
|
|
|
let rd = decodeURIComponent(redirect)
|
|
|
|
let rd = decodeURIComponent(redirect)
|
|
|
|
jumpTo = isUrl(rd) ? rd : undefined
|
|
|
|
jumpTo = isUrl(rd) ? rd : undefined
|
|
|
@ -183,30 +96,20 @@ const TechLoginView = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
let routes = await MicroApps.BuildRouteTree(loginId)
|
|
|
|
let routes = await MicroApps.BuildRouteTree(loginId)
|
|
|
|
// console.log("财智跳转2222222222222", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!routes || routes.length == 0) {
|
|
|
|
if (!routes || routes.length == 0) {
|
|
|
|
history.push("/noauth")
|
|
|
|
history.push("/noauth")
|
|
|
|
// console.log("财智跳转333333333333333", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
jumpTo = "/" //routes[0].defaultPath && routes[0].defaultPath.length > 0 ? routes[0].defaultPath : "/welcome"
|
|
|
|
jumpTo = "/" //routes[0].defaultPath && routes[0].defaultPath.length > 0 ? routes[0].defaultPath : "/welcome"
|
|
|
|
// console.log("财智跳转4444444444444", redirect, jumpTo, routes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
history.push(`/animate?url=${encodeURIComponent(jumpTo)}`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("财智跳转55555555555", redirect, jumpTo, `/animate?url=${encodeURIComponent(jumpTo)}`)
|
|
|
|
history.push(`/animate?url=${encodeURIComponent(jumpTo)}`)
|
|
|
|
if (pathValue == "notice") {
|
|
|
|
if (pathValue == "notice") {
|
|
|
|
// console.log("跳转cc")
|
|
|
|
sessionStorage.setItem("notice", encodeURIComponent(JSON.stringify(pathValue)))
|
|
|
|
// 跳转cc
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
gomsglog()
|
|
|
|
|
|
|
|
}, 5000);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|