update 优化
This commit is contained in:
parent
0ce88aa40e
commit
bbebce27a6
Binary file not shown.
|
Before Width: | Height: | Size: 462 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 112 KiB |
@ -2,13 +2,13 @@
|
||||
* 生产环境
|
||||
*/
|
||||
;(function () {
|
||||
window.SITE_CONFIG = {};
|
||||
window.SITE_CONFIG = {}
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server'
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
|
||||
})();
|
||||
window.SITE_CONFIG['domain'] = './' // 域名
|
||||
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
|
||||
})()
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
* 测试环境
|
||||
*/
|
||||
;(function () {
|
||||
window.SITE_CONFIG = {};
|
||||
window.SITE_CONFIG = {}
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
|
||||
})();
|
||||
window.SITE_CONFIG['domain'] = './' // 域名
|
||||
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
|
||||
})()
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
* 验收环境
|
||||
*/
|
||||
;(function () {
|
||||
window.SITE_CONFIG = {};
|
||||
window.SITE_CONFIG = {}
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
|
||||
})();
|
||||
window.SITE_CONFIG['domain'] = './' // 域名
|
||||
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
|
||||
})()
|
||||
|
||||
@ -2,13 +2,14 @@
|
||||
* 开发环境
|
||||
*/
|
||||
;(function () {
|
||||
window.SITE_CONFIG = {};
|
||||
window.SITE_CONFIG = {}
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server'
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
|
||||
})();
|
||||
window.SITE_CONFIG['domain'] = './' // 域名
|
||||
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version
|
||||
})()
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
/**
|
||||
* 动态加载初始资源
|
||||
*/
|
||||
;(function() {
|
||||
;(function () {
|
||||
var resList = {
|
||||
icon: window.SITE_CONFIG.cdnUrl + '/static/img/favicon.ico',
|
||||
css: [
|
||||
window.SITE_CONFIG.cdnUrl + '/static/css/app.css',
|
||||
window.SITE_CONFIG.cdnUrl + '/static/css/app.css'
|
||||
],
|
||||
js: [
|
||||
// 插件, 放置业务之前加载, 以免业务需求依赖插件时, 还未加载出错
|
||||
@ -24,53 +24,53 @@
|
||||
|
||||
// 图标
|
||||
(function () {
|
||||
var _icon = document.createElement('link');
|
||||
_icon.setAttribute('rel', 'shortcut icon');
|
||||
_icon.setAttribute('type', 'image/x-icon');
|
||||
_icon.setAttribute('href', resList.icon);
|
||||
document.getElementsByTagName('head')[0].appendChild(_icon);
|
||||
var _icon = document.createElement('link')
|
||||
_icon.setAttribute('rel', 'shortcut icon')
|
||||
_icon.setAttribute('type', 'image/x-icon')
|
||||
_icon.setAttribute('href', resList.icon)
|
||||
document.getElementsByTagName('head')[0].appendChild(_icon)
|
||||
})();
|
||||
|
||||
// 样式
|
||||
(function () {
|
||||
document.getElementsByTagName('html')[0].style.opacity = 0;
|
||||
var i = 0;
|
||||
var _style = null;
|
||||
document.getElementsByTagName('html')[0].style.opacity = 0
|
||||
var i = 0
|
||||
var _style = null
|
||||
var createStyles = function () {
|
||||
if (i >= resList.css.length) {
|
||||
document.getElementsByTagName('html')[0].style.opacity = 1;
|
||||
return;
|
||||
document.getElementsByTagName('html')[0].style.opacity = 1
|
||||
return
|
||||
}
|
||||
_style = document.createElement('link');
|
||||
_style.href = resList.css[i];
|
||||
_style.setAttribute('rel', 'stylesheet');
|
||||
_style = document.createElement('link')
|
||||
_style.href = resList.css[i]
|
||||
_style.setAttribute('rel', 'stylesheet')
|
||||
_style.onload = function () {
|
||||
i++;
|
||||
createStyles();
|
||||
i++
|
||||
createStyles()
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(_style);
|
||||
document.getElementsByTagName('head')[0].appendChild(_style)
|
||||
}
|
||||
createStyles();
|
||||
})();
|
||||
createStyles()
|
||||
})()
|
||||
|
||||
// 脚本
|
||||
document.onreadystatechange = function () {
|
||||
if (document.readyState === 'interactive') {
|
||||
var i = 0;
|
||||
var _script = null;
|
||||
var i = 0
|
||||
var _script = null
|
||||
var createScripts = function () {
|
||||
if (i >= resList.js.length) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
_script = document.createElement('script');
|
||||
_script.src = resList.js[i];
|
||||
_script = document.createElement('script')
|
||||
_script.src = resList.js[i]
|
||||
_script.onload = function () {
|
||||
i++;
|
||||
createScripts();
|
||||
i++
|
||||
createScripts()
|
||||
}
|
||||
document.getElementsByTagName('body')[0].appendChild(_script);
|
||||
document.getElementsByTagName('body')[0].appendChild(_script)
|
||||
}
|
||||
createScripts();
|
||||
createScripts()
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
})()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user