initUserInfo static method
初始化用户信息
Implementation
static Future<DataResult> initUserInfo(UserProvider userProvider) async {
///用户信息
String? userId = SpUtil.getString(AppConfig.userId);
dynamic userEntity;
if (userId != null) {
var userDbProvider = UserInfoDbProvider();
userEntity = await userDbProvider.getUserInfo(userId);
if (userEntity != null) {
userProvider.setUserEntity(userEntity);
}
}
bool? isLogin = userEntity != null && SpUtil.getBool(AppConfig.userLogin)!;
return DataResult(userEntity, isLogin == true);
}