更新笔触和管理员页面

This commit is contained in:
X1627315083
2024-03-15 09:21:17 +08:00
parent bc314a2f83
commit b15d2e467f
29 changed files with 2792 additions and 1385 deletions

View File

@@ -1,5 +1,5 @@
import Fingerprint2 from 'fingerprintjs2';//获取浏览器唯一标识
const isEmail = (email) => {
const isEmail = (email) => {//判断邮箱格式
let reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/
let result = reg.test(email)
return result
@@ -11,7 +11,7 @@ const getUploadUrl = () => {
return url
}
function dataURLtoBlob(dataurl) {
function dataURLtoBlob(dataurl) {//吧data url转为blob对象
var arr = dataurl.split(',');
var mime = arr[0].match(/:(.*?);/)[1];
var bstr = atob(arr[1]);
@@ -23,7 +23,7 @@ function dataURLtoBlob(dataurl) {
return new Blob([u8arr], { type: mime });
}
function blobToFile(blob, fileName) {
function blobToFile(blob, fileName) {//给blob文件设置名字和日期
blob.lastModifiedDate = new Date();
blob.name = fileName;
return blob;
@@ -51,7 +51,7 @@ function downloadIamge(imgsrc, name) { // 下载图片地址和图片名
image.src = imgsrc
}
function dataURLtoFile(dataurl, filename) {
function dataURLtoFile(dataurl, filename) {//吧url转为文件对象指定文件名称
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
@@ -61,7 +61,7 @@ function dataURLtoFile(dataurl, filename) {
return blobToFile(blob, filename);
}
const base64toFile = (dataurl, filename = 'file') => {
const base64toFile = (dataurl, filename = 'file') => {//转换base64
let arr = dataurl.split(',')
let mime = arr[0].match(/:(.*?);/)[1]
let suffix = mime.split('/')[1]
@@ -77,7 +77,7 @@ const base64toFile = (dataurl, filename = 'file') => {
}
function rgbToHsv([R, G, B]) {
function rgbToHsv([R, G, B]) {//根据rgb获取hsv
R /= 255
G /= 255
B /= 255
@@ -108,7 +108,7 @@ function rgbToHsv([R, G, B]) {
return [H, S, V]
}
const formatTime = (timestamp, fmt) => {
const formatTime = (timestamp, fmt) => {//吧时间戳转为YYYY-MM-DD hh:mm:ss格式
// date = new Date(), fmt = 'MM/dd/yyyy';
let date = new Date();
date.setTime(timestamp * 1000);
@@ -146,7 +146,7 @@ const formatTime = (timestamp, fmt) => {
return fmt;
}
const isMoible = () => {
const isMoible = () => {//判断是否是移动端
let is_mobile = navigator.userAgent.toLowerCase().match(/(ipad|ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
// alert(navigator.userAgent.toLowerCase())
var isiPad = /iPad/.test(navigator.platform) || (navigator.maxTouchPoints && navigator.maxTouchPoints > 2);
@@ -184,7 +184,7 @@ function getBrowserInfo() {//获取是什么浏览器
return agent.match(regStr_saf);
}
}
async function murmur(){
async function murmur(){//生成唯一标识 ,暂时没有使用
return await new Promise((resolve,reject)=>{
Fingerprint2.get(function (components) {
const values = components.map(function (