Commit 7bfc9a688f125096bfa069920921ecd1117bdfc2

Authored by ww
1 parent bb4b81c8

fix: 修复边端生产环境token获取

... ... @@ -3,6 +3,7 @@ import { isProdMode } from '../env'
3 3 import { cacheCipher } from '@/settings/encryptionSetting'
4 4 import type { EncryptionParams } from '@/utils/cipher'
5 5 import { AesEncryption } from '@/utils/cipher'
  6 +import { isFromEdge } from '@/core/LoadData/module/useParseParams'
6 7
7 8 export interface CreateStorageParams extends EncryptionParams {
8 9 prefixKey: string
... ... @@ -16,7 +17,7 @@ export const createStorage = ({
16 17 key = cacheCipher.key,
17 18 iv = cacheCipher.iv,
18 19 timeout = null,
19   - hasEncrypt = isProdMode(),
  20 + hasEncrypt = !isFromEdge() && isProdMode(),
20 21 }: Partial<CreateStorageParams> = {}) => {
21 22 if (hasEncrypt && [key.length, iv.length].some(item => item !== 16))
22 23 throw new Error('When hasEncrypt is true, the key or iv must be 16 bits!')
... ...