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 () {
|
;(function () {
|
||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {}
|
||||||
|
|
||||||
// api接口请求地址
|
// 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地址 = 域名 + 版本号
|
// cdn地址 = 域名 + 版本号
|
||||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
window.SITE_CONFIG['domain'] = './' // 域名
|
||||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||||
window.SITE_CONFIG['cdnUrl'] = 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 () {
|
;(function () {
|
||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {}
|
||||||
|
|
||||||
// api接口请求地址
|
// api接口请求地址
|
||||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
|
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'
|
||||||
|
|
||||||
// cdn地址 = 域名 + 版本号
|
// cdn地址 = 域名 + 版本号
|
||||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
window.SITE_CONFIG['domain'] = './' // 域名
|
||||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||||
window.SITE_CONFIG['cdnUrl'] = 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 () {
|
;(function () {
|
||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {}
|
||||||
|
|
||||||
// api接口请求地址
|
// api接口请求地址
|
||||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
|
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'
|
||||||
|
|
||||||
// cdn地址 = 域名 + 版本号
|
// cdn地址 = 域名 + 版本号
|
||||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
window.SITE_CONFIG['domain'] = './' // 域名
|
||||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||||
window.SITE_CONFIG['cdnUrl'] = 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 () {
|
;(function () {
|
||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {}
|
||||||
|
|
||||||
// api接口请求地址
|
// 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地址 = 域名 + 版本号
|
// cdn地址 = 域名 + 版本号
|
||||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
window.SITE_CONFIG['domain'] = './' // 域名
|
||||||
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
|
window.SITE_CONFIG['version'] = '' // 版本号(年月日时分)
|
||||||
window.SITE_CONFIG['cdnUrl'] = 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 = {
|
var resList = {
|
||||||
icon: window.SITE_CONFIG.cdnUrl + '/static/img/favicon.ico',
|
icon: window.SITE_CONFIG.cdnUrl + '/static/img/favicon.ico',
|
||||||
css: [
|
css: [
|
||||||
window.SITE_CONFIG.cdnUrl + '/static/css/app.css',
|
window.SITE_CONFIG.cdnUrl + '/static/css/app.css'
|
||||||
],
|
],
|
||||||
js: [
|
js: [
|
||||||
// 插件, 放置业务之前加载, 以免业务需求依赖插件时, 还未加载出错
|
// 插件, 放置业务之前加载, 以免业务需求依赖插件时, 还未加载出错
|
||||||
@ -24,53 +24,53 @@
|
|||||||
|
|
||||||
// 图标
|
// 图标
|
||||||
(function () {
|
(function () {
|
||||||
var _icon = document.createElement('link');
|
var _icon = document.createElement('link')
|
||||||
_icon.setAttribute('rel', 'shortcut icon');
|
_icon.setAttribute('rel', 'shortcut icon')
|
||||||
_icon.setAttribute('type', 'image/x-icon');
|
_icon.setAttribute('type', 'image/x-icon')
|
||||||
_icon.setAttribute('href', resList.icon);
|
_icon.setAttribute('href', resList.icon)
|
||||||
document.getElementsByTagName('head')[0].appendChild(_icon);
|
document.getElementsByTagName('head')[0].appendChild(_icon)
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// 样式
|
// 样式
|
||||||
(function () {
|
(function () {
|
||||||
document.getElementsByTagName('html')[0].style.opacity = 0;
|
document.getElementsByTagName('html')[0].style.opacity = 0
|
||||||
var i = 0;
|
var i = 0
|
||||||
var _style = null;
|
var _style = null
|
||||||
var createStyles = function () {
|
var createStyles = function () {
|
||||||
if (i >= resList.css.length) {
|
if (i >= resList.css.length) {
|
||||||
document.getElementsByTagName('html')[0].style.opacity = 1;
|
document.getElementsByTagName('html')[0].style.opacity = 1
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
_style = document.createElement('link');
|
_style = document.createElement('link')
|
||||||
_style.href = resList.css[i];
|
_style.href = resList.css[i]
|
||||||
_style.setAttribute('rel', 'stylesheet');
|
_style.setAttribute('rel', 'stylesheet')
|
||||||
_style.onload = function () {
|
_style.onload = function () {
|
||||||
i++;
|
i++
|
||||||
createStyles();
|
createStyles()
|
||||||
}
|
}
|
||||||
document.getElementsByTagName('head')[0].appendChild(_style);
|
document.getElementsByTagName('head')[0].appendChild(_style)
|
||||||
}
|
}
|
||||||
createStyles();
|
createStyles()
|
||||||
})();
|
})()
|
||||||
|
|
||||||
// 脚本
|
// 脚本
|
||||||
document.onreadystatechange = function () {
|
document.onreadystatechange = function () {
|
||||||
if (document.readyState === 'interactive') {
|
if (document.readyState === 'interactive') {
|
||||||
var i = 0;
|
var i = 0
|
||||||
var _script = null;
|
var _script = null
|
||||||
var createScripts = function () {
|
var createScripts = function () {
|
||||||
if (i >= resList.js.length) {
|
if (i >= resList.js.length) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
_script = document.createElement('script');
|
_script = document.createElement('script')
|
||||||
_script.src = resList.js[i];
|
_script.src = resList.js[i]
|
||||||
_script.onload = function () {
|
_script.onload = function () {
|
||||||
i++;
|
i++
|
||||||
createScripts();
|
createScripts()
|
||||||
}
|
}
|
||||||
document.getElementsByTagName('body')[0].appendChild(_script);
|
document.getElementsByTagName('body')[0].appendChild(_script)
|
||||||
}
|
}
|
||||||
createScripts();
|
createScripts()
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
})();
|
})()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user