|
@@ -1,4 +1,5 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
|
import { CompUploadComponent } from '../comp-upload.component';
|
|
|
import { ProvierOssAli } from '../provider-oss-aliyun';
|
|
|
|
|
@@ -7,11 +8,11 @@ import { ProvierOssAli } from '../provider-oss-aliyun';
|
|
|
templateUrl: './example-upload.component.html',
|
|
|
styleUrls: ['./example-upload.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports:[CompUploadComponent]
|
|
|
+ imports:[CompUploadComponent,FormsModule,ReactiveFormsModule]
|
|
|
})
|
|
|
export class ExampleUploadComponent implements OnInit {
|
|
|
|
|
|
- ossProvider: { upload: any, signatureUrl: any, download:any } | undefined;
|
|
|
+ ossProvider: any|{ upload: any, signatureUrl: any, download:any } | undefined;
|
|
|
constructor() {
|
|
|
this.ossProvider = new ProvierOssAli();
|
|
|
}
|
|
@@ -21,7 +22,20 @@ export class ExampleUploadComponent implements OnInit {
|
|
|
upload(ev:any){
|
|
|
console.log(ev)
|
|
|
}
|
|
|
+
|
|
|
+ downloadUrl:string = "http://hep-textbook.oss-cn-beijing.aliyuncs.com/undefined/2024-10-8/1728352740465-test.pdf"
|
|
|
download(url:string,fileName?:string){
|
|
|
let tempUrl = this.ossProvider?.download(url,fileName);
|
|
|
}
|
|
|
+ publicUrl:string|undefined = "http://hep-textbook.oss-cn-beijing.aliyuncs.com/undefined/2024-10-8/1728352740465-test.pdf"
|
|
|
+ async public(){
|
|
|
+ console.log(await this.ossProvider?.setACLPublic(this.publicUrl))
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ privateUrl:string|undefined = "http://hep-textbook.oss-cn-beijing.aliyuncs.com/undefined/2024-10-8/1728352740465-test.pdf"
|
|
|
+ async private(){
|
|
|
+ console.log(await this.ossProvider?.setACLPrivate(this.privateUrl))
|
|
|
+
|
|
|
+ }
|
|
|
}
|