68 lines
2.2 KiB
JavaScript
68 lines
2.2 KiB
JavaScript
//测试路径
|
|
let host=window.location.host;
|
|
let IP_URL="http://"+host+"/ynRealName";
|
|
//let IP_URL="http://192.168.0.7:9101/ynRealName"
|
|
//本地ip
|
|
//let IP_URL="http://127.0.0.1:9101/ynRealName"
|
|
var ctxPath = IP_URL+"/bmw";
|
|
var currentHostname = window.location.hostname;
|
|
var currentHostname2 = window.location.host;
|
|
|
|
console.log(currentHostname+":"+currentHostname2)
|
|
|
|
// //测试
|
|
// var loginPath = "http://" + currentHostname + ":9200";
|
|
// var systemPath = "http://" + currentHostname + ":1910";
|
|
var filePath =IP_URL + "/file";
|
|
var fileUrl =IP_URL +"/file";
|
|
var oiPlanUrl = IP_URL + "/oiPlan";
|
|
|
|
//112.29.103.165:1616
|
|
//正式环境
|
|
// var loginPath = "http://" + currentHostname + ":1616/auth";
|
|
// var systemPath = "http://" + currentHostname + ":1616/system";
|
|
// var filePath = "http://" + currentHostname + ":1616/file";
|
|
// var fileUrl = "http://" + currentHostname + ":1616/file";
|
|
// var planUrl = "http://" + currentHostname + ":1616/ynPlan";
|
|
// var oiPlanUrl = "http://" + currentHostname + ":1616/oiPlan";
|
|
|
|
//文件预览
|
|
// let filePreviewUrl = "http://192.168.0.14:8012/onlinePreview?url=";
|
|
let filePreviewUrl = "http://" + currentHostname + ":8012/onlinePreview?url=";
|
|
|
|
function getContextPath() {
|
|
var pathName = document.location.pathname;
|
|
var index = pathName.substr(1).indexOf("/");
|
|
var result = pathName.substr(0, index + 1);
|
|
return result;
|
|
}
|
|
|
|
//判断字符串是否等于null,'null' ,'',undefined,'undefined',并且转成指定字符
|
|
function dataConversion(data1,data2) {
|
|
if(data1 == '' || data1 == null || data1 == 'null' || data1 == undefined || data1 == 'undefined'){
|
|
data1 = data2
|
|
}
|
|
return data1;
|
|
}
|
|
//字符串过长,展示'...'
|
|
function getSubString(string,dataMax,dataView) {
|
|
var name = '';
|
|
if(string.trim().length > dataMax){
|
|
name = string.substring(0,dataView) + '...';
|
|
}else {
|
|
name = string
|
|
}
|
|
return name
|
|
}
|
|
|
|
|
|
//弱口令校验
|
|
function isWeakPassword(password) {
|
|
let pattern = /^(?![0-9]+$)(?![0-9\W]+$)(?![0-9A-Z]+$)(?![0-9a-z]+$)(?![a-z\W]+$)(?![A-Z\W]+$)[0-9A-Za-z\W]{8,16}$/;
|
|
if(!pattern.test(password)) {
|
|
// parent.layer.msg('密码过于简单,请尽快修改密码', {icon: 2, time: 3000,area: ['350px', '70px']});
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
} |