Commit 31d6d7b0 authored by 武广's avatar 武广

fix: 修改review代码

parent 77ccf63b
......@@ -3,8 +3,8 @@
*/
// 从tob进入的判断接口前缀
const getUrlParams = name => {
const regArg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = window.location.search.substring(1).match(regArg);
const regArg = RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = regArg.exec(window.location.search.substring(1));
if (r != null) return decodeURIComponent(r[2]);
return null;
};
......
......@@ -11,7 +11,6 @@ import { connect } from 'dva';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Result, Button, Layout, Menu } from 'antd';
import Authorized from '@/utils/Authorized';
import localStorage from '@/utils/localStorage';
import RightContent from '@/components/GlobalHeader/RightContent';
import MessageReminder from '@/components/MessageReminder';
import { getAuthorityFromRouter, getUrlSearchParams, getToken } from '@/utils/utils';
......
import React, { useState, useEffect } from 'react';
import { Row, Col } from 'antd';
import { Link } from 'umi';
// import { PageHeaderWrapper } from '@ant-design/pro-layout';
// eslint-disable-next-line import/no-extraneous-dependencies
import { FileTextOutlined } from '@ant-design/icons';
import style from './styles.less';
import { getPendingNum } from './service';
import { connect } from 'dva';
import {
AFTER_SALE_ORDER,
CANCEL_BILL_MANAGE,
PENDING_DELIVERY_ORDER,
} from '@/../config/permission.config';
import { AFTER_SALE_ORDER, PENDING_DELIVERY_ORDER } from '@/../config/permission.config';
const Admin = props => {
const [pendingNum, setPendingNum] = useState({});
const showAfterSaleList = props.permissions[AFTER_SALE_ORDER.LIST];
const showCancelBillList = props.permissions[CANCEL_BILL_MANAGE.LIST];
const showPendingDeliveryOrderList = props.permissions[PENDING_DELIVERY_ORDER.LIST];
const qurey = async () => {
const query = async () => {
const res = await getPendingNum();
if (res && res.data) {
setPendingNum(res.data);
}
setPendingNum(res?.data || {});
};
useEffect(() => {
qurey();
query();
}, []);
return (
......
......@@ -4,7 +4,6 @@ import { Card, Pagination, Table, notification, Drawer, Spin, Button, Modal } fr
import React, { Component } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { connect } from 'dva';
import { getToken } from '@/utils/utils';
import styles from './style.less';
import UpdateStock from './UpdateStock';
......
......@@ -3,7 +3,6 @@ import { parse } from 'querystring';
import pathRegexp from 'path-to-regexp';
import moment from 'moment';
import localStorage from './localStorage';
import config from '@/../config/env.config';
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
......@@ -183,8 +182,8 @@ export const getErrorMessage = err => {
// 获取地址栏参数,name:参数名称
export const getUrlParams = name => {
const regArg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = window.location.search.substring(1).match(regArg);
const regArg = RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = regArg.exec(window.location.search.substring(1));
if (r != null) return decodeURIComponent(r[2]);
return null;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment