从应用程序注销后,我必须显示烤面包机。这是我正在尝试的。在这里,我使用注销方法后会打电话给烤面包机。
_this.logout().then({
success: function (result, request) {
Ext.toast({
html: 'Logged Out',
width: 270,
cls: 'smart-window alert-box',
bodyStyle: 'background:#90EE90;',
});
},
failure: function (result, request) {
console.log('failure!');
},
});
我有另一种方法,我在注销前打电话给烤面包机,但注销后却变得不完整。注销后如何在烤面包机页面上重新显示烤面包机。
这是我要重定向的logout
。
logout: function (options) {
let deferred = Ext.create("Deft.promise.Deferred");
Ext.Ajax.request({
url: '/logout',
method: 'GET',
success: function (result, request) {
var url = '/myUrl/logout';
var method = 'GET';
Ext.Ajax.request({
url: url,
method: method,
success: function (result, request) {
let extraParam = "someconfig";
let external_logout = "/someurl";
window.location.href = `${external_logout}${extraParam}`, 'width=1000 height=1000, scrollbars=yes, resizable=yes';
deferred.resolve(logout);
},
failure: function (result, request) {
deferred.reject();
}
});
},
failure: function (result, request) {
Ext.MessageBox.alert('Failed', 'Request failed');
deferred.reject();
}
});
return deferred.promise;
},
答案 0 :(得分:3)
from selenium import webdriver as wd
driver = wd.Chrome()
driver.get("https://accounts.google.com/signin/v2/identifier?service=wise&passive=true&continue=http%3A%2F%2Fdrive.google.com%2F%3Futm_source%3Den&utm_medium=button&utm_campaign=web&utm_content=gotodrive&usp=gtd<mpl=drive&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
#logging in to google drive
driver.maximize_window()
driver.implicitly_wait(10)
driver.find_element_by_name("identifier").send_keys("********@gmail.com")
driver.find_element_by_xpath("//*[@id='identifierNext']/div/button/div[2]").click()
driver.implicitly_wait(10)
driver.find_element_by_name("password").send_keys("*******")
driver.find_element_by_xpath("//*[@id='passwordNext']/div/button/div[2]").click()
driver.implicitly_wait(10)
driver.find_element_by_xpath("//*[@id='drive_main_page']/div[2]/div[1]/div[1]/div/div/div[2]/div[1]/div/button[1]/div[2]").click()
应该只得到回调。
then
答案 1 :(得分:1)
也许您可以使用localStorage。重定向前,请设置isLoggedOut = true。
然后在新页面中进行检查:
{{method_field('check_your_route_type')}}