Browse Source

[feat]添加token获取

Destiny 7 months ago
parent
commit
b9ebe0a46d
4 changed files with 237 additions and 215 deletions
  1. 4 0
      ios/AiKeyboard/Info.plist
  2. 1 1
      ios/Podfile.lock
  3. 18 0
      lib/data/repository/account_repository.dart
  4. 214 214
      pubspec.lock

+ 4 - 0
ios/AiKeyboard/Info.plist

@@ -31,5 +31,9 @@
 		<key>NSExtensionPrincipalClass</key>
 		<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string>
 	</dict>
+	<key>UIAppFonts</key>
+	<array>
+		<string>淘宝买菜体.ttf</string>
+	</array>
 </dict>
 </plist>

+ 1 - 1
ios/Podfile.lock

@@ -218,4 +218,4 @@ SPEC CHECKSUMS:
 
 PODFILE CHECKSUM: 46e41cd7a608d3db06d8570d6fb41a774efc4103
 
-COCOAPODS: 1.16.2
+COCOAPODS: 1.15.2

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

@@ -255,6 +255,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
+ 214 - 214
pubspec.lock