|
|
@@ -118,10 +118,20 @@ class _LoginPageState extends State < LoginPage > {
|
|
|
setKey('password',password);
|
|
|
setKey('nickName',loginObj.data.nickName);
|
|
|
setKey('printType','1');//设置打印类型
|
|
|
- setKey('stationId', loginObj.data.stationId);//设置站点id
|
|
|
- Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
|
|
|
- return HomePage();
|
|
|
- }));
|
|
|
+ setKey('stationId', loginObj.data.stationIds[0].toString());//设置站点id
|
|
|
+ getStationList().then((resp) {
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
+ Station stationObj = Station.fromJson(resp.data);
|
|
|
+ for (int i = 0; i < stationObj.data.length; i++) {
|
|
|
+ if (stationObj.data[i].id.toString() == loginObj.data.stationIds[0].toString()) {
|
|
|
+ setKey('stationName', stationObj.data[i].name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
|
|
|
+ return HomePage();
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ });
|
|
|
}else{
|
|
|
setState(() {
|
|
|
loginStatus = true;
|