html
if($("#password").val()) {
var encrypt = new JSEncrypt();
var key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCs6r5IY1ecQ2SFeAIEvwJfk47L9zit4HMJ+dpdyYybFYXmJjVMFbKDZ3Gwq4h/7wqfsmzCjBMChDsiBu9e4RH9+gTeaDfhfabyAbo2oOVuBm5s1hKcsCjEYYPX7mAX/SMarqeHqUgv46LBcOw09QBYSSb/ynh+xSHEKRXyfPi/zQIDAQAB';
encrypt.setPublicKey(key);
var passwd = encrypt.encrypt($("#password").val());
$("#password").val(passwd);
}
如上图,获取key的值,在test编辑以下语句
var pubKey = responseBody.match(new RegExp("key = '(.*?)'"))
console.log(pubKey[1])