warrior 8 months ago
parent
commit
5ba7b5b6a2

+ 2 - 1
projects/textbook/src/app/app.component.ts

@@ -15,7 +15,8 @@ export class AppComponent {
     this.initParseService();
   }
   initParseService(){
-    Parse.initialize("edu-textbook");
+    Parse.initialize("edu-parse");
     (Parse as any).serverURL = ("http://localhost:61337/parse");
+    localStorage.setItem('company','Nc5qrhudIa')
   }
 }

+ 15 - 11
projects/textbook/src/modules/login/login/login.component.ts

@@ -9,6 +9,7 @@ import {
 } from '@angular/forms';
 import { CommonCompModule } from '../common.modules';
 import { textbookServer } from '../../../services/textbook';
+import { AuthServr } from '../../../services/auth.service';
 @Component({
   selector: 'app-login',
   standalone: true,
@@ -32,46 +33,49 @@ export class LoginComponent {
     {
       name: '国家级管理员',
       type: 1,
-      route:'/nav-admin/home'
+      route: '/nav-admin/home',
     },
     {
       name: '省级教育行政部门',
       type: 2,
-      route:'/nav-province-submit/home'
+      route: '/nav-province-submit/home',
     },
     {
       name: '流程管理员登录',
       type: 3,
-      route:'/nav-province-contact/home'
+      route: '/nav-province-contact/home',
     },
     {
       name: '省属高校联系人',
       type: 4,
-      route:'/nav-province-school-contact/home'
+      route: '/nav-province-school-contact/home',
     },
     {
       name: '教材评审组成员',
       type: 5,
-      route:'/nav-review/home'
+      route: '/nav-review/home',
     },
     {
       name: '作者/教师/主编',
       type: 6,
-      route:'/nav-author/home'
+      route: '/nav-author/home',
     },
   ];
-  currentProfile: any = this.selector[0]
+  currentProfile: any = this.selector[0];
   constructor(
     public tbookSer: textbookServer,
     private fb: NonNullableFormBuilder,
-    public router: Router
+    public router: Router,
+    private authServr: AuthServr
   ) {}
   submitForm(): void {
     if (this.validateForm.valid) {
       console.log('submit', this.currentProfile);
-      localStorage.setItem('profile', JSON.stringify(this.currentProfile))
-      this.tbookSer.profile = this.currentProfile
-      this.router.navigate([this.currentProfile.route]);
+      localStorage.setItem('profile', JSON.stringify(this.currentProfile));
+      this.tbookSer.profile = this.currentProfile;
+      this.authServr.login('admin', '12345', this.tbookSer.company).then(() => {
+        this.router.navigate([this.currentProfile.route]);
+      });
     } else {
       Object.values(this.validateForm.controls).forEach((control) => {
         if (control.invalid) {

+ 3 - 0
projects/textbook/src/modules/nav-author/page-home/page-home.component.scss

@@ -12,4 +12,7 @@
     padding: 20px 0 40px 0;
     flex: 1;
   }
+  .proview{
+    flex: 1;
+  }
 }