修复h5记事本不显示问题
This commit is contained in:
@@ -174,8 +174,9 @@ var loadScript = function (url, cb, timeout) {
|
||||
script.charset = "UTF-8";
|
||||
script.async = true;
|
||||
|
||||
// 对geetestçš„é™æ€èµ„æºæ·»åŠ crossOrigin
|
||||
if ( /static\.geetest\.com/g.test(url)) {
|
||||
// 对geetest的静态资源添加 crossOrigin。
|
||||
// file:// 本地页(App web-view)带 crossOrigin 会触发 CORS,必须跳过。
|
||||
if ( /static\.geetest\.com/g.test(url) && window.location.protocol !== 'file:') {
|
||||
script.crossOrigin = "anonymous";
|
||||
}
|
||||
|
||||
@@ -381,7 +382,13 @@ window.initGeetest4 = function (userConfig,callback) {
|
||||
if (userConfig.https) {
|
||||
config.protocol = 'https://';
|
||||
} else if (!userConfig.protocol) {
|
||||
config.protocol = window.location.protocol + '//';
|
||||
var locProtocol = window.location.protocol;
|
||||
// file:// / app:// 不能沿用当前协议,否则会请求 file://static.geetest.com
|
||||
if (locProtocol === 'http:' || locProtocol === 'https:') {
|
||||
config.protocol = locProtocol + '//';
|
||||
} else {
|
||||
config.protocol = 'https://';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user