根据用户获取场站

This commit is contained in:
mmc
2026-07-09 09:50:46 +08:00
parent 1c229f32b0
commit 463322427b
5 changed files with 30 additions and 25 deletions

View File

@@ -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]));