mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
强制横屏
This commit is contained in:
@ -26,8 +26,7 @@ class UserInfoViewModel {
|
|||||||
_useSecertLogined = SpUtil.getBool(spSecretLogined, defValue: false);
|
_useSecertLogined = SpUtil.getBool(spSecretLogined, defValue: false);
|
||||||
_host = SpUtil.getString(spHost, defValue: '');
|
_host = SpUtil.getString(spHost, defValue: '');
|
||||||
|
|
||||||
List<dynamic>? tempList =
|
List<dynamic>? tempList = jsonDecode(SpUtil.getString(spLoginHistory, defValue: '[]'));
|
||||||
jsonDecode(SpUtil.getString(spLoginHistory, defValue: '[]'));
|
|
||||||
|
|
||||||
if (tempList != null && tempList.isNotEmpty) {
|
if (tempList != null && tempList.isNotEmpty) {
|
||||||
for (Map<String, dynamic> value in tempList) {
|
for (Map<String, dynamic> value in tempList) {
|
||||||
@ -41,8 +40,7 @@ class UserInfoViewModel {
|
|||||||
SpUtil.putString(spUserInfo, token);
|
SpUtil.putString(spUserInfo, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateUserName(
|
void updateUserName(String host, String userName, String password, bool secretLogin) {
|
||||||
String host, String userName, String password, bool secretLogin) {
|
|
||||||
updateHost(host);
|
updateHost(host);
|
||||||
_useSecretLogin(secretLogin);
|
_useSecretLogin(secretLogin);
|
||||||
_userName = userName;
|
_userName = userName;
|
||||||
@ -95,13 +93,11 @@ class UserInfoViewModel {
|
|||||||
|
|
||||||
historyAccounts.removeWhere((element) => element.host == _host);
|
historyAccounts.removeWhere((element) => element.host == _host);
|
||||||
|
|
||||||
historyAccounts.insert(
|
historyAccounts.insert(0, UserInfoBean(userName: _userName, password: _passWord, useSecretLogined: _useSecertLogined, host: _host));
|
||||||
0,
|
|
||||||
UserInfoBean(
|
while (historyAccounts.length > 5) {
|
||||||
userName: _userName,
|
historyAccounts.removeLast();
|
||||||
password: _passWord,
|
}
|
||||||
useSecretLogined: _useSecertLogined,
|
|
||||||
host: _host));
|
|
||||||
|
|
||||||
SpUtil.putString(spLoginHistory, jsonEncode(historyAccounts));
|
SpUtil.putString(spLoginHistory, jsonEncode(historyAccounts));
|
||||||
}
|
}
|
||||||
@ -121,8 +117,7 @@ class UserInfoBean {
|
|||||||
bool useSecretLogined = false;
|
bool useSecretLogined = false;
|
||||||
String? host;
|
String? host;
|
||||||
|
|
||||||
UserInfoBean(
|
UserInfoBean({this.userName, this.password, this.useSecretLogined = false, this.host});
|
||||||
{this.userName, this.password, this.useSecretLogined = false, this.host});
|
|
||||||
|
|
||||||
UserInfoBean.fromJson(Map<String, dynamic> json) {
|
UserInfoBean.fromJson(Map<String, dynamic> json) {
|
||||||
userName = json['userName'];
|
userName = json['userName'];
|
||||||
|
|||||||
Reference in New Issue
Block a user