wechat_auth_repository.dart 545 Bytes
import 'package:appframe/config/locator.dart';
import 'package:appframe/services/api_service.dart';
import 'package:dio/dio.dart';

class WechatAuthRepository {
  late final ApiService _apiService;

  WechatAuthRepository() {
    _apiService = getIt<ApiService>();
  }

  Future<dynamic> codeToSk(String code) async {
    Response resp = await _apiService.post('/login/applet/wkbxe/codeToSkByApp?version=1.0.0', {
      "appCode": "bxeapp",
      "params": {"code": code},
    });

    print('登录结果: $resp');

    return resp.data;
  }
}