feat: 修改bug
Build Windows / build (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Has started running

This commit is contained in:
2025-11-20 06:19:05 -08:00
parent 89d13e6237
commit b442289b8a
6 changed files with 27 additions and 19 deletions
+1 -1
View File
@@ -1447,7 +1447,7 @@ class AppConfig {
kr_official_telegram = config.kr_official_telegram; kr_official_telegram = config.kr_official_telegram;
kr_official_telephone = config.kr_official_telephone; kr_official_telephone = config.kr_official_telephone;
kr_invitation_link = config.kr_invitation_link; kr_invitation_link = config.kr_invitation_link;
kr_website_id = config.kr_website_id; // kr_website_id = config.kr_website_id;
if (config.kr_domains.isNotEmpty) { if (config.kr_domains.isNotEmpty) {
KRDomain.kr_handleDomains(config.kr_domains); KRDomain.kr_handleDomains(config.kr_domains);
} }
@@ -429,7 +429,7 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'设备:${_extractDeviceModel(userAgent)}', '设备:${_extractDeviceModel(userAgent, deviceType)}',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.sp, // fontSize: 10.sp, //
@@ -589,7 +589,7 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
); );
} }
String _extractDeviceModel(String deviceName) { String _extractDeviceModel(String deviceName, String deviceType) {
// 匹配括号内内容 // 匹配括号内内容
final RegExp regExp = RegExp(r'\((.*?)\)'); final RegExp regExp = RegExp(r'\((.*?)\)');
final Match? match = regExp.firstMatch(deviceName); final Match? match = regExp.firstMatch(deviceName);
@@ -305,19 +305,24 @@ class KRLoginController extends GetxController
/// 发送验证码(仅支持邮箱) /// 发送验证码(仅支持邮箱)
void kr_sendCode() async { void kr_sendCode() async {
final either = await KRAuthApi().kr_sendCode( if (accountController.text.isEmpty) {
accountController.text, KRCommonUtil.kr_showToast(AppTranslations.kr_login.enterAccount);
2 return;
); // 重置密码验证码类型为3 }
/*
* int type;
* kr_loginStatus.value == KRLoginProgressStatus.kr_registerSendCode final check = await KRAuthApi().kr_isRegister(accountController.text);
? 2 // 注册验证码类型为2 final result = check.fold((l) {
: 3*/ KRCommonUtil.kr_showToast(l.msg);
return null;
}, (isRegistered) => isRegistered ? 2 : 1);
if (result == null) return;
type = result;
final either = await KRAuthApi().kr_sendCode(accountController.text, type);
either.fold((l) { either.fold((l) {
KRCommonUtil.kr_showToast(l.msg); KRCommonUtil.kr_showToast(l.msg);
}, (r) async { }, (r) async {
/// 开始倒计时
_startCountdown(); _startCountdown();
}); });
} }
@@ -76,10 +76,13 @@ class KRLoginView extends GetView<KRLoginController> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Obx(() { Obx(() {
final _ = KRAppRunData.getInstance().kr_isLogin.value; final account = KRAppRunData.getInstance().kr_account.value;
final email = KRAppRunData.getInstance().kr_account.value ?? ''; final isDeviceLogin = account != null && account.startsWith('9000');
if (isDeviceLogin) return const SizedBox();
return Text( return Text(
email.isNotEmpty ? email : '', account ?? '',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20.sp, fontSize: 20.sp,
+1 -1
View File
@@ -1,7 +1,7 @@
/// 接口名称 /// 接口名称
abstract class Api { abstract class Api {
/// 游客登录查看是否已经注册 /// 游客登录查看是否已经注册
static const String kr_isRegister = "/v1/app/auth/check"; static const String kr_isRegister = "/v1/auth/check";
/// 判断邮箱和当前设备是否已存在订阅 /// 判断邮箱和当前设备是否已存在订阅
static const String kr_checkSubscription = "/v1/public/user/subscribe_status"; static const String kr_checkSubscription = "/v1/public/user/subscribe_status";
@@ -36,7 +36,7 @@ class KRAuthApi {
BaseResponse<KRIsRegister> baseResponse = await HttpUtil.getInstance() BaseResponse<KRIsRegister> baseResponse = await HttpUtil.getInstance()
.request<KRIsRegister>(Api.kr_isRegister, data, .request<KRIsRegister>(Api.kr_isRegister, data,
method: HttpMethod.POST, isShowLoading: true); method: HttpMethod.GET, isShowLoading: true);
if (!baseResponse.isSuccess) { if (!baseResponse.isSuccess) {
return left( return left(