|
@@ -7,14 +7,12 @@ import {
|
|
|
NonNullableFormBuilder,
|
|
|
Validators,
|
|
|
} from '@angular/forms';
|
|
|
-import { CommonCompModule } from '../common.modules'
|
|
|
+import { CommonCompModule } from '../common.modules';
|
|
|
+import { textbookServer } from '../../../services/textbook';
|
|
|
@Component({
|
|
|
selector: 'app-login',
|
|
|
standalone: true,
|
|
|
- imports: [
|
|
|
- ReactiveFormsModule,
|
|
|
- CommonCompModule
|
|
|
- ],
|
|
|
+ imports: [ReactiveFormsModule, CommonCompModule],
|
|
|
templateUrl: './login.component.html',
|
|
|
styleUrl: './login.component.scss',
|
|
|
})
|
|
@@ -34,29 +32,46 @@ export class LoginComponent {
|
|
|
{
|
|
|
name: '国家级管理员',
|
|
|
type: 1,
|
|
|
+ route:'/nav-admin/home'
|
|
|
},
|
|
|
{
|
|
|
name: '省级教育行政部门',
|
|
|
type: 2,
|
|
|
+ route:'/nav-province-submit/home'
|
|
|
},
|
|
|
{
|
|
|
name: '流程管理员登录',
|
|
|
type: 3,
|
|
|
+ route:'/nav-province-contact/home'
|
|
|
},
|
|
|
{
|
|
|
- name: '作者/主编',
|
|
|
+ name: '省属高校联系人',
|
|
|
type: 4,
|
|
|
+ route:'/nav-province-school-contact/home'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '教材评审组成员',
|
|
|
+ type: 5,
|
|
|
+ route:'/nav-review/home'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '作者/教师/主编',
|
|
|
+ type: 6,
|
|
|
+ route:'/nav-author/home'
|
|
|
},
|
|
|
];
|
|
|
- current: any = {
|
|
|
- name: '国家级管理员',
|
|
|
- type: 1,
|
|
|
- };
|
|
|
- constructor(private fb: NonNullableFormBuilder, public router: Router) {}
|
|
|
+ currentProfile: any = this.selector[0]
|
|
|
+ constructor(
|
|
|
+ public tbookSer: textbookServer,
|
|
|
+ private fb: NonNullableFormBuilder,
|
|
|
+ public router: Router
|
|
|
+ ) {}
|
|
|
submitForm(): void {
|
|
|
if (this.validateForm.valid) {
|
|
|
- console.log('submit', this.validateForm.value);
|
|
|
- this.router.navigate(["/admin"])
|
|
|
+ console.log('submit', this.currentProfile);
|
|
|
+ localStorage.setItem('profile', JSON.stringify(this.currentProfile))
|
|
|
+ this.tbookSer.profile = this.currentProfile
|
|
|
+ this.router.navigate([this.currentProfile.route]);
|
|
|
} else {
|
|
|
Object.values(this.validateForm.controls).forEach((control) => {
|
|
|
if (control.invalid) {
|
|
@@ -68,12 +83,15 @@ export class LoginComponent {
|
|
|
}
|
|
|
|
|
|
onChange(e: string) {
|
|
|
- this.current = e;
|
|
|
+ this.currentProfile = e;
|
|
|
}
|
|
|
|
|
|
- goUrl(path:string){
|
|
|
- this.router.navigate([path,{
|
|
|
-
|
|
|
- }])
|
|
|
+ goUrl(path: string) {
|
|
|
+ this.router.navigate([
|
|
|
+ path,
|
|
|
+ {
|
|
|
+
|
|
|
+ },
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|