Sfoglia il codice sorgente

[feat]添加token获取

Destiny 7 mesi fa
parent
commit
f7231d5bb3
1 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. 18 0
      lib/data/repository/account_repository.dart

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

@@ -273,6 +273,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