mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-05 19:42:07 +08:00
backup code
This commit is contained in:
parent
ade081b70a
commit
e14d42d75c
@ -2,6 +2,7 @@ import HmacSHA256 from 'crypto-js/hmac-sha256'
|
||||
import SHA256 from 'crypto-js/sha256'
|
||||
import AES from 'crypto-js/aes'
|
||||
import MD5 from 'crypto-js/md5'
|
||||
import BASE64 from 'crypto-js/enc-base64'
|
||||
|
||||
/**
|
||||
*
|
||||
@ -89,3 +90,31 @@ export const useMD5 = (message: WordArray | string, cfg?: object) => {
|
||||
resolve(cry)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param wordArray 待转为 base64 信息
|
||||
*
|
||||
* base64 加密
|
||||
*/
|
||||
export const useBase64Stringify = (wordArray: WordArray) => {
|
||||
return new Promise((resolve) => {
|
||||
const cry = BASE64.stringify(wordArray)
|
||||
|
||||
resolve(cry)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param str 待转为 base64 信息
|
||||
*
|
||||
* base64 解密
|
||||
*/
|
||||
export const useBase64Parse = (str: string) => {
|
||||
return new Promise((resolve) => {
|
||||
const cry = BASE64.parse(str)
|
||||
|
||||
resolve(cry)
|
||||
})
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ export const useViteBuildPlugin = (options?: BuildOptions) => {
|
||||
const defaultPlugin: BuildOptions = {
|
||||
outDir: 'dist', // 打包后文件输出路径
|
||||
assetsDir: 'assets', // 指定静态资源存放路径
|
||||
assetsInlineLimit: 4096,
|
||||
assetsInlineLimit: 4096, // 小于这个数字(字节)的静态资产文件将被内联为(base64)
|
||||
cssCodeSplit: true, // 拆分css代码
|
||||
minify: 'esbuild', // 指定使用混淆器(terser|esbuild)
|
||||
sourcemap: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user