Method: WeChat::Bot::Client#login_loading

Defined in:
lib/wechat/bot/client.rb

#login_loadingObject

微信登录后初始化工作

掉线后 300 秒可以重新使用此 api 登录获取的联系人和群ID保持不变



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/wechat/bot/client.rb', line 197

def 
  url = api_url('webwxinit', r: timestamp)
  r = @session.post(url, json: params_base_request)
  data = r.parse(:json)

  store(
    sync_key: data["SyncKey"],
    invite_start_count: data["InviteStartCount"].to_i,
  )

  # 保存当前用户信息和最近聊天列表
  @bot.profile.parse(data["User"])
  @bot.contact_list.batch_sync(data["ContactList"])

  r
end