mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 07:43:42 +08:00
fix
This commit is contained in:
parent
e465bc913d
commit
d63d07a1a9
@ -35,8 +35,10 @@ class AppConf {
|
|||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
/// init device info
|
/// init device info
|
||||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
try {
|
||||||
windowsDeviceInfo = await deviceInfo.windowsInfo;
|
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||||
|
windowsDeviceInfo = await deviceInfo.windowsInfo;
|
||||||
|
}catch (_){}
|
||||||
|
|
||||||
/// init Data
|
/// init Data
|
||||||
applicationSupportDir =
|
applicationSupportDir =
|
||||||
@ -85,7 +87,8 @@ class AppConf {
|
|||||||
try {
|
try {
|
||||||
networkVersionData = await Api.getAppVersion();
|
networkVersionData = await Api.getAppVersion();
|
||||||
dPrint(
|
dPrint(
|
||||||
"lastVersion=${networkVersionData?.lastVersion} ${networkVersionData?.lastVersionCode}");
|
"lastVersion=${networkVersionData?.lastVersion} ${networkVersionData
|
||||||
|
?.lastVersionCode}");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dPrint("_checkUpdate Error:$e");
|
dPrint("_checkUpdate Error:$e");
|
||||||
}
|
}
|
||||||
|
@ -133,8 +133,8 @@ class HomeUI extends BaseUI<HomeUIModel> {
|
|||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
name: "DPSCalculator 汉化",
|
name: "DPS计算器汉化",
|
||||||
webTitle: "DPSCalculatorLIVE 汉化",
|
webTitle: "DPS计算器汉化",
|
||||||
webURL: "https://www.erkul.games/live/calculator",
|
webURL: "https://www.erkul.games/live/calculator",
|
||||||
info: "在线改船,查询伤害数值和配件购买地点",
|
info: "在线改船,查询伤害数值和配件购买地点",
|
||||||
useLocalization: true,
|
useLocalization: true,
|
||||||
|
@ -32,7 +32,7 @@ class LoginDialog extends BaseUI<LoginDialogModel> {
|
|||||||
Text("请输入RSI账户 [${model.nickname}] 的邮箱,以保存登录状态(输入错误会导致无法进入游戏!)"),
|
Text("请输入RSI账户 [${model.nickname}] 的邮箱,以保存登录状态(输入错误会导致无法进入游戏!)"),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
TextFormBox(
|
TextFormBox(
|
||||||
controller: model.emailCtrl,
|
// controller: model.emailCtrl,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(
|
||||||
@ -79,24 +79,24 @@ class LoginDialog extends BaseUI<LoginDialogModel> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: const [
|
||||||
if (model.loginStatus == 1) ...[
|
// if (model.loginStatus == 1) ...[
|
||||||
Button(
|
// Button(
|
||||||
child: const Padding(
|
// child: const Padding(
|
||||||
padding: EdgeInsets.all(4),
|
// padding: EdgeInsets.all(4),
|
||||||
child: Text("取消"),
|
// child: Text("取消"),
|
||||||
),
|
// ),
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
}),
|
// }),
|
||||||
const SizedBox(width: 80),
|
// const SizedBox(width: 80),
|
||||||
FilledButton(
|
// FilledButton(
|
||||||
child: const Padding(
|
// child: const Padding(
|
||||||
padding: EdgeInsets.all(4),
|
// padding: EdgeInsets.all(4),
|
||||||
child: Text("保存"),
|
// child: Text("保存"),
|
||||||
),
|
// ),
|
||||||
onPressed: () => model.onSaveEmail()),
|
// onPressed: () => model.onSaveEmail()),
|
||||||
],
|
// ],
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class LoginDialogModel extends BaseUIModel {
|
|||||||
|
|
||||||
final HomeUIModel homeUIModel;
|
final HomeUIModel homeUIModel;
|
||||||
|
|
||||||
TextEditingController emailCtrl = TextEditingController();
|
// TextEditingController emailCtrl = TextEditingController();
|
||||||
|
|
||||||
LoginDialogModel(this.installPath, this.homeUIModel);
|
LoginDialogModel(this.installPath, this.homeUIModel);
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class LoginDialogModel extends BaseUIModel {
|
|||||||
Navigator.pop(context!);
|
Navigator.pop(context!);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final emailBox = await Hive.openBox("quick_login_email");
|
// final emailBox = await Hive.openBox("quick_login_email");
|
||||||
final data = message["data"];
|
final data = message["data"];
|
||||||
authToken = data["authToken"];
|
authToken = data["authToken"];
|
||||||
webToken = data["webToken"];
|
webToken = data["webToken"];
|
||||||
@ -53,13 +53,7 @@ class LoginDialogModel extends BaseUIModel {
|
|||||||
.replaceAll("\")", "");
|
.replaceAll("\")", "");
|
||||||
Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
||||||
nickname = payload["nickname"] ?? "";
|
nickname = payload["nickname"] ?? "";
|
||||||
if (emailBox.get(nickname, defaultValue: "") == "") {
|
_readyForLaunch();
|
||||||
loginStatus = 1;
|
|
||||||
notifyListeners();
|
|
||||||
} else {
|
|
||||||
emailCtrl.text = emailBox.get(nickname, defaultValue: "");
|
|
||||||
_readyForLaunch();
|
|
||||||
}
|
|
||||||
}, useLocalization: true);
|
}, useLocalization: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,23 +108,23 @@ class LoginDialogModel extends BaseUIModel {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
onSaveEmail() async {
|
// onSaveEmail() async {
|
||||||
final RegExp emailRegex = RegExp(r'^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$');
|
// final RegExp emailRegex = RegExp(r'^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$');
|
||||||
if (!emailRegex.hasMatch(emailCtrl.text.trim())) {
|
// if (!emailRegex.hasMatch(emailCtrl.text.trim())) {
|
||||||
showToast(context!, "邮箱输入有误!");
|
// showToast(context!, "邮箱输入有误!");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
final emailBox = await Hive.openBox("quick_login_email");
|
// final emailBox = await Hive.openBox("quick_login_email");
|
||||||
await emailBox.put(nickname, emailCtrl.text.trim());
|
// await emailBox.put(nickname, emailCtrl.text.trim());
|
||||||
_readyForLaunch();
|
// _readyForLaunch();
|
||||||
notifyListeners();
|
// notifyListeners();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<void> _readyForLaunch() async {
|
Future<void> _readyForLaunch() async {
|
||||||
loginStatus = 2;
|
loginStatus = 2;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
final launchData = {
|
final launchData = {
|
||||||
"username": emailCtrl.text.trim(),
|
"username": "",
|
||||||
"token": webToken,
|
"token": webToken,
|
||||||
"auth_token": authToken,
|
"auth_token": authToken,
|
||||||
"star_network": {
|
"star_network": {
|
||||||
|
Loading…
Reference in New Issue
Block a user