feat: 修改bug
This commit is contained in:
parent
89d13e6237
commit
b442289b8a
@ -1447,7 +1447,7 @@ class AppConfig {
|
||||
kr_official_telegram = config.kr_official_telegram;
|
||||
kr_official_telephone = config.kr_official_telephone;
|
||||
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) {
|
||||
KRDomain.kr_handleDomains(config.kr_domains);
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'设备:${_extractDeviceModel(userAgent)}',
|
||||
'设备:${_extractDeviceModel(userAgent, deviceType)}',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 10.sp, //
|
||||
@ -589,12 +589,12 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
|
||||
);
|
||||
}
|
||||
|
||||
String _extractDeviceModel(String deviceName) {
|
||||
String _extractDeviceModel(String deviceName, String deviceType) {
|
||||
// 匹配括号内内容
|
||||
final RegExp regExp = RegExp(r'\((.*?)\)');
|
||||
final Match? match = regExp.firstMatch(deviceName);
|
||||
|
||||
if (match != null && match.groupCount >= 1) {
|
||||
if (match != null && match.groupCount >= 1 ) {
|
||||
// 获取括号内内容
|
||||
final inside = match.group(1)!; // "Android; google Pixel 9; 15"
|
||||
|
||||
|
||||
@ -305,19 +305,24 @@ class KRLoginController extends GetxController
|
||||
|
||||
/// 发送验证码(仅支持邮箱)
|
||||
void kr_sendCode() async {
|
||||
final either = await KRAuthApi().kr_sendCode(
|
||||
accountController.text,
|
||||
2
|
||||
); // 重置密码验证码类型为3
|
||||
/*
|
||||
*
|
||||
* kr_loginStatus.value == KRLoginProgressStatus.kr_registerSendCode
|
||||
? 2 // 注册验证码类型为2
|
||||
: 3*/
|
||||
if (accountController.text.isEmpty) {
|
||||
KRCommonUtil.kr_showToast(AppTranslations.kr_login.enterAccount);
|
||||
return;
|
||||
}
|
||||
|
||||
int type;
|
||||
final check = await KRAuthApi().kr_isRegister(accountController.text);
|
||||
final result = check.fold((l) {
|
||||
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) {
|
||||
KRCommonUtil.kr_showToast(l.msg);
|
||||
}, (r) async {
|
||||
/// 开始倒计时
|
||||
_startCountdown();
|
||||
});
|
||||
}
|
||||
|
||||
@ -76,10 +76,13 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(() {
|
||||
final _ = KRAppRunData.getInstance().kr_isLogin.value;
|
||||
final email = KRAppRunData.getInstance().kr_account.value ?? '';
|
||||
final account = KRAppRunData.getInstance().kr_account.value;
|
||||
final isDeviceLogin = account != null && account.startsWith('9000');
|
||||
|
||||
if (isDeviceLogin) return const SizedBox();
|
||||
|
||||
return Text(
|
||||
email.isNotEmpty ? email : '',
|
||||
account ?? '',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/// 接口名称
|
||||
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";
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ class KRAuthApi {
|
||||
|
||||
BaseResponse<KRIsRegister> baseResponse = await HttpUtil.getInstance()
|
||||
.request<KRIsRegister>(Api.kr_isRegister, data,
|
||||
method: HttpMethod.POST, isShowLoading: true);
|
||||
method: HttpMethod.GET, isShowLoading: true);
|
||||
|
||||
if (!baseResponse.isSuccess) {
|
||||
return left(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user