南网env环境变量变更
This commit is contained in:
parent
eaecddaae6
commit
db95f3fa4b
|
|
@ -5,4 +5,7 @@ VUE_APP_TITLE = 施工装备管理系统
|
||||||
ENV = 'production'
|
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'
|
const secretKey = 'CCNWrpassWordKey'
|
||||||
|
|
||||||
async function encryptData(data, keyStr) {
|
async function encryptData(data, keyStr) {
|
||||||
const keyUint8 = new TextEncoder().encode(keyStr);
|
try {
|
||||||
const key = await crypto.subtle.importKey(
|
const keyUint8 = new TextEncoder().encode(keyStr);
|
||||||
|
const key = await crypto.subtle.importKey(
|
||||||
'raw',
|
'raw',
|
||||||
keyUint8,
|
keyUint8,
|
||||||
{ name: 'AES-CBC', length: 256 },
|
{ name: 'AES-CBC', length: 256 },
|
||||||
false,
|
false,
|
||||||
['encrypt']
|
['encrypt']
|
||||||
);
|
);
|
||||||
|
|
||||||
const iv = crypto.getRandomValues(new Uint8Array(16));
|
const iv = crypto.getRandomValues(new Uint8Array(16));
|
||||||
const cipherTextBuffer = await crypto.subtle.encrypt(
|
const cipherTextBuffer = await crypto.subtle.encrypt(
|
||||||
{ name: 'AES-CBC', iv },
|
{ name: 'AES-CBC', iv },
|
||||||
key,
|
key,
|
||||||
new TextEncoder().encode(data)
|
new TextEncoder().encode(data)
|
||||||
);
|
);
|
||||||
|
|
||||||
const combined = new Uint8Array(iv.length + cipherTextBuffer.byteLength);
|
const combined = new Uint8Array(iv.length + cipherTextBuffer.byteLength);
|
||||||
combined.set(iv, 0);
|
combined.set(iv, 0);
|
||||||
combined.set(new Uint8Array(cipherTextBuffer), iv.length);
|
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 = {
|
const user = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue