自习室优化ok
This commit is contained in:
@@ -7,9 +7,9 @@ class UserStore extends ChangeNotifier {
|
||||
UserInfoDto? userInfo;
|
||||
String token = "";
|
||||
|
||||
Future<void> init() async{
|
||||
Future<void> init() async {
|
||||
token = await getToken();
|
||||
await setUserInfo();
|
||||
await setUserInfo();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@@ -41,4 +41,10 @@ class UserStore extends ChangeNotifier {
|
||||
token = '';
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
///强制退出(不调用接口、不通知 UI)
|
||||
static Future<void> forceLogout() async {
|
||||
await Storage.remove('token');
|
||||
await Storage.remove('user_info');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user