Merge pull request #140 from 502647092/dev-3.9.2.23

feat: 0接口 新增二维码登录地址
This commit is contained in:
ttttupup 2023-05-25 22:12:52 +08:00 committed by GitHub
commit b37e448d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -181,6 +181,11 @@ int AccountMgr::GetSelfInfo(SelfInfoInner &out) {
return 1;
}
string AccountMgr::GetLoginUrl() {
DWORD login_url_addr = base_addr_ + WX_LOGIN_URL_OFFSET;
return "http://weixin.qq.com/x/" + std::string(reinterpret_cast<char*>(*(DWORD*)login_url_addr));
}
int AccountMgr::CheckLogin() {
int success = -1;
DWORD accout_service_addr = base_addr_ + WX_ACCOUNT_SERVICE_OFFSET;

View File

@ -8,6 +8,9 @@ namespace wxhelper{
public:
explicit AccountMgr(DWORD base);
~AccountMgr();
std::string GetLoginUrl();
int GetSelfInfo(SelfInfoInner& out);
int CheckLogin();

View File

@ -94,7 +94,7 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
case WECHAT_IS_LOGIN: {
int success = -1;
success = g_context.account_mgr->CheckLogin();
json ret_data = {{"result", "OK"}, {"code", success}};
json ret_data = {{"result", "OK"}, {"code", success}, {"login_url", g_context.account_mgr->GetLoginUrl()}};
ret = ret_data.dump();
break;
}

View File

@ -116,6 +116,7 @@
//login
#define WX_LOGIN_URL_OFFSET 0x3040DE8
#define WX_LOGOUT_OFFSET 0xe58870
#define WX_ACCOUNT_SERVICE_OFFSET 0x768c80
#define WX_GET_APP_DATA_SAVE_PATH_OFFSET 0xf3a610