// 获得权限
Notification.requestPermission();
// 点击按钮
document.querySelector('#button').addEventListener('click', function () {
    new Notification("Hi,帅哥:", {
        body: '可以加你为好友吗?',
        icon: 'https://avatars6.githubusercontent.com/u/496048?v=4&s=460'
    });
});