南网env环境变量变更
This commit is contained in:
parent
eaecddaae6
commit
db95f3fa4b
|
|
@ -5,4 +5,7 @@ VUE_APP_TITLE = 施工装备管理系统
|
|||
ENV = 'production'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/gl/dev-api' # 南网需加上/gl
|
||||
VUE_APP_BASE_API=dev-api
|
||||
|
||||
# 南网需加上/gl
|
||||
# VUE_APP_BASE_API = '/gl/dev-api'
|
||||
|
|
|
|||
|
|
@ -5,27 +5,31 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
|
|||
const secretKey = 'CCNWrpassWordKey'
|
||||
|
||||
async function encryptData(data, keyStr) {
|
||||
const keyUint8 = new TextEncoder().encode(keyStr);
|
||||
const key = await crypto.subtle.importKey(
|
||||
try {
|
||||
const keyUint8 = new TextEncoder().encode(keyStr);
|
||||
const key = await crypto.subtle.importKey(
|
||||
'raw',
|
||||
keyUint8,
|
||||
{ name: 'AES-CBC', length: 256 },
|
||||
false,
|
||||
['encrypt']
|
||||
);
|
||||
);
|
||||
|
||||
const iv = crypto.getRandomValues(new Uint8Array(16));
|
||||
const cipherTextBuffer = await crypto.subtle.encrypt(
|
||||
const iv = crypto.getRandomValues(new Uint8Array(16));
|
||||
const cipherTextBuffer = await crypto.subtle.encrypt(
|
||||
{ name: 'AES-CBC', iv },
|
||||
key,
|
||||
new TextEncoder().encode(data)
|
||||
);
|
||||
);
|
||||
|
||||
const combined = new Uint8Array(iv.length + cipherTextBuffer.byteLength);
|
||||
combined.set(iv, 0);
|
||||
combined.set(new Uint8Array(cipherTextBuffer), iv.length);
|
||||
const combined = new Uint8Array(iv.length + cipherTextBuffer.byteLength);
|
||||
combined.set(iv, 0);
|
||||
combined.set(new Uint8Array(cipherTextBuffer), iv.length);
|
||||
|
||||
return btoa(String.fromCharCode.apply(null, combined));
|
||||
return btoa(String.fromCharCode.apply(null, combined));
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ encryptData ~ error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
const user = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue