parent
86579f0e2c
commit
b2a682081a
|
|
@ -11,7 +11,7 @@ import 'package:wgshare/common/config/request_config.dart';
|
|||
|
||||
part 'base_structure_result.g.dart';
|
||||
|
||||
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
|
||||
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake,checked: true)
|
||||
class BaseStructureResult<T> extends Object {
|
||||
@JsonKey(name: 'code')
|
||||
int code;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
|
|||
|
||||
part 'user_info_entity.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@JsonSerializable(checked: true)
|
||||
class UserInfoEntity extends Object{
|
||||
|
||||
@JsonKey(name: 'perms')
|
||||
|
|
@ -42,4 +42,5 @@ class UserInfoEntity extends Object{
|
|||
|
||||
factory UserInfoEntity.fromJson(Map<String, dynamic> srcJson) => _$UserInfoEntityFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$UserInfoEntityToJson(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'package:wgshare/common/mixins/request_tool_mixin.dart';
|
|||
import 'package:wgshare/common/store/app_storage_key.dart';
|
||||
import 'package:wgshare/utils/storage.dart';
|
||||
|
||||
import '../../routes/app_routes.dart';
|
||||
import '../models/user_info_entity.dart';
|
||||
|
||||
|
||||
|
|
@ -24,14 +25,12 @@ class UserStore extends GetxController with RequestToolMixin {
|
|||
userInfoEntity.value = UserInfoEntity.fromJson(userDetail);
|
||||
}
|
||||
} catch (err) {
|
||||
debugPrint('wgs输出===:$err');
|
||||
StorageService.to.remove(AppStorageKey.userInfo.value);
|
||||
}
|
||||
if ((token?.isNotEmpty ?? false) && userInfoEntity.value != null) {
|
||||
|
||||
} else {
|
||||
/// TODO 返回登录页面
|
||||
// Get.offAllNamed(Routes.login);
|
||||
Get.offAllNamed(Routes.loginPage);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class MyApp extends StatelessWidget {
|
|||
//默认专场动画
|
||||
defaultTransition: Transition.fade,
|
||||
//初始化路由页面
|
||||
initialRoute: Routes.loginPage,
|
||||
initialRoute: Routes.startPage,
|
||||
|
||||
/// 路由表
|
||||
getPages: AppPages.pages,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:wgshare/common/mixins/request_tool_mixin.dart';
|
||||
import 'package:wgshare/utils/device_info.dart';
|
||||
|
|
@ -8,8 +9,10 @@ import 'package:wgshare/utils/toast_utils.dart';
|
|||
|
||||
import '../../common/models/common/base_structure_result.dart';
|
||||
import '../../common/models/user_info_entity.dart';
|
||||
import '../../common/store/app_storage_key.dart';
|
||||
import '../../common/store/user_store.dart';
|
||||
import '../../routes/app_routes.dart';
|
||||
import '../../utils/storage.dart';
|
||||
import 'login_state.dart';
|
||||
|
||||
class LoginLogic extends GetxController with RequestToolMixin {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:get/get.dart';
|
|||
import 'package:wgshare/main.dart';
|
||||
import 'package:wgshare/pages/userPage/user_logic.dart';
|
||||
import '../../common/store/user_store.dart';
|
||||
import '../../routes/app_routes.dart';
|
||||
import '../../utils/color_util.dart';
|
||||
import '../../utils/hint_dialog.dart';
|
||||
import '../../utils/storage.dart';
|
||||
|
|
@ -180,7 +181,8 @@ class UserPageState extends State<UserPage> {
|
|||
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
|
||||
UserStore.to.erase();
|
||||
Get.offAllNamed(Routes.loginPage);
|
||||
},
|
||||
child: Container(
|
||||
width: 280.w,
|
||||
|
|
|
|||
Loading…
Reference in New Issue