MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    javaWeb如何实现短信登录?

    开发交流
    2
    2
    91
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 2
      2446694 last edited by 2446694

      前段时间使用了 2.15 实现了扫码登录

      (date: 2023-4-21)
      但扫码登录目前支持 ANDROID_WATCH 和 MACOS

      于是我想实现一 下短信登录:

      // MyLoginSolver.java
      @Override
          public Object onSolveDeviceVerification(@NotNull Bot bot, @NotNull DeviceVerificationRequests requests, @NotNull Continuation<? super DeviceVerificationResult> $completion) {
              DeviceVerificationRequests.SmsRequest sms = requests.getSms();
              if (requests.getPreferSms() && sms != null) {
                  sms.requestSms((Continuation<? super Unit>) $completion);
                  return verification(bot.getId(), String.format("请处理 %s %s 的短信验证码", sms.getCountryCode(), sms.getPhoneNumber()));
              } else {
                  DeviceVerificationRequests.FallbackRequest fallback = requests.getFallback();
                  assert fallback != null;
                  return verification(bot.getId(), fallback.getUrl());
              }
          }
      

      但我实现以后还是滑动验证码登录,而不是短信登录,我应该怎么做?

      1 Reply Last reply Reply Quote 0
      • cssxsh
        cssxsh last edited by

        mirai目前没有短信登录,也没有滑动验证码登录

        只有 密码登录 中出现了滑动验证码验证,和短信验证码验证,
        至于到底出现什么验证,那是不可控的, 由腾讯的服务器决定

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact