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

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

上级 4572d7e0
...@@ -6,6 +6,22 @@ import router from 'umi/router'; ...@@ -6,6 +6,22 @@ import router from 'umi/router';
import { getToken } from '@/utils/authority'; import { getToken } from '@/utils/authority';
import config from '@/config/config'; 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 { export default class Detail extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -14,6 +30,9 @@ export default class Detail extends Component { ...@@ -14,6 +30,9 @@ export default class Detail extends Component {
if (state && state.record && state.record.id) { if (state && state.record && state.record.id) {
const { record } = state; const { record } = state;
id = record.id; id = record.id;
}
if(!id){
id = getUrlInfo()?.id;
} }
this.state = { this.state = {
id, id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论