mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
WIP: Device components, services and stores updated.
This commit is contained in:
parent
2f96c787a2
commit
03181cf6a4
8 changed files with 137 additions and 62 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import CryptoJS from 'crypto-js'
|
||||
|
||||
export const appUrl = () => {
|
||||
return window.location.port !== 6970 ? `http://${window.location.hostname}:6970` : ''
|
||||
}
|
||||
|
|
@ -5,3 +7,13 @@ export const appUrl = () => {
|
|||
export const isLocal = () => {
|
||||
return window.location.hostname === '127.0.0.1' || window.location.hostname === 'localhost'
|
||||
}
|
||||
|
||||
export const encrypt = (data, key = false) => {
|
||||
const pk = !key ? localStorage.getItem('Macrame__pk') : key
|
||||
|
||||
if (pk) {
|
||||
return CryptoJS.RSA.encrypt(JSON.stringify(data), pk).toString()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue