mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
add sanitizer.bypassSecurityTrustUrl
This commit is contained in:
@@ -11,6 +11,7 @@ import { environment } from 'src/environments/environment';
|
|||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { ChatController } from './controller/chat';
|
import { ChatController } from './controller/chat';
|
||||||
import { register } from 'swiper/element/bundle';
|
import { register } from 'swiper/element/bundle';
|
||||||
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -39,13 +40,15 @@ export class AppComponent {
|
|||||||
private statusBar: StatusBar,
|
private statusBar: StatusBar,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private ChatSystemService: ChatSystemService
|
private ChatSystemService: ChatSystemService,
|
||||||
|
private sanitizer: DomSanitizer
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
window["sanitizer"] = this.sanitizer
|
||||||
this.initializeApp();
|
this.initializeApp();
|
||||||
this.storage.set('version', environment.version).then(() => {})
|
this.storage.set('version', environment.version).then(() => {})
|
||||||
ChatController.ChatSystemService = this.ChatSystemService
|
ChatController.ChatSystemService = this.ChatSystemService
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* requestPermission() {
|
/* requestPermission() {
|
||||||
@@ -70,7 +73,7 @@ export class AppComponent {
|
|||||||
initializeApp() {
|
initializeApp() {
|
||||||
this.platform.ready().then(() => {
|
this.platform.ready().then(() => {
|
||||||
this.statusBar.styleDefault();
|
this.statusBar.styleDefault();
|
||||||
|
|
||||||
if (this.platform.is("tablet")) {
|
if (this.platform.is("tablet")) {
|
||||||
window.screen.orientation.unlock();
|
window.screen.orientation.unlock();
|
||||||
} else if( this.platform.is("mobile")) {
|
} else if( this.platform.is("mobile")) {
|
||||||
|
|||||||
@@ -115,17 +115,19 @@ export class PublicationAttachmentEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fixFileBase64() {
|
fixFileBase64() {
|
||||||
//const sanitizer : DomSanitizer = window["sanitizer"]
|
const sanitizer : DomSanitizer = window["sanitizer"]
|
||||||
|
|
||||||
if(this.FileType == 'image' ) {
|
if(this.FileType == 'image' ) {
|
||||||
if(!this.Base64.startsWith('data:')) {
|
if(!this.Base64.startsWith('data:')) {
|
||||||
this.url = 'data:image/jpg;base64,' + this.Base64
|
this.url = 'data:image/jpg;base64,' + this.Base64
|
||||||
|
// this.url = sanitizer.bypassSecurityTrustUrl('data:image/jpg;base64,' + this.Base64) as any
|
||||||
} else {
|
} else {
|
||||||
this.url = this.Base64
|
this.url = this.Base64
|
||||||
}
|
}
|
||||||
} else if (this.FileType == 'video' ) {
|
} else if (this.FileType == 'video' ) {
|
||||||
if(!this.Base64.startsWith('data:') && !this.Base64.startsWith('http')) {
|
if(!this.Base64.startsWith('data:') && !this.Base64.startsWith('http')) {
|
||||||
this.url = 'data:video/mp4;base64,' + this.Base64
|
this.url = 'data:video/mp4;base64,' + this.Base64
|
||||||
|
// this.url = sanitizer.bypassSecurityTrustUrl('data:video/mp4;base64,' + this.Base64) as any
|
||||||
} else {
|
} else {
|
||||||
this.url = this.Base64
|
this.url = this.Base64
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user