Commit e9f7a39c authored by thh's avatar thh

update

parent 6ee4303b
......@@ -53,12 +53,47 @@
}
}
},
"@types/http-proxy": {
"version": "1.17.4",
"resolved": "https://registry.npm.taobao.org/@types/http-proxy/download/@types/http-proxy-1.17.4.tgz",
"integrity": "sha1-58kuPb4+E6p5lED/QubToXqdBFs=",
"requires": {
"@types/node": "*"
}
},
"@types/json-schema": {
"version": "7.0.4",
"resolved": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.4.tgz?cache=0&sync_timestamp=1588200629858&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.4.tgz",
"integrity": "sha1-OP1z3f2bVaux4bLtV4y1W9e30zk=",
"dev": true
},
"@types/node": {
"version": "14.0.11",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.11.tgz",
"integrity": "sha1-YdSIbiQk2nO3slVH9Z/ctTTBZaM="
},
"@umijs/hooks": {
"version": "1.9.3",
"resolved": "https://registry.npm.taobao.org/@umijs/hooks/download/@umijs/hooks-1.9.3.tgz",
"integrity": "sha1-zA3p6DJxTgPBM4q6F5aa7S0pr9c=",
"requires": {
"@umijs/use-request": "^1.4.3",
"intersection-observer": "^0.7.0",
"lodash.isequal": "^4.5.0",
"resize-observer-polyfill": "^1.5.1",
"screenfull": "^5.0.0"
}
},
"@umijs/use-request": {
"version": "1.4.3",
"resolved": "https://registry.npm.taobao.org/@umijs/use-request/download/@umijs/use-request-1.4.3.tgz?cache=0&sync_timestamp=1591111910493&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40umijs%2Fuse-request%2Fdownload%2F%40umijs%2Fuse-request-1.4.3.tgz",
"integrity": "sha1-vF+txMsH15brNfCYONahXLEoAvc=",
"requires": {
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"umi-request": "^1.2.17"
}
},
"abab": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/abab/download/abab-1.0.4.tgz?cache=0&sync_timestamp=1573609024450&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fabab%2Fdownload%2Fabab-1.0.4.tgz",
......@@ -469,6 +504,32 @@
"resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.10.0.tgz?cache=0&sync_timestamp=1590182515104&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.10.0.tgz",
"integrity": "sha1-oXs6jqgRBg501H0wYSJACtRJeuI="
},
"axios": {
"version": "0.19.2",
"resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.2.tgz",
"integrity": "sha1-PqNsXYgY0NX4qKl6bTa4bNwAyyc=",
"requires": {
"follow-redirects": "1.5.10"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
"requires": {
"ms": "2.0.0"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz?cache=0&sync_timestamp=1585479417937&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.5.10.tgz",
"integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
"requires": {
"debug": "=3.1.0"
}
}
}
},
"axobject-query": {
"version": "0.1.0",
"resolved": "https://registry.npm.taobao.org/axobject-query/download/axobject-query-0.1.0.tgz",
......@@ -5420,27 +5481,53 @@
}
},
"http-proxy-middleware": {
"version": "0.17.4",
"resolved": "https://registry.npm.taobao.org/http-proxy-middleware/download/http-proxy-middleware-0.17.4.tgz?cache=0&sync_timestamp=1589915518285&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy-middleware%2Fdownload%2Fhttp-proxy-middleware-0.17.4.tgz",
"integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=",
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/http-proxy-middleware/download/http-proxy-middleware-1.0.4.tgz?cache=0&sync_timestamp=1589915518285&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy-middleware%2Fdownload%2Fhttp-proxy-middleware-1.0.4.tgz",
"integrity": "sha1-Ql6hd5hqDNo0+cgeyWHHGa22wqk=",
"requires": {
"http-proxy": "^1.16.2",
"is-glob": "^3.1.0",
"lodash": "^4.17.2",
"micromatch": "^2.3.11"
"@types/http-proxy": "^1.17.4",
"http-proxy": "^1.18.1",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"micromatch": "^4.0.2"
},
"dependencies": {
"braces": {
"version": "3.0.2",
"resolved": "http://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz",
"integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=",
"requires": {
"fill-range": "^7.0.1"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "http://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz",
"integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=",
"requires": {
"to-regex-range": "^5.0.1"
}
},
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz",
"resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
},
"is-glob": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz",
"integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
"version": "4.0.1",
"resolved": "http://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz",
"integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=",
"requires": {
"is-extglob": "^2.1.1"
}
},
"micromatch": {
"version": "4.0.2",
"resolved": "http://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz",
"integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=",
"requires": {
"is-extglob": "^2.1.0"
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
}
}
......@@ -5653,6 +5740,11 @@
"resolved": "https://registry.npm.taobao.org/interpret/download/interpret-1.4.0.tgz?cache=0&sync_timestamp=1591167206134&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finterpret%2Fdownload%2Finterpret-1.4.0.tgz",
"integrity": "sha1-Zlq4vE2iendKQFhOgS4+D6RbGh4="
},
"intersection-observer": {
"version": "0.7.0",
"resolved": "https://registry.npm.taobao.org/intersection-observer/download/intersection-observer-0.7.0.tgz?cache=0&sync_timestamp=1587661629695&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fintersection-observer%2Fdownload%2Fintersection-observer-0.7.0.tgz",
"integrity": "sha1-7ha+6XjbU1FurS8KgVSwm0ALvck="
},
"invariant": {
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finvariant%2Fdownload%2Finvariant-2.2.4.tgz",
......@@ -6862,6 +6954,11 @@
"resolved": "https://registry.npm.taobao.org/lodash.cond/download/lodash.cond-4.5.2.tgz",
"integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU="
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "http://registry.npm.taobao.org/lodash.debounce/download/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
},
"lodash.defaults": {
"version": "4.2.0",
"resolved": "https://registry.npm.taobao.org/lodash.defaults/download/lodash.defaults-4.2.0.tgz?cache=0&sync_timestamp=1571657646879&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash.defaults%2Fdownload%2Flodash.defaults-4.2.0.tgz",
......@@ -6872,6 +6969,11 @@
"resolved": "https://registry.npm.taobao.org/lodash.flow/download/lodash.flow-3.5.0.tgz",
"integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "http://registry.npm.taobao.org/lodash.isequal/download/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npm.taobao.org/lodash.memoize/download/lodash.memoize-4.1.2.tgz",
......@@ -6894,6 +6996,11 @@
"lodash._reinterpolate": "^3.0.0"
}
},
"lodash.throttle": {
"version": "4.1.1",
"resolved": "http://registry.npm.taobao.org/lodash.throttle/download/lodash.throttle-4.1.1.tgz",
"integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ="
},
"lodash.uniq": {
"version": "4.5.0",
"resolved": "https://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz",
......@@ -7793,8 +7900,7 @@
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz?cache=0&sync_timestamp=1584790434095&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpicomatch%2Fdownload%2Fpicomatch-2.2.2.tgz",
"integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=",
"optional": true
"integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0="
},
"pify": {
"version": "2.3.0",
......@@ -10463,6 +10569,11 @@
"resolved": "https://registry.npm.taobao.org/requires-port/download/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "http://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
},
"resolve": {
"version": "1.17.0",
"resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz",
......@@ -10793,6 +10904,11 @@
"ajv": "^5.0.0"
}
},
"screenfull": {
"version": "5.0.2",
"resolved": "https://registry.npm.taobao.org/screenfull/download/screenfull-5.0.2.tgz",
"integrity": "sha1-uazc8exnapSGdN9c0P9muQKwvtc="
},
"select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz",
......@@ -11748,7 +11864,6 @@
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz",
"integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=",
"optional": true,
"requires": {
"is-number": "^7.0.0"
},
......@@ -11756,8 +11871,7 @@
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz",
"integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=",
"optional": true
"integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss="
}
}
},
......@@ -11930,6 +12044,22 @@
}
}
},
"umi-request": {
"version": "1.3.3",
"resolved": "https://registry.npm.taobao.org/umi-request/download/umi-request-1.3.3.tgz?cache=0&sync_timestamp=1590568018088&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fumi-request%2Fdownload%2Fumi-request-1.3.3.tgz",
"integrity": "sha1-nwU6O798jol2XKjjwBGPHLhIHxE=",
"requires": {
"isomorphic-fetch": "^2.2.1",
"qs": "^6.9.1"
},
"dependencies": {
"qs": {
"version": "6.9.4",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.9.4.tgz",
"integrity": "sha1-kJCykNH5FyjTwi5UhDykSupatoc="
}
}
},
"unicode-canonical-property-names-ecmascript": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
......@@ -13103,6 +13233,116 @@
"resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-1.0.0.tgz",
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo="
},
"http-proxy-middleware": {
"version": "0.17.4",
"resolved": "https://registry.npm.taobao.org/http-proxy-middleware/download/http-proxy-middleware-0.17.4.tgz?cache=0&sync_timestamp=1589915518285&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-proxy-middleware%2Fdownload%2Fhttp-proxy-middleware-0.17.4.tgz",
"integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=",
"requires": {
"http-proxy": "^1.16.2",
"is-glob": "^3.1.0",
"lodash": "^4.17.2",
"micromatch": "^2.3.11"
},
"dependencies": {
"arr-diff": {
"version": "2.0.0",
"resolved": "http://registry.npm.taobao.org/arr-diff/download/arr-diff-2.0.0.tgz",
"integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
"requires": {
"arr-flatten": "^1.0.1"
}
},
"array-unique": {
"version": "0.2.1",
"resolved": "http://registry.npm.taobao.org/array-unique/download/array-unique-0.2.1.tgz",
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM="
},
"braces": {
"version": "1.8.5",
"resolved": "http://registry.npm.taobao.org/braces/download/braces-1.8.5.tgz",
"integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
"requires": {
"expand-range": "^1.8.1",
"preserve": "^0.2.0",
"repeat-element": "^1.1.2"
}
},
"expand-brackets": {
"version": "0.1.5",
"resolved": "http://registry.npm.taobao.org/expand-brackets/download/expand-brackets-0.1.5.tgz",
"integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
"requires": {
"is-posix-bracket": "^0.1.0"
}
},
"extglob": {
"version": "0.3.2",
"resolved": "http://registry.npm.taobao.org/extglob/download/extglob-0.3.2.tgz",
"integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
"requires": {
"is-extglob": "^1.0.0"
},
"dependencies": {
"is-extglob": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-1.0.0.tgz",
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA="
}
}
},
"is-glob": {
"version": "3.1.0",
"resolved": "http://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz",
"integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
"requires": {
"is-extglob": "^2.1.0"
}
},
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"requires": {
"is-buffer": "^1.1.5"
}
},
"micromatch": {
"version": "2.3.11",
"resolved": "http://registry.npm.taobao.org/micromatch/download/micromatch-2.3.11.tgz",
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"requires": {
"arr-diff": "^2.0.0",
"array-unique": "^0.2.1",
"braces": "^1.8.2",
"expand-brackets": "^0.1.4",
"extglob": "^0.3.1",
"filename-regex": "^2.0.0",
"is-extglob": "^1.0.0",
"is-glob": "^2.0.1",
"kind-of": "^3.0.2",
"normalize-path": "^2.0.1",
"object.omit": "^2.0.0",
"parse-glob": "^3.0.4",
"regex-cache": "^0.4.2"
},
"dependencies": {
"is-extglob": {
"version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-1.0.0.tgz",
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA="
},
"is-glob": {
"version": "2.0.1",
"resolved": "http://registry.npm.taobao.org/is-glob/download/is-glob-2.0.1.tgz",
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"requires": {
"is-extglob": "^1.0.0"
}
}
}
}
}
},
"is-accessor-descriptor": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz",
......@@ -13137,6 +13377,11 @@
"kind-of": "^6.0.2"
}
},
"is-extglob": {
"version": "2.1.1",
"resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz",
......
......@@ -3,8 +3,11 @@
"version": "2.0.0",
"private": true,
"dependencies": {
"@umijs/hooks": "^1.9.3",
"antd-mobile": "^2.3.3",
"axios": "^0.19.2",
"customize-cra": "^1.0.0",
"http-proxy-middleware": "^1.0.4",
"lib-flexible": "^0.3.2",
"postcss-px2rem": "^0.3.0",
"react": "^16.8.4",
......@@ -29,5 +32,6 @@
"react-app-rewire-postcss": "^3.0.2",
"react-app-rewired": "^1.2.9",
"style-loader": "^1.2.1"
}
},
"proxy": "http://124.93.101.8:9988/"
}
import React from 'react';
import React, { } from 'react';
import Footer from './Footer'
import {withRouter} from 'react-router-dom'
import './index.less'
......
import React, { useEffect } from 'react';
import { useRequest } from "@umijs/hooks";
import axios from 'axios';
import {withRouter} from 'react-router-dom'
// import { postRequest } from '../../utils/request';
// import './index.less'
const Login = (props) => {
// axios.post('/dgbg/mobileLogin.view?userName=2012012099&password=1&clientFlag=123456')
// .then(function (response) {
// // handle success
// console.log(response);
// })
// .catch(function (error) {
// // handle error
// console.log(error);
// })
// .finally(function () {
// // always executed
// });
const { data, error, loading } = useRequest({
url: '/dgbg/mobileLogin.view?userName=2012012099&password=1&clientFlag=123456',
method: 'post'
});
return (
<div>
<div className="common-layout-content">
<div>
{props.children}
</div>
</div>
</div>
);
};
export default withRouter(Login) ;
import React, {Component} from 'react';
import React, { useState } from 'react';
import { useRequest } from "@umijs/hooks";
import {ActivityIndicator, WhiteSpace, WingBlank} from "antd-mobile";
import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard'
const Work = () => {
class Work extends Component {
state = {
addStatus: false,
loading: false
};
commonEdit = () => {
const {addStatus} = this.state;
this.setState({addStatus: !addStatus})
const [addStatus, setAddStatus] = useState(false);
const { data, error, loading } = useRequest({
url: '/dgbg/mobileGetOperates.view?userName=2012012099&clientFlag=123456',
method: 'post'
});
const commonEdit = () => {
setAddStatus(!addStatus);
};
workSearch = (val) => {
const workSearch = (val) => {
console.log(val)
};
itemAdd = (id, arr, arr2) => {
const itemAdd = (id, arr, arr2) => {
// const item = arr2.filter(item => item.id === id);
// arr.splice(arr.length - 1, 0, item[0]);
};
itemSlice = (id, arr, arr2) => {
const itemSlice = (id, arr, arr2) => {
// const index = arr.findIndex(item => item.id == id);
// index > -1 && arr.splice(index, 1);
};
render() {
const {addStatus, loading} = this.state;
//测试数据
const data222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name${i}`,
icon: '/img/test/test.png',
text: `name${i}`,
}));
const data22222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name2${i}`,
icon: '/img/test/test-1.png',
text: `name${i}`,
}));
//测试数据
const data222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name${i}`,
icon: '/img/test/test.png',
text: `name${i}`,
}));
const data22222 = Array.from(new Array(7)).map((_val, i) => ({
id: `name2${i}`,
icon: '/img/test/test-1.png',
text: `name${i}`,
}));
return (
<WingBlank>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<WhiteSpace/>
<TopSearch onSearch={this.workSearch}/>
<WhiteSpace/>
<WorkCard
type="edit"
title="常用板块"
addCommon={this.commonEdit}
addStatus={addStatus}
data={data222}
iconAction={this.itemSlice}
/>
<WhiteSpace/>
<WorkCard
title="事物管理"
addCommon={this.commonEdit}
addStatus={addStatus}
data={data22222}
iconAction={this.itemAdd}
/>
</WingBlank>
);
}
console.log(data);
return (
<WingBlank>
<ActivityIndicator
toast
text="加载中..."
animating={loading}
/>
<WhiteSpace/>
<TopSearch onSearch={ workSearch }/>
<WhiteSpace/>
<WorkCard
type="edit"
title="常用板块"
addCommon={ commonEdit }
addStatus={addStatus}
data={data222}
iconAction={ itemSlice }
/>
<WhiteSpace/>
<WorkCard
title="事物管理"
addCommon={ commonEdit }
addStatus={addStatus}
data={data && data.operate.map(item => ({ icon: '', text: item.NODENAME })) || []}
iconAction={ itemAdd }
/>
</WingBlank>
);
}
export default Work;
......@@ -9,6 +9,8 @@ import Notice from './pages/Notice/Notice'
import AddressList from './pages/AddressList/AddressList';
import Process from './pages/EventProcessing/Process'
import Login from './pages/Login'
import NoFound from './pages/NoFound'
......@@ -17,10 +19,11 @@ const ReactRouter = () => {
return (
<Router>
<Switch>
<Route path="/login" component={Login} />
<Route exact path="/" render={() => <Redirect to="/bord/backlog" />} />
<Route path="/bord" render={ () =>
<CommonLayout>
<Route path="/bord/backlog" component={Backlog}/>
<Route path="/bord/backlog" component={Backlog} />
<Route path="/bord/work" component={Work}/>
<Route path="/bord/addressList" component={AddressList}/>
<Route path="/bord/notice" component={Notice}/>
......
// const proxy = require("http-proxy-middleware");
// module.exports = function(app) {
// app.use(
// proxy("/api/**", {
// target: "http://120.79.76.162:10081/",
// changeOrigin: true
// })
// );
// app.use(
// proxy("/fans/**", {
// target: "https://easy-mock.com/mock/5c0f31837214cf627b8d43f0/",
// changeOrigin: true
// })
// );
// };
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://124.93.101.8:9988/',
changeOrigin: true,
})
);
};
\ No newline at end of file
import axios from 'axios';
import { parse, stringify } from 'qs';
const instance = axios.create();
const token = 'bearer ' + localStorage.getItem("token");
let defaultHeaders = {
token,
};
const codeMessage = {
200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。',
202: '一个请求已经进入后台排队(异步任务)。',
204: '删除数据成功。',
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
401: '用户没有权限(用户名或密码错误)。',
403: '用户得到授权,但是访问是被禁止的。',
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
406: '请求的格式不可得。',
410: '请求的资源被永久删除,且不会再得到的。',
422: '当创建一个对象时,发生一个验证错误。',
500: '服务器发生错误,请检查服务器。',
502: '网关错误。',
503: '服务不可用,服务器暂时过载或维护。',
504: '网关超时。',
};
export const createAPI = (baseURL) => {
return (conf = {}) => {
let opts = conf.opts || {};
let body = conf.body || {};
let urlParams = '';
let headers = { ...defaultHeaders, ...opts.headers };
if (conf.queryType === 'query') {
urlParams = conf.body ? "?" + stringify(conf.body) : '';
}
return instance(Object.assign({}, {
url: conf.url + urlParams,
baseURL: baseURL,
method: conf.method,
data: body,
headers,
}, conf.opts))
.then(function (response) {
if (!response || response.data === false) { console.log('response出错!', response); return false; }
// 保存到本地
if (response && response.data && response.data.access_token) {
defaultHeaders = {
token: 'bearer ' + response.data.access_token,
}
localStorage.setItem("token", response.data.access_token);
}
if (response.data && response.data.success || response.data && (response.data.success === undefined && response.data.error === undefined)) {
return response.data;
} else {
message.error(response.data && (response.data.mesg || response.data.message) || '操作出现错误!')
return response.data;
}
})
.catch(error => {
if (error.response) {
const { status, statusText, url } = error.response;
const errortext = codeMessage[status] || statusText;
// notification.error({
// key: status,
// message: `请求错误 ${status}`,
// description: errortext,
// });
if (status === 401) {
// @HACK
/* eslint-disable no-underscore-dangle */
history.push('/user/login');
message.error('登录过期或用户名密码错误!')
return false;
} else if (status === 400 || status > 401) {
history.push(`/exception/${status}`);
}
}
return false;
});
};
}
export const convertRESTAPI = (url, opts) => {
if (!opts) return url;
const pathKeys = Object.keys(opts);
pathKeys.forEach((key) => {
const r = new RegExp('(:' + key + '|{' + key + '})', 'g');
url = url.replace(r, opts[key]);
});
return url;
}
import { createAPI } from './instance';
export const apiUrl = 'http://124.93.101.8:9988/dgbg/';
// mobileLogin.view
// 测试账户:2012012099
// 密码:1
const instance = createAPI(apiUrl);
export function postRequest(url, params = {}) {
return instance({
method: 'post',
url: url,
opts: params,
});
}
\ No newline at end of file
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