为啥运行在浏览器可以注册,在安卓模拟器注册返回null

来源:4-7 注册模块设计与实现

钓鱼的猫_fwEJMS

2025-02-20

写回答

3回答

CrazyCodeBoy

2025-02-24

从log上看问题应该出在login_dao方法的实现上,对照下这块课程源码检查下你的代码实现看下出入的地方:

https://git.imooc.com/coding-487/fa-component/src/master/lib/http/dao/login_dao.dart

static registration(
      String userName, String password, String imoocId, String orderId) {
    return _send(userName, password, imoocId: imoocId, orderId: orderId);
  }

  static _send(String userName, String password,
      {String? imoocId, String? orderId}) async {
    BaseRequest request;
    if (imoocId != null && orderId != null) {
      request = RegistrationRequest();
    } else {
      request = LoginRequest();
    }
    request
        .add("userName", userName)
        .add("password", password)
        .add("imoocId", imoocId ?? "")
        .add("orderId", orderId ?? "");
    var result = await HiNet.getInstance().fire(request);
    print(result);
    if (result['code'] == 0 && result['data'] != null) {
      //保存登录令牌
      HiCache.getInstance().setString(BOARDING_PASS, result['data']);
    }
    return result;
  }
0
0

钓鱼的猫_fwEJMS

提问者

2025-02-23

截图如下

https://img1.sycdn.imooc.com/szimg/c5e7f46709bb14bc19201017.jpg

0
0

CrazyCodeBoy

2025-02-21

log截图发一下,我帮你看看
0
1
钓鱼的猫_fwEJMS
ok,截图在评论里
2025-02-23
共1条回复

Flutter高级进阶实战-仿哔哩哔哩-掌握Flutter高阶技能

一次性掌握Flutter高阶技能+商业级复杂项目架构设计与开发方案

1824 学习 · 906 问题

查看课程