根据用户获取场站
This commit is contained in:
@@ -17,7 +17,7 @@ import { RootState, useAppDispatch } from '../store';
|
||||
import { logout } from '../store/userSlice';
|
||||
import { setCurrentStation, clearStation } from '../store/stationSlice';
|
||||
import { getMenuList } from '../api/mune';
|
||||
import { getStationList } from '../api/stationManage';
|
||||
import { getStationByUserId } from '../api/stationManage';
|
||||
import envConfig from '../../env';
|
||||
|
||||
const { Header, Sider, Content } = Layout;
|
||||
@@ -38,14 +38,10 @@ export default function AppLayout() {
|
||||
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
||||
|
||||
const getStationData = () => {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
orgId: userInfo?.orgId,
|
||||
};
|
||||
getStationList(params).then(res => {
|
||||
|
||||
getStationByUserId().then(res => {
|
||||
if (res.code === 200) {
|
||||
const list = res.rows || [];
|
||||
const list = res.data || [];
|
||||
setStationList(list);
|
||||
if (!currentStation && list.length > 0) {
|
||||
dispatch(setCurrentStation(list[0]));
|
||||
|
||||
Reference in New Issue
Block a user