提交 d97338e1 authored 作者: 钟是志's avatar 钟是志

流程详情页增加 url 带id 登录

上级 4572d7e0
......@@ -6,6 +6,22 @@ import router from 'umi/router';
import { getToken } from '@/utils/authority';
import config from '@/config/config';
const getUrlInfo = (param) => {
let url = window.document.location.href.toString();
let u = url.split("?");
if (typeof(u[1]) == "string") {
u = u[1].split("&");
let get = {};
for (let i in u) {
let j = u[i].split("=");
get[j[0]] = decodeURIComponent(j[1]);
}
return get;
} else {
return {};
}
};
export default class Detail extends Component {
constructor(props) {
super(props);
......@@ -15,6 +31,9 @@ export default class Detail extends Component {
const { record } = state;
id = record.id;
}
if(!id){
id = getUrlInfo()?.id;
}
this.state = {
id,
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论