You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
500 B
30 lines
500 B
import 'package:recook/manager/user_manager.dart';
|
|
import 'package:recook/widgets/toast.dart';
|
|
|
|
class UserAuthorityUtil{
|
|
|
|
hasLogin(){
|
|
if (UserManager.instance.haveLogin) {// 登录了就渲染用户界面
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
showToast(String title,){
|
|
Toast.showError(title);
|
|
}
|
|
|
|
showNeedLoginToast(){
|
|
if (!hasLogin()) {
|
|
showToast('游客没有权限,请先登录...');
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|