Merge pull request #193 from MuenYu/contribution

修复由切换qq头像和gravatar头像导致的报错问题
This commit is contained in:
Mashiro 2020-03-13 04:58:16 -05:00 committed by GitHub
commit 3f1bf942f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 45 additions and 42 deletions

View File

@ -874,7 +874,9 @@ function getqqinfo() {
} }
var emailAddressFlag = cached.filter('#email').val(); var emailAddressFlag = cached.filter('#email').val();
cached.filter('#author').on('blur', function () { cached.filter('#author').on('blur', function () {
var qq = cached.filter('#author').val(); var qq = cached.filter('#author').val(),
$reg = /^[1-9]\d{4,9}$/;
if ($reg.test(qq)) {
$.ajax({ $.ajax({
type: 'get', type: 'get',
url: mashiro_option.qq_api_url + '?qq=' + qq + '&_wpnonce=' + Poi.nonce, url: mashiro_option.qq_api_url + '?qq=' + qq + '&_wpnonce=' + Poi.nonce,
@ -921,6 +923,7 @@ function getqqinfo() {
} }
} }
}); });
}
// $.ajax({ // $.ajax({
// type: 'get', // type: 'get',
// url: mashiro_option.qq_avatar_api_url + '?type=getqqavatar&qq=' + qq, // url: mashiro_option.qq_avatar_api_url + '?type=getqqavatar&qq=' + qq,