Browse Source

优化蓝牙

feature/rail
LiLongLong 5 months ago
parent
commit
43d5d9b25d
  1. 2
      .env
  2. 2
      package.json
  3. 19
      src/components/Header.tsx

2
.env

@ -1 +1 @@
REACT_APP_WS_URL=localhost:3005
REACT_APP_WS_URL=192.168.1.200

2
package.json

@ -2,7 +2,7 @@
"name": "outline",
"version": "0.1.0",
"private": true,
"proxy":"http://localhost:3005",
"proxy":"http://192.168.1.200:80",
"dependencies": {
"@babel/core": "^7.16.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",

19
src/components/Header.tsx

@ -35,14 +35,21 @@ export default function Header() {
}
}
let [bluetoothList, setbluetoothList] = useState<Device[]>([])
let list = [{
name:'Kdkow_1',
id:'1',
},{
name:'llwoa_2',
id:'2',
}]
let [bluetoothList, setbluetoothList] = useState(list)
//获取mock数据
useEffect(()=>{
getDeviceInfo().then(res => {
console.log('res===', res)
//@ts-ignore
setbluetoothList(res.data.list)
})
// getDeviceInfo().then(res => {
// console.log('res===', res)
// //@ts-ignore
// setbluetoothList(res.data.list)
// })
})
//@ts-ignore

Loading…
Cancel
Save