|
@@ -1,9 +1,8 @@
|
|
-
|
|
|
|
export const clearToken = () => {
|
|
export const clearToken = () => {
|
|
localStorage.setItem('JWT-TOKEN', '');
|
|
localStorage.setItem('JWT-TOKEN', '');
|
|
};
|
|
};
|
|
|
|
|
|
-export const storeToken = token => {
|
|
|
|
|
|
+export const storeToken = (token) => {
|
|
localStorage.setItem('JWT-TOKEN', token);
|
|
localStorage.setItem('JWT-TOKEN', token);
|
|
};
|
|
};
|
|
|
|
|
|
@@ -19,7 +18,6 @@ export const getToken = () => {
|
|
* <a href="url" download/>
|
|
* <a href="url" download/>
|
|
*/
|
|
*/
|
|
export const downloadFile = (url, fileName, encode = true) => {
|
|
export const downloadFile = (url, fileName, encode = true) => {
|
|
-
|
|
|
|
const downloadLink = document.createElement('a');
|
|
const downloadLink = document.createElement('a');
|
|
const body = document.documentElement || document.body;
|
|
const body = document.documentElement || document.body;
|
|
body.appendChild(downloadLink);
|
|
body.appendChild(downloadLink);
|
|
@@ -48,7 +46,9 @@ export function IsImageFile(fileName) {
|
|
}
|
|
}
|
|
|
|
|
|
export function IsVedio(fileName) {
|
|
export function IsVedio(fileName) {
|
|
- return fileName.lastIndexOf('.mp4') !== -1 || fileName.lastIndexOf('.avi') !== -1;
|
|
|
|
|
|
+ return (
|
|
|
|
+ fileName.lastIndexOf('.mp4') !== -1 || fileName.lastIndexOf('.avi') !== -1
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
|
|
export function GetTokenFromUrl() {
|
|
export function GetTokenFromUrl() {
|
|
@@ -95,7 +95,7 @@ export function getUser(params) {
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
return (arr = params
|
|
return (arr = params
|
|
- .map(item => {
|
|
|
|
|
|
+ .map((item) => {
|
|
return item.Operator?.CName;
|
|
return item.Operator?.CName;
|
|
})
|
|
})
|
|
.join(','));
|
|
.join(','));
|
|
@@ -123,7 +123,7 @@ export const UnityAction = {
|
|
emit(type, e) {
|
|
emit(type, e) {
|
|
if (!UnityAction.event[type]) return;
|
|
if (!UnityAction.event[type]) return;
|
|
console.log('emit====== type:', type, '====== event:', e);
|
|
console.log('emit====== type:', type, '====== event:', e);
|
|
- UnityAction.event[type].forEach(item => {
|
|
|
|
|
|
+ UnityAction.event[type].forEach((item) => {
|
|
item && item(e);
|
|
item && item(e);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -144,9 +144,13 @@ export const UnityAction = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
+// alert(window.vuplex);
|
|
if (window.vuplex) {
|
|
if (window.vuplex) {
|
|
- window.vuplex.addEventListener('message', e => {
|
|
|
|
- console.log('============================getMessageForUnity============================');
|
|
|
|
|
|
+ window.vuplex.addEventListener('message', (e) => {
|
|
|
|
+ // alert('99999999');
|
|
|
|
+ console.log(
|
|
|
|
+ '============================getMessageForUnity============================',
|
|
|
|
+ );
|
|
const data = JSON.parse(e.data);
|
|
const data = JSON.parse(e.data);
|
|
console.log(data);
|
|
console.log(data);
|
|
UnityAction.emit(data.type, data.message);
|
|
UnityAction.emit(data.type, data.message);
|