window.open代理劫持

window.open = new Proxy(window.open, {
  apply(target, ctx, args) {
    if (hasAuth(args[0])) {
      return target(...args);
    }
    Message({
      message: "您暂无权限浏览此页面,请联系管理员",
      type: "warning",
      offset: 40
    });
    return;
  }
});
posted @ 2022-11-16 14:16  大禹不治水  阅读(73)  评论(0编辑  收藏  举报