yii2-netdisk/web/js/vault_gateway_hook.js
Chenx221 66026929e6
一点点的改进
*增加了一些注释说明
2024-03-13 13:53:31 +08:00

15 lines
755 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

document.getElementById('gateway-vault-form').addEventListener('submit', function (event) {
event.preventDefault();
var password = document.getElementById('password').value;
sessionStorage.setItem('vaultRawKey', password);
this.submit();
});
document.addEventListener('DOMContentLoaded', function () {
if (!(window.crypto && window.crypto.subtle)) {
console.log('浏览器不支持 Crypto API');
//顺带一提简单测试了下那些不支持crypto api的浏览器可能前面登录那关都过不去验证码
alert('您的浏览器不支持加密功能,故无法使用文件保险箱功能,请使用现代浏览器。');
window.location.href = 'index.php?r=site%2Findex';
}
});