This commit is contained in:
xkeyC 2023-11-06 23:17:56 +08:00
parent 403840ef12
commit f8ceb1713b
4 changed files with 23 additions and 7 deletions

View File

@ -311,9 +311,26 @@ function RSIAutoLogin(email, pwd) {
if (pwd !== "") {
$('#password').val(pwd)
}
sessionStorage.setItem('inputEmail', '');
sessionStorage.setItem('inputPassword', '');
if (email !== "" && pwd !== "") {
$('.c-form__submit-button-label').click();
}
});
}
function SCTShowToast(message, duration) {
let m = document.createElement('div');
m.innerHTML = message;
m.style.cssText = "font-family:siyuan;max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;";
document.body.appendChild(m);
setTimeout(function () {
let d = 0.5;
m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
m.style.opacity = '0';
setTimeout(function () {
document.body.removeChild(m)
}, d * 1000);
}, 3500);
}

View File

@ -6,7 +6,6 @@ import 'package:hive/hive.dart';
import 'package:path_provider/path_provider.dart';
import 'package:starcitizen_doctor/api/analytics.dart';
import 'package:starcitizen_doctor/api/api.dart';
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
import 'package:starcitizen_doctor/common/rust/ffi.dart';
import 'package:starcitizen_doctor/data/app_version_data.dart';
import 'package:starcitizen_doctor/global_ui_model.dart';
@ -16,7 +15,7 @@ import 'package:window_manager/window_manager.dart';
import '../base/ui.dart';
class AppConf {
static const String appVersion = "2.9.9 Beta";
static const String appVersion = "2.9.10 Beta";
static const int appVersionCode = 25;
static const String appVersionDate = "2023-11-03";

View File

@ -263,7 +263,10 @@ class WebViewModel {
final nonceStr = await userBox.get("nonce", defaultValue: "");
final macStr = await userBox.get("mac", defaultValue: "");
if (email == "") return;
webview.evaluateJavaScript("RSIAutoLogin(\"$email\",\"\")");
if (pwdE != "" && nonceStr != "" && macStr != "") {
// send toast
webview.evaluateJavaScript("SCTShowToast(\"请完成 Windows Hello 验证以填充密码\")");
// decrypt
if (await localAuth.authenticate(localizedReason: "请输入设备PIN以自动登录RSI账户") !=
true) return;
@ -277,8 +280,6 @@ class WebViewModel {
secretKey: SecretKey(base64.decode(kv.value)));
final decryptedPwd = utf8.decode(r);
webview.evaluateJavaScript("RSIAutoLogin(\"$email\",\"$decryptedPwd\")");
} else {
webview.evaluateJavaScript("RSIAutoLogin(\"$email\",\"\")");
}
}
}

View File

@ -125,9 +125,8 @@ msix_config:
publisher_display_name: xkeyC Studio
identity_name: 56575xkeyC.MSE
publisher: CN=B54C897B-C263-4680-B6AB-4913C603DF87
msix_version: 2.9.7.0
msix_version: 2.9.10.0
logo_path: ./assets/app_logo.png
capabilities: internetClient
languages: zh-cn
windows_build_args: --dart-define="MSE=true"
# store: true