Browse Source

[feat]添加token获取

Destiny 7 months ago
parent
commit
b3543cad63
2 changed files with 187 additions and 169 deletions
  1. 18 0
      lib/data/repository/account_repository.dart
  2. 169 169
      pubspec.lock

+ 18 - 0
lib/data/repository/account_repository.dart

@@ -291,6 +291,24 @@ class AccountRepository {
     }
   }
 
+  // 保存token到ios端
+  Future<void> saveAuthToken(String token) async {
+    // 通知iOS键盘扩展
+    if (Platform.isIOS) {
+      const MethodChannel channel = MethodChannel('keyboard_ios');
+      channel.invokeMethod('saveAuthToken', {'token': token});
+    }
+  }
+
+  // 保存token到ios端
+  Future<void> clearAuthToken() async {
+    // 通知iOS键盘扩展
+    if (Platform.isIOS) {
+      const MethodChannel channel = MethodChannel('keyboard_ios');
+      channel.invokeMethod('clearAuthToken');
+    }
+  }
+
   // 意见反馈
   Future<void> complaintSubmit(String? phone, String content) {
     return atmobApi

File diff suppressed because it is too large
+ 169 - 169
pubspec.lock