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);
|
||||
_host = SpUtil.getString(spHost, defValue: '');
|
||||
|
||||
List<dynamic>? tempList =
|
||||
jsonDecode(SpUtil.getString(spLoginHistory, defValue: '[]'));
|
||||
List<dynamic>? tempList = jsonDecode(SpUtil.getString(spLoginHistory, defValue: '[]'));
|
||||
|
||||
if (tempList != null && tempList.isNotEmpty) {
|
||||
for (Map<String, dynamic> value in tempList) {
|
||||
@ -41,8 +40,7 @@ class UserInfoViewModel {
|
||||
SpUtil.putString(spUserInfo, token);
|
||||
}
|
||||
|
||||
void updateUserName(
|
||||
String host, String userName, String password, bool secretLogin) {
|
||||
void updateUserName(String host, String userName, String password, bool secretLogin) {
|
||||
updateHost(host);
|
||||
_useSecretLogin(secretLogin);
|
||||
_userName = userName;
|
||||
@ -95,13 +93,11 @@ class UserInfoViewModel {
|
||||
|
||||
historyAccounts.removeWhere((element) => element.host == _host);
|
||||
|
||||
historyAccounts.insert(
|
||||
0,
|
||||
UserInfoBean(
|
||||
userName: _userName,
|
||||
password: _passWord,
|
||||
useSecretLogined: _useSecertLogined,
|
||||
host: _host));
|
||||
historyAccounts.insert(0, UserInfoBean(userName: _userName, password: _passWord, useSecretLogined: _useSecertLogined, host: _host));
|
||||
|
||||
while (historyAccounts.length > 5) {
|
||||
historyAccounts.removeLast();
|
||||
}
|
||||
|
||||
SpUtil.putString(spLoginHistory, jsonEncode(historyAccounts));
|
||||
}
|
||||
@ -121,8 +117,7 @@ class UserInfoBean {
|
||||
bool useSecretLogined = false;
|
||||
String? host;
|
||||
|
||||
UserInfoBean(
|
||||
{this.userName, this.password, this.useSecretLogined = false, this.host});
|
||||
UserInfoBean({this.userName, this.password, this.useSecretLogined = false, this.host});
|
||||
|
||||
UserInfoBean.fromJson(Map<String, dynamic> json) {
|
||||
userName = json['userName'];
|
||||
|
||||
Reference in New Issue
Block a user