备案
This commit is contained in:
@ -19,210 +19,210 @@
|
|||||||
<body>
|
<body>
|
||||||
<script src="./axios.min.js"></script>
|
<script src="./axios.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
let Base64 = {
|
// let Base64 = {
|
||||||
encode(str) {
|
// encode(str) {
|
||||||
// first we use encodeURIComponent to get percent-encoded UTF-8,
|
// // first we use encodeURIComponent to get percent-encoded UTF-8,
|
||||||
// then we convert the percent encodings into raw bytes which
|
// // then we convert the percent encodings into raw bytes which
|
||||||
// can be fed into btoa.
|
// // can be fed into btoa.
|
||||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
|
// return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
|
||||||
function toSolidBytes(match, p1) {
|
// function toSolidBytes(match, p1) {
|
||||||
return String.fromCharCode('0x' + p1);
|
// return String.fromCharCode('0x' + p1);
|
||||||
}));
|
// }));
|
||||||
},
|
// },
|
||||||
decode(str) {
|
// decode(str) {
|
||||||
// Going backwards: from bytestream, to percent-encoding, to original string.
|
// // Going backwards: from bytestream, to percent-encoding, to original string.
|
||||||
return decodeURIComponent(atob(str).split('').map(function (c) {
|
// return decodeURIComponent(atob(str).split('').map(function (c) {
|
||||||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
// return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||||
}).join(''));
|
// }).join(''));
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
function getCookie(cname) {
|
// function getCookie(cname) {
|
||||||
var name = cname + "=";
|
// var name = cname + "=";
|
||||||
var ca = document.cookie.split(';');
|
// var ca = document.cookie.split(';');
|
||||||
for(var i=0; i<ca.length; i++)
|
// for(var i=0; i<ca.length; i++)
|
||||||
{
|
// {
|
||||||
var c = ca[i].trim();
|
// var c = ca[i].trim();
|
||||||
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
|
// if (c.indexOf(name)==0) return c.substring(name.length,c.length);
|
||||||
}
|
// }
|
||||||
return "";
|
// return "";
|
||||||
}
|
// }
|
||||||
Date.prototype.format = function(fmt) {
|
// Date.prototype.format = function(fmt) {
|
||||||
var o = {
|
// var o = {
|
||||||
"M+" : this.getMonth()+1, //月份
|
// "M+" : this.getMonth()+1, //月份
|
||||||
"d+" : this.getDate(), //日
|
// "d+" : this.getDate(), //日
|
||||||
"h+" : this.getHours(), //小时
|
// "h+" : this.getHours(), //小时
|
||||||
"m+" : this.getMinutes(), //分
|
// "m+" : this.getMinutes(), //分
|
||||||
"s+" : this.getSeconds(), //秒
|
// "s+" : this.getSeconds(), //秒
|
||||||
"q+" : Math.floor((this.getMonth()+3)/3), //季度
|
// "q+" : Math.floor((this.getMonth()+3)/3), //季度
|
||||||
"S" : this.getMilliseconds() //毫秒
|
// "S" : this.getMilliseconds() //毫秒
|
||||||
};
|
// };
|
||||||
if(/(y+)/.test(fmt)) {
|
// if(/(y+)/.test(fmt)) {
|
||||||
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
|
// fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
|
||||||
}
|
// }
|
||||||
for(var k in o) {
|
// for(var k in o) {
|
||||||
if(new RegExp("("+ k +")").test(fmt)){
|
// if(new RegExp("("+ k +")").test(fmt)){
|
||||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
|
// fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return fmt;
|
// return fmt;
|
||||||
}
|
// }
|
||||||
let TOKEN_KEY = 'kb-user-center-token'
|
// let TOKEN_KEY = 'kb-user-center-token'
|
||||||
function parse(query) {
|
// function parse(query) {
|
||||||
var qs = {};
|
// var qs = {};
|
||||||
var i = query.indexOf('?');
|
// var i = query.indexOf('?');
|
||||||
if (i < 0 && query.indexOf('=') < 0) {
|
// if (i < 0 && query.indexOf('=') < 0) {
|
||||||
return qs;
|
// return qs;
|
||||||
} else if (i >= 0) {
|
// } else if (i >= 0) {
|
||||||
query = query.substring(i + 1);
|
// query = query.substring(i + 1);
|
||||||
}
|
// }
|
||||||
var parts = query.split('&');
|
// var parts = query.split('&');
|
||||||
for (var n = 0; n < parts.length; n++) {
|
// for (var n = 0; n < parts.length; n++) {
|
||||||
var part = parts[n];
|
// var part = parts[n];
|
||||||
var key = part.split('=')[0];
|
// var key = part.split('=')[0];
|
||||||
var val = part.split('=')[1];
|
// var val = part.split('=')[1];
|
||||||
key = key.toLowerCase();
|
// key = key.toLowerCase();
|
||||||
if (typeof qs[key] === 'undefined') {
|
// if (typeof qs[key] === 'undefined') {
|
||||||
qs[key] = decodeURIComponent(val);
|
// qs[key] = decodeURIComponent(val);
|
||||||
} else if (typeof qs[key] === 'string') {
|
// } else if (typeof qs[key] === 'string') {
|
||||||
var arr = [qs[key], decodeURIComponent(val)];
|
// var arr = [qs[key], decodeURIComponent(val)];
|
||||||
qs[key] = arr;
|
// qs[key] = arr;
|
||||||
} else {
|
// } else {
|
||||||
qs[key].push(decodeURIComponent(val));
|
// qs[key].push(decodeURIComponent(val));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return qs;
|
// return qs;
|
||||||
}
|
// }
|
||||||
async function init() {
|
// async function init() {
|
||||||
(function (m, ei, q, i, a, j, s) {
|
// (function (m, ei, q, i, a, j, s) {
|
||||||
m[i] =
|
// m[i] =
|
||||||
m[i] ||
|
// m[i] ||
|
||||||
function () {
|
// function () {
|
||||||
(m[i].a = m[i].a || []).push(arguments);
|
// (m[i].a = m[i].a || []).push(arguments);
|
||||||
};
|
// };
|
||||||
(j = ei.createElement(q)), (s = ei.getElementsByTagName(q)[0]);
|
// (j = ei.createElement(q)), (s = ei.getElementsByTagName(q)[0]);
|
||||||
j.async = true;
|
// j.async = true;
|
||||||
j.charset = 'UTF-8';
|
// j.charset = 'UTF-8';
|
||||||
j.src = 'https://static.meiqia.com/widget/loader.js';
|
// j.src = 'https://static.meiqia.com/widget/loader.js';
|
||||||
s.parentNode.insertBefore(j, s);
|
// s.parentNode.insertBefore(j, s);
|
||||||
})(window, document, 'script', '_MEIQIA');
|
// })(window, document, 'script', '_MEIQIA');
|
||||||
var data = parse(window.location.search);
|
// var data = parse(window.location.search);
|
||||||
var entId = data.entid || data.eid;
|
// var entId = data.entid || data.eid;
|
||||||
if (Object.prototype.toString.call(entId) === '[object Array]') {
|
// if (Object.prototype.toString.call(entId) === '[object Array]') {
|
||||||
entId = +entId[0];
|
// entId = +entId[0];
|
||||||
} else {
|
// } else {
|
||||||
entId = +entId;
|
// entId = +entId;
|
||||||
}
|
// }
|
||||||
|
|
||||||
_MEIQIA('entId', '961dff7f89ddc015ac1f8e193bf774d0' || entId);
|
// _MEIQIA('entId', '961dff7f89ddc015ac1f8e193bf774d0' || entId);
|
||||||
_MEIQIA('standalone', function (config) {
|
// _MEIQIA('standalone', function (config) {
|
||||||
if (config.color) {
|
// if (config.color) {
|
||||||
document.body.style['background-color'] = '#' + config.color;
|
// document.body.style['background-color'] = '#' + config.color;
|
||||||
}
|
// }
|
||||||
if (config.url) {
|
// if (config.url) {
|
||||||
document.body.style['background-image'] = 'url(' + config.url + ')';
|
// document.body.style['background-image'] = 'url(' + config.url + ')';
|
||||||
document.body.style['background-repeat'] = 'no-repeat';
|
// document.body.style['background-repeat'] = 'no-repeat';
|
||||||
document.body.style['background-size'] = '100% 100%';
|
// document.body.style['background-size'] = '100% 100%';
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
_MEIQIA('withoutBtn');
|
// _MEIQIA('withoutBtn');
|
||||||
_MEIQIA('fallback', 1);
|
// _MEIQIA('fallback', 1);
|
||||||
|
|
||||||
if (!getCookie(TOKEN_KEY)) {
|
// if (!getCookie(TOKEN_KEY)) {
|
||||||
let target = '/support/?showLogin=true'
|
// let target = '/support/?showLogin=true'
|
||||||
if (data.kuboard) {
|
// if (data.kuboard) {
|
||||||
target = '/support/?kuboard=' + data.kuboard
|
// target = '/support/?kuboard=' + data.kuboard
|
||||||
} else {
|
// } else {
|
||||||
window.alert('请先登录')
|
// window.alert('请先登录')
|
||||||
}
|
// }
|
||||||
window.location.href = target
|
// window.location.href = target
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Kuboard Logic
|
// // Kuboard Logic
|
||||||
let ax = axios.create({
|
// let ax = axios.create({
|
||||||
baseURL: '/uc-api',
|
// baseURL: '/uc-api',
|
||||||
})
|
// })
|
||||||
let orders = []
|
// let orders = []
|
||||||
let user = undefined
|
// let user = undefined
|
||||||
await ax.get(`/orders/list`, {params: {
|
// await ax.get(`/orders/list`, {params: {
|
||||||
status: 'PAID',
|
// status: 'PAID',
|
||||||
pageNum: 1,
|
// pageNum: 1,
|
||||||
pageSize: 1000
|
// pageSize: 1000
|
||||||
}}).then(resp => {
|
// }}).then(resp => {
|
||||||
orders = resp.data.items
|
// orders = resp.data.items
|
||||||
}).catch(e => {
|
// }).catch(e => {
|
||||||
console.log(e)
|
// console.log(e)
|
||||||
})
|
// })
|
||||||
await ax.get('/users/selfInfo').then(resp => {
|
// await ax.get('/users/selfInfo').then(resp => {
|
||||||
user = resp.data.data
|
// user = resp.data.data
|
||||||
}).catch(e => {
|
// }).catch(e => {
|
||||||
console.log(e)
|
// console.log(e)
|
||||||
})
|
// })
|
||||||
|
|
||||||
data.clientid = user.id
|
// data.clientid = user.id
|
||||||
|
|
||||||
let totalAmount = 0
|
// let totalAmount = 0
|
||||||
for (let order of orders) {
|
// for (let order of orders) {
|
||||||
totalAmount += order.totalPrice
|
// totalAmount += order.totalPrice
|
||||||
}
|
// }
|
||||||
totalAmount = Math.round(totalAmount)
|
// totalAmount = Math.round(totalAmount)
|
||||||
|
|
||||||
data.metadata = {
|
// data.metadata = {
|
||||||
name: user.name, // 美洽默认字段
|
// name: user.name, // 美洽默认字段
|
||||||
email: user.email,
|
// email: user.email,
|
||||||
tel: user.mobile,
|
// tel: user.mobile,
|
||||||
Count: orders.length,
|
// Count: orders.length,
|
||||||
Amount: totalAmount,
|
// Amount: totalAmount,
|
||||||
uc_id: user.id,
|
// uc_id: user.id,
|
||||||
}
|
// }
|
||||||
if (data.kuboard) {
|
// if (data.kuboard) {
|
||||||
data.kuboard = Base64.decode(data.kuboard)
|
// data.kuboard = Base64.decode(data.kuboard)
|
||||||
data.kuboard = JSON.parse(data.kuboard)
|
// data.kuboard = JSON.parse(data.kuboard)
|
||||||
data.metadata = Object.assign(data.metadata, data.kuboard)
|
// data.metadata = Object.assign(data.metadata, data.kuboard)
|
||||||
if (data.kuboard.K_title.indexOf('Kuboard') != 0) {
|
// if (data.kuboard.K_title.indexOf('Kuboard') != 0) {
|
||||||
data.greeting = `Hi,Kuboard,我是 ${data.kuboard.K_title} 的 ${user.name},有问题想要找你帮忙看看。`
|
// data.greeting = `Hi,Kuboard,我是 ${data.kuboard.K_title} 的 ${user.name},有问题想要找你帮忙看看。`
|
||||||
} else {
|
// } else {
|
||||||
data.greeting = `Hi,Kuboard,我是 ${user.name},有问题想要找你帮忙看看。`
|
// data.greeting = `Hi,Kuboard,我是 ${user.name},有问题想要找你帮忙看看。`
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (let i in orders) {
|
// for (let i in orders) {
|
||||||
let order = orders[i]
|
// let order = orders[i]
|
||||||
let prefix = 'r' + (parseInt(i) + 1)
|
// let prefix = 'r' + (parseInt(i) + 1)
|
||||||
if (i >= 5) {
|
// if (i >= 5) {
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
data.metadata[prefix + '_id'] = order.id //`${order.id} -- ${order.description} -- ${format(order.createTime, 'YYYY-MM-DD HH:mm')}`
|
// data.metadata[prefix + '_id'] = order.id //`${order.id} -- ${order.description} -- ${format(order.createTime, 'YYYY-MM-DD HH:mm')}`
|
||||||
data.metadata[prefix + '_desc'] = order.description
|
// data.metadata[prefix + '_desc'] = order.description
|
||||||
data.metadata[prefix + '_time'] = new Date(order.createTime).format("yyyy-MM-dd hh:mm") //format(order.createTime, 'YYYY-MM-DD HH:mm')
|
// data.metadata[prefix + '_time'] = new Date(order.createTime).format("yyyy-MM-dd hh:mm") //format(order.createTime, 'YYYY-MM-DD HH:mm')
|
||||||
}
|
// }
|
||||||
// Kuboard Logic end
|
// // Kuboard Logic end
|
||||||
|
|
||||||
|
|
||||||
if (data.metadata) {
|
// if (data.metadata) {
|
||||||
try {
|
// try {
|
||||||
_MEIQIA('metadata', data.metadata);
|
// _MEIQIA('metadata', data.metadata);
|
||||||
} catch (e) { }
|
// } catch (e) { }
|
||||||
}
|
// }
|
||||||
if (data.language) {
|
// if (data.language) {
|
||||||
_MEIQIA('language', data.language);
|
// _MEIQIA('language', data.language);
|
||||||
}
|
// }
|
||||||
if (data.fallback) {
|
// if (data.fallback) {
|
||||||
_MEIQIA('fallback', +data.fallback);
|
// _MEIQIA('fallback', +data.fallback);
|
||||||
}
|
// }
|
||||||
if (data.clientid) {
|
// if (data.clientid) {
|
||||||
_MEIQIA('clientId', data.clientid);
|
// _MEIQIA('clientId', data.clientid);
|
||||||
}
|
// }
|
||||||
if (data.agentid || data.groupid) {
|
// if (data.agentid || data.groupid) {
|
||||||
_MEIQIA('assign', { agentToken: data.agentid || null, groupToken: data.groupid || null });
|
// _MEIQIA('assign', { agentToken: data.agentid || null, groupToken: data.groupid || null });
|
||||||
}
|
// }
|
||||||
_MEIQIA('showPanel', {
|
// _MEIQIA('showPanel', {
|
||||||
greeting: data.greeting || '',
|
// greeting: data.greeting || '',
|
||||||
agentToken: data.agentid || null,
|
// agentToken: data.agentid || null,
|
||||||
groupToken: data.groupid || null
|
// groupToken: data.groupid || null
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
init();
|
// init();
|
||||||
</script>
|
</script>
|
||||||
</body >
|
</body >
|
||||||
</html >
|
</html >
|
||||||
@ -61,6 +61,16 @@ https://kubernetes.io/docs/tasks/inject-data-application/_print/#capabilities-of
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## v3.1.4.0-beta.2
|
||||||
|
|
||||||
|
**优化**
|
||||||
|
|
||||||
|
* 为审计数据库增加索引;【待处理】
|
||||||
|
|
||||||
|
**问题修正**
|
||||||
|
|
||||||
|
* 解决部分情况下,审计日志详情信息显示错误的问题;
|
||||||
|
|
||||||
## v3.1.4.0-beta.1
|
## v3.1.4.0-beta.1
|
||||||
|
|
||||||
**发布日期**
|
**发布日期**
|
||||||
|
|||||||
Reference in New Issue
Block a user