Angular 6-仅在关闭浏览器而不刷新时注销用户

时间:2019-03-22 09:43:35

标签: javascript angular

在关闭浏览器而不刷新时注销用户

postrotate /usr/lib/newlog/new > /dev/null 2>&1 || true BUCKET=logging-bucket INSTANCE_ID=`curl --silent http://169.254.169.254/latest/meta-data/instance-id | sed -e "s/i-//"` /usr/bin/s3cmd -m text/plain sync /var/log/messages-* s3://${BUCKET}/${INSTANCE_ID}/var/log/ endscript

@HostListener('window:beforeunload', [ '$event' ]) unloadHandler(event) { this.logout() }

我使用它,它可以工作,但用户也注销刷新浏览器

1 个答案:

答案 0 :(得分:0)

在您的app.component.ts

在构造函数()之前添加

project.Binaries = new[]
{
    new Binary(new Id("StartAdmin"), "xxx.exe")
};

project.Actions = new WixSharp.Action[]
{
    new BinaryFileAction("StartAdmin", "Executing ...", Return.check, When.After, Step.InstallExecute, Condition.NOT_Installed)
    {
        Execute = Execute.commit
    }