27 lines
609 B
JavaScript
27 lines
609 B
JavaScript
/**
|
|
* layer 弹窗提示
|
|
* @param {string} strContent
|
|
* @param int intTime
|
|
*/
|
|
export function layerPopup(strContent, intTime) {
|
|
layer.open({
|
|
shadeClose: false,
|
|
skin: 'msg',
|
|
content: strContent,
|
|
time: intTime
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 将ArrayBuffer转换为Base64字符串
|
|
* @param buffer buffer
|
|
* @returns {string}
|
|
*/
|
|
export function arrayBufferToBase64(buffer) {
|
|
let strBinary = '';
|
|
const bytes = new Uint8Array(buffer);
|
|
for (let i = 0; i < bytes.byteLength; i++) {
|
|
strBinary += String.fromCharCode(bytes[i]);
|
|
}
|
|
return window.btoa(strBinary);
|
|
} |