如何解决登录后如何配置Firebase UI以返回上一页
# better to cast all relevant columns to string while setting up
df.country = df.country.astype(str)
df.remarks = df.remarks.astype(str)
# get passed filters
filter1 = [ # (field,filtertype,value,jointype)
('country','contains','U'),('remarks','startswith','123'),]
# create a collection of boolean masks
mask = []
for field,value in filter1:
if filtertype == 'contains':
mask.append(df[field].str.contains(value))
elif filtertype == 'startswith':
mask.append(df[field].str.startswith(value))
elif filtertype == 'endswith':
mask.append(df[field].str.startswith(value))
# all these filters need to be combined with `and`,as in `condition1 & condition2`
# if you need to allow for `or` then the whole thing gets a lot more complicated
# as you also need to expect parenthesis as in `(cond1 | cond2) & cond3`
# but it can be done with a parser
# allowing only `and` conditions
mask_combined = mask[0]
form m in mask[1:]:
mask_combined *= m
# apply filter
df_final = df[mask_combined]
我想配置预构建的Firebase UI,以便在登录过程完成后,返回到用户登录之前所在的页面。(我想使用它而不是signInSuccessUrl,因为如果用户登录以购买商品,我不希望他们重定向到其他页面。我尝试添加回调函数,该函数应允许我不使用SignInSuccessUrl,但无法正常工作。我的计划是使用使用window.history.back()进行回调;但也许这行不通吗?在Firebase登录过程中,浏览器似乎被重定向了几次,因此可能无法返回历史记录中的一页?有人知道有更好的方法吗?感谢您的帮助。
解决方法
您的登录成功URL设置为/
相反,请完全取消回叫并将成功URL设置为所需的URL。
如果它是动态URL,则可以使用window.location
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。