浏览代码

[feat]添加token获取

Destiny 7 月之前
父节点
当前提交
5baea62e38
共有 2 个文件被更改,包括 187 次插入169 次删除
  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

文件差异内容过多而无法显示
+ 169 - 169
pubspec.lock