mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-05 18:09:24 +08:00
feat: add 新增二维码登录地址
This commit is contained in:
parent
83d779c072
commit
bce8ec25af
@ -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;
|
||||
|
@ -8,6 +8,9 @@ namespace wxhelper{
|
||||
public:
|
||||
explicit AccountMgr(DWORD base);
|
||||
~AccountMgr();
|
||||
|
||||
std::string GetLoginUrl();
|
||||
|
||||
int GetSelfInfo(SelfInfoInner& out);
|
||||
|
||||
int CheckLogin();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user