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