支持clientid登录

This commit is contained in:
jyuesong
2022-01-19 17:40:32 +08:00
parent fe3e0f1d50
commit 6dbed6cf49
7 changed files with 306 additions and 108 deletions

View File

@@ -7,11 +7,13 @@ class UserInfoViewModel {
String? _host = "";
String? _userName;
String? _passWord;
bool _useSecertLogined = false;
UserInfoViewModel() {
String userInfoJson = SpUtil.getString(spUserInfo);
_userName = SpUtil.getString(spUserName);
_passWord = SpUtil.getString(spPassWord);
_useSecertLogined = SpUtil.getBool(spSecretLogined, defValue: false);
_host = SpUtil.getString(spHost, defValue: 'http://49.234.59.95:5700');
if (userInfoJson.isNotEmpty) {
_token = userInfoJson;
@@ -30,6 +32,11 @@ class UserInfoViewModel {
SpUtil.putString(spPassWord, password);
}
void useSecretLogin(bool use) {
_useSecertLogined = use;
SpUtil.putBool(spSecretLogined, _useSecertLogined);
}
void updateHost(String host) {
_host = host;
SpUtil.putString(spHost, host);
@@ -43,6 +50,8 @@ class UserInfoViewModel {
String? get passWord => _passWord;
bool get useSecretLogined => _useSecertLogined;
bool isLogined() {
return token != null && token!.isNotEmpty;
}