import React, { useState, useRef, useEffect } from 'react';
function App() {
const [value, setValue] = useState(null)
const [values, setValues] = useState(null)
const [balance, setBalance] = useState(null)
useEffect(() => {
requestMap()
}, [])
const requestMap = () => {
let requestMap = [
{ url: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', successFun: setValue },
{ url: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', successFun: setValues },
{ url: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', data: { Type: 'text' }, successFun: setBalance },
]
requestMap.map(({ url, data, successFun }) => {
request({
url,
data,
success: successFun
})
})
}
}
export default App
网友评论