调整blog.config,新增ext,部分数值配置支持环境变量

This commit is contained in:
tangly1024.com
2024-03-20 17:11:40 +08:00
parent 4d3b30b495
commit 54a3b3746a
16 changed files with 238 additions and 206 deletions

View File

@@ -1,5 +1,5 @@
// 封装异步加载资源的方法
import { memo } from 'react'
import { memo } from 'react';
/**
* 判断是否客户端
@@ -7,6 +7,22 @@ import { memo } from 'react'
*/
export const isBrowser = typeof window !== 'undefined'
/**
* 打乱数组
* @param {*} array
* @returns
*/
export const shuffleArray = (array) => {
if (!array) {
return []
}
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
/**
* google机器人
* @returns