ENH: Ignore AgreeTerm WebPage When User LogOut

JIRA: none
Change-Id: Ib8566df069192036b28aafa055a7f67a47f38d65
(cherry picked from commit e7613a7b157f1fa0554f3ec8ea4c8a68475e9b10)
This commit is contained in:
zorro.zhang 2024-06-25 17:41:54 +08:00 committed by Lane.Wei
parent aadd29a9ae
commit 5e8f430bf6
1 changed files with 23 additions and 1 deletions

View File

@ -814,7 +814,29 @@ void WebViewPanel::SetMakerworldPageLoginStatus(bool login ,wxString ticket)
mw_currenturl.Replace("modelid=", "");
}
//mw_currenturl.Replace("modelid=", "");
//If AgreeTerms, Redirect Other Url
std::regex pattern("^https://.*/(.*/){0,1}agree-terms.*");
if (std::regex_match(mw_currenturl.ToStdString(), pattern)) {
std::regex ParamPattern("agreeBackUrl=([^&]+)");
std::smatch match;
std::string CurUrl = mw_currenturl.ToStdString();
if (std::regex_search(CurUrl, match, ParamPattern))
{
//std::cout << "Param Value: " << match[1] << std::endl;
mw_currenturl = wxGetApp().url_decode(std::string(match[1]));
} else {
//std::cout << "Not Find agreeBackUrl" << std::endl;
auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code());
wxString language_code = wxGetApp().current_language_code().BeforeFirst('_');
language_code = language_code.ToStdString();
mw_currenturl = (boost::format("%1%%2%/studio/webview?from=bambustudio") % host % language_code.mb_str()).str();
}
} else {
//std::cout << "The string does not match the pattern." << std::endl;
}
wxString mw_jumpurl = "";
bool b = GetJumpUrl(login, ticket, mw_currenturl, mw_jumpurl);