diff --git a/src/app/pages/lockscreen/lockscreen.component.ts b/src/app/pages/lockscreen/lockscreen.component.ts index fff6625..81df77c 100644 --- a/src/app/pages/lockscreen/lockscreen.component.ts +++ b/src/app/pages/lockscreen/lockscreen.component.ts @@ -29,6 +29,8 @@ export class LockscreenComponent implements OnInit { onSubmit(e){ let params = { roleType: this.roleType } this.http.post('/api/Account/SignIn',e,{params}).subscribe((data:any)=>{ + sessionStorage.setItem('username',e.name) + sessionStorage.setItem('expires',data.expires) sessionStorage.setItem('realName',data.realName) sessionStorage.setItem('roleType',data.roleType) sessionStorage.setItem("token",data.token); diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 7aa98c1..60bb7b0 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -29,6 +29,8 @@ export class LoginComponent implements OnInit { onSubmit(e){ let params = { roleType: '0' } this.http.post('/api/Account/SignIn',e,{params}).subscribe((data:any)=>{ + sessionStorage.setItem('username',e.name) + sessionStorage.setItem('expires',data.expires) sessionStorage.setItem('realName',data.realName) sessionStorage.setItem('roleType',data.roleType) sessionStorage.setItem("token",data.token); diff --git a/src/app/ui/all-file/all-file.component.html b/src/app/ui/all-file/all-file.component.html index 5b01156..346fb37 100644 --- a/src/app/ui/all-file/all-file.component.html +++ b/src/app/ui/all-file/all-file.component.html @@ -29,7 +29,6 @@ delete 删除 -
上传中... @@ -141,13 +140,14 @@ 您还没上传过文件哦~
-
- account_balance 战术授课进入 -
-
- account_balance 战术学习进入 + +
+ account_balance 战术授课进入
+
+ account_balance 战术学习进入 +
diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 08a89cd..1283a2f 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -4,11 +4,11 @@ import {MatSort} from '@angular/material/sort'; import {MatTableDataSource} from '@angular/material/table'; import { HttpClient,HttpHeaders } from '@angular/common/http'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import { IsLoginService } from '../../is-login.service' +import { IsLoginService } from '../../is-login.service'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import {UploadFilesComponent} from '../upload-files/upload-files.component' -import { ComponentServiceService } from '../../component-service.service' - +import {UploadFilesComponent} from '../upload-files/upload-files.component'; +import { ComponentServiceService } from '../../component-service.service'; +import { DomSanitizer } from "@angular/platform-browser"; @Component({ selector: 'app-all-file', templateUrl: './all-file.component.html', @@ -18,7 +18,7 @@ export class AllFileComponent { displayedColumns: string[] = ['select', 'name', 'weight', 'time']; dataSource:any = new MatTableDataSource; - constructor(public emitService: ComponentServiceService,private http: HttpClient,public snackBar: MatSnackBar,public downloadFile:IsLoginService,public dialog: MatDialog,private zone: NgZone) { } + constructor(private sanitizer: DomSanitizer,public emitService: ComponentServiceService,private http: HttpClient,public snackBar: MatSnackBar,public downloadFile:IsLoginService,public dialog: MatDialog,private zone: NgZone) { } isCancel:boolean = false //搜索框的X是否显示 searchData:any = "搜索您的文件" //搜索框内容 isClickFile:boolean = false //是否点击过文件 @@ -28,7 +28,6 @@ export class AllFileComponent { isAdmin:boolean = false //是否是管理员 - selectedDataBank:string = '' //当前需要显示的资料库 fileNum:any = 0 //当前资料库文件数量 @@ -65,7 +64,11 @@ export class AllFileComponent { } } + + roleType:any + aHrefUnsafe:any //战术授课a标签 去除unsafe标志 ngOnInit(): void { + this.roleType = sessionStorage.getItem('roleType') this.dataSource.sort = this.sort; this.getALLFileList("支队级-主官") @@ -79,6 +82,18 @@ export class AllFileComponent { this.isAdmin = true } } + aHrefUnsafeLearnFun(){ + this.roleType = sessionStorage.getItem('roleType') + let username = sessionStorage.getItem('username') + let expires = sessionStorage.getItem('expires') + let realName = sessionStorage.getItem('realName') + let roleType = sessionStorage.getItem('roleType') + let token = sessionStorage.getItem('token') + let refreshToken = sessionStorage.getItem('refreshToken') + let aHref = `ax://startup?username=${username}&token=${token}&refreshToken=${refreshToken}&expires=${expires}&realname=${realName}&roleType=${roleType}` + this.aHrefUnsafe = this.sanitizer.bypassSecurityTrustUrl(aHref); + return this.aHrefUnsafe + } //获得当前资料库的文件列表 getALLFileList(name){ @@ -688,6 +703,7 @@ export class AllFileComponent { let arrList = [] //匹配到 禁止删除的 目录 this.selection.selected.forEach((element)=>{ let data = element.key.split("/"); + this.isTrueDelete.forEach(elements => { if (elements==data[data.length-2] && data.length-2==2 && !data[data.length-1]) { arrList.push('true') @@ -704,8 +720,6 @@ export class AllFileComponent { let result = await new Promise((result,reject)=>{ if(element.isDir){ //如果是文件夹 - // let lastIndex = element.key.lastIndexOf("/") - // let prefix = element.key.substring(0,lastIndex) let paramsdata:any = { prefix : element.key, recursive : true @@ -724,7 +738,6 @@ export class AllFileComponent { this.isDelete = false } result(data) - }) }else{ this.http.delete(`/api/Objects/drives/${element.key}`).subscribe(data=>{ diff --git a/src/app/ui/teacherManagement/enterpriseuser.component.ts b/src/app/ui/teacherManagement/enterpriseuser.component.ts index 2a49270..217938a 100644 --- a/src/app/ui/teacherManagement/enterpriseuser.component.ts +++ b/src/app/ui/teacherManagement/enterpriseuser.component.ts @@ -269,7 +269,7 @@ export class editTeacher { let body = { name : this.data.name, realName : e.realName, - roleType : 2, + roleType : 1, enabled : this.data.enabled, creationTime : date, posts : postsObj