mirror of
https://github.com/chaos-zhu/easynode.git
synced 2026-10-07 15:57:53 +08:00
feat: 移除非订阅内测
This commit is contained in:
@@ -3,7 +3,6 @@ import '../../core/api/api_result.dart';
|
||||
import '../../core/crypto/rsa_crypto.dart';
|
||||
import '../../core/utils/jwt_expiry.dart';
|
||||
import '../../core/utils/validators.dart';
|
||||
import '../settings/models/plus_info.dart';
|
||||
import 'auth_session.dart';
|
||||
|
||||
/// Result of [LoginController.login].
|
||||
@@ -124,26 +123,6 @@ class LoginController {
|
||||
token: data['token'] as String,
|
||||
deviceId: data['deviceId'] as String,
|
||||
);
|
||||
// Beta-only gate: only Plus subscribers may use the mobile app for now.
|
||||
// Fetch with a token-bearing client; failures are treated as "not Plus"
|
||||
// so we never leak a partial-auth session.
|
||||
final authedApi = _apiClientFactory(normalized, token: session.token);
|
||||
bool isPlus = false;
|
||||
try {
|
||||
final res = await authedApi.getJson('/plus-info');
|
||||
final raw = res['data'];
|
||||
if (raw is Map && raw.isNotEmpty) {
|
||||
isPlus = PlusInfo.fromJson(Map<String, dynamic>.from(raw)).isActive;
|
||||
}
|
||||
} on ApiFailure {
|
||||
isPlus = false;
|
||||
}
|
||||
if (!isPlus) {
|
||||
return const LoginResult(
|
||||
message: '内测版本仅 Plus 订阅可用',
|
||||
messageKey: 'login.errPlusRequired',
|
||||
);
|
||||
}
|
||||
// ignore: parameter_assignments
|
||||
_onLoginSuccess?.call(session, savePassword ? password : null);
|
||||
return LoginResult(success: true, session: session);
|
||||
|
||||
@@ -46,7 +46,6 @@ const Map<String, String> stringsEn = {
|
||||
'login.errSchemeUnsupported': 'Server address must use http or https',
|
||||
'login.errLoginGeneric': 'Login failed',
|
||||
'login.errMissingFields': 'Server login response is missing required fields',
|
||||
'login.errPlusRequired': 'Beta build is restricted to Plus subscribers',
|
||||
|
||||
// Login expiry options
|
||||
'login.expiry.temporary': 'Temporary, 1 hour',
|
||||
|
||||
@@ -44,7 +44,6 @@ const Map<String, String> stringsZh = {
|
||||
'login.errSchemeUnsupported': '服务端地址仅支持 http 或 https',
|
||||
'login.errLoginGeneric': '登录失败',
|
||||
'login.errMissingFields': '服务端登录响应缺少必要字段',
|
||||
'login.errPlusRequired': '内测版本仅 Plus 订阅可用',
|
||||
'login.expiry.temporary': '临时会话,1 小时',
|
||||
'login.expiry.currentDay': '今天',
|
||||
'login.expiry.threeDays': '3 天',
|
||||
|
||||
Reference in New Issue
Block a user