Forráskód Böngészése

update user/login

warrior 8 hónapja
szülő
commit
e982c18b2f

+ 21 - 0
projects/textbook/src/app/captcha/captcha.component.html

@@ -0,0 +1,21 @@
+<ng-container *ngIf="type == 'input'; else elseTemplate">
+  <div class="captcha">
+    <input
+      nz-input
+      class="code-input"
+      type="text"
+      [(ngModel)]="vCode"
+      maxlength="4"
+      placeholder="验证码"
+      [nzStatus]="vCode.length == 4 ? '' : 'error'"
+      (keydown)="enter($event)"
+      (change)="onChange()"
+    />
+    <div class="code-card" #canvasDom></div>
+  </div>
+</ng-container>
+<ng-template #elseTemplate>
+  <div class="captcha">
+    <div class="code-card" #canvasDom></div>
+  </div>
+</ng-template>

+ 25 - 0
projects/textbook/src/app/captcha/captcha.component.scss

@@ -0,0 +1,25 @@
+.code-card{
+  display: flex;
+  align-items: center;
+  .canvas{
+    border: 1px solid #c2def5;
+    border-radius: 5px;
+    width: 100px;
+    height: 38px;
+  }
+}
+.code-input {
+  width: 90px;
+  padding: 4px;
+  height: 38px;
+  border: 1px solid #cdcdcd;
+}
+.code-input:focus{
+  outline:1px solid #40a9ff;
+}
+  
+
+.captcha{
+  display: flex;
+  align-items: center;
+}

+ 28 - 0
projects/textbook/src/app/captcha/captcha.component.spec.ts

@@ -0,0 +1,28 @@
+/* tslint:disable:no-unused-variable */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { DebugElement } from '@angular/core';
+
+import { CaptchaComponent } from './captcha.component';
+
+describe('CaptchaComponent', () => {
+  let component: CaptchaComponent;
+  let fixture: ComponentFixture<CaptchaComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ CaptchaComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(CaptchaComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 140 - 0
projects/textbook/src/app/captcha/captcha.component.ts

@@ -0,0 +1,140 @@
+import {
+  Component,
+  OnInit,
+  Input,
+  Output,
+  EventEmitter,
+  ViewChild,
+  ElementRef,
+} from "@angular/core";
+import { CommonModule } from "@angular/common";
+import { FormsModule } from "@angular/forms";
+import { NzInputModule } from 'ng-zorro-antd/input';
+
+@Component({
+  imports:[CommonModule,FormsModule,NzInputModule],
+  standalone:true,
+  selector: 'fm-captcha',
+  templateUrl: './captcha.component.html',
+  styleUrls: ['./captcha.component.scss']
+})
+export class CaptchaComponent implements OnInit {
+    @ViewChild("canvasDom") canvasDom: ElementRef | any; //本地校验码绘画
+
+    @Input() type: string = 'input';  //default & input 默认input方式
+    @Input() canvas_id: string = 'canvasCode'; //元素id
+    @Input() drawCode: Array<string> = []; //验证码数组
+    @Input() vCode: string = ''; //用户输入code
+    @Output() changeVal: EventEmitter<any> = new EventEmitter(); //改变时触发
+    @Output() onEnter: EventEmitter<any> = new EventEmitter(); //enter按下触发
+    code:string = ''
+    constructor() {}
+  
+    ngOnInit() {}
+    ngAfterViewInit(): void {
+      //Called after ngAfterContentInit when the component's view has been initialized. Applies to components only.
+      //Add 'implements AfterViewInit' to the class.
+      this.updateDrawCode();
+    }
+    updateDrawCode() {
+      let canvas_width = 100;
+      let canvas_height = 38;
+      let canv = document.getElementById(this.canvas_id);
+      canv && this.canvasDom.nativeElement.removeChild(canv);
+      let _a = document.getElementById(this.canvas_id + '_a');
+      _a && this.canvasDom.nativeElement.removeChild(_a);
+      this.canvasDom.nativeElement;
+      let canvas = document.createElement("canvas");
+      canvas.className = "canvas";
+      canvas.setAttribute("id", this.canvas_id);
+      canvas.addEventListener("click", () => {
+        this.updateDrawCode();
+      });
+      let context:any = canvas.getContext("2d"); //获取到canvas画图的环境,演员表演的舞台
+      canvas.width = canvas_width;
+      canvas.height = canvas_height;
+      let sCode =
+        "A,B,C,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,W,X,Y,Z,1,2,3,4,5,6,7,8,9,0,q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m";
+      let aCode = sCode.split(",");
+      let aLength = aCode.length; //获取到数组的长度
+      for (let i = 0; i <= 3; i++) {
+        let j = Math.floor(Math.random() * aLength); //获取到随机的索引值
+        let deg = (Math.random() * 30 * Math.PI) / 180; //产生0~30之间的随机弧度
+        let txt = aCode[j]; //得到随机的一个内容
+        this.drawCode[i] = txt;
+        let x = 10 + i * 20; //文字在canvas上的x坐标
+        let y = 20 + Math.random() * 8; //文字在canvas上的y坐标
+        context.font = "bold 23px 微软雅黑";
+  
+        context.translate(x, y);
+        context.rotate(deg);
+  
+        context.fillStyle = this.randomColor();
+        context.fillText(txt, 0, 0);
+  
+        context.rotate(-deg);
+        context.translate(-x, -y);
+      }
+      for (let i = 0; i <= 5; i++) {
+        //验证码上显示线条
+        context.strokeStyle = this.randomColor();
+        context.beginPath();
+        context.moveTo(
+          Math.random() * canvas_width,
+          Math.random() * canvas_height
+        );
+        context.lineTo(
+          Math.random() * canvas_width,
+          Math.random() * canvas_height
+        );
+        context.stroke();
+      }
+      for (let i = 0; i <= 30; i++) {
+        //验证码上显示小点
+        context.strokeStyle = this.randomColor();
+        context.beginPath();
+        let x = Math.random() * canvas_width;
+        let y = Math.random() * canvas_height;
+        context.moveTo(x, y);
+        context.lineTo(x + 1, y + 1);
+        context.stroke();
+      }
+      this.code = this.drawCode.join("")
+      this.changeVal.emit({
+       code:this.code,
+       vCode:this.vCode
+      });
+      this.canvasDom.nativeElement.appendChild(canvas);
+      let a = document.createElement("a");
+      a.setAttribute("id", this.canvas_id + '_a');
+      a.innerText = "看不清,换一张";
+      a.addEventListener("click", () => {
+        this.updateDrawCode();
+      });
+      this.canvasDom.nativeElement.appendChild(a);
+    }
+    /* 得到随机的颜色值 */
+    randomColor() {
+      let r = Math.floor(Math.random() * 256);
+      let g = Math.floor(Math.random() * 256);
+      let b = Math.floor(Math.random() * 256);
+      return "rgb(" + r + "," + g + "," + b + ")";
+    }
+    //按下确认键触发
+    enter(e:any) {
+      if (e.keyCode == 13) {
+        this.changeVal.emit({
+          code:this.code,
+          vCode:this.vCode
+        });
+        this.onEnter.emit()
+      }
+    }
+    onChange(){
+      this.changeVal.emit({
+        code:this.code,
+        vCode:this.vCode
+      });
+    }
+  }
+  

+ 0 - 31
projects/textbook/src/app/comp-user/comp-user.component.html

@@ -1,36 +1,5 @@
 <div class="page">
   <div class="login-content">
-    <div class="title">
-      <div>
-        <svg
-          width="24"
-          height="27"
-          viewBox="0 0 18 20"
-          fill="none"
-          xmlns="http://www.w3.org/2000/svg"
-        >
-          <path
-            d="M18 2H4C3.46957 2 2.96086 2.21071 2.58579 2.58579C2.21071 2.96086 2 3.46957 2 4C2 4.53043 2.21071 5.03914 2.58579 5.41421C2.96086 5.78929 3.46957 6 4 6H18V19C18 19.2652 17.8946 19.5196 17.7071 19.7071C17.5196 19.8946 17.2652 20 17 20H4C2.93913 20 1.92172 19.5786 1.17157 18.8284C0.421427 18.0783 0 17.0609 0 16V4C0 2.93913 0.421427 1.92172 1.17157 1.17157C1.92172 0.421427 2.93913 0 4 0H17C17.2652 0 17.5196 0.105357 17.7071 0.292893C17.8946 0.48043 18 0.734783 18 1V2Z"
-            fill="url(#paint0_linear_5_11023)"
-          />
-          <defs>
-            <linearGradient
-              id="paint0_linear_5_11023"
-              x1="9"
-              y1="-2.21282e-07"
-              x2="25.5"
-              y2="40"
-              gradientUnits="userSpaceOnUse"
-            >
-              <stop stop-color="#E04860" />
-              <stop offset="1" stop-color="#E99306" />
-            </linearGradient>
-          </defs>
-        </svg>
-      </div>
-
-      登录教材遴选管理系统
-    </div>
     <router-outlet></router-outlet>
   </div>
 </div>

+ 1 - 2
projects/textbook/src/app/comp-user/comp-user.component.scss

@@ -21,8 +21,7 @@
   right: 100px;
   padding:10px 50px;
   text-align: center;
-  max-width: 500px;
-  min-width: 460px;
+  width:448px;
   min-height: 536px;
   margin: 0 auto;
   background: #fff;

+ 5 - 0
projects/textbook/src/index.html

@@ -9,6 +9,11 @@
   <link href="https://fonts.loli.net/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
   <link href="https://fonts.loli.net/icon?family=Material+Icons" rel="stylesheet">
 </head>
+<style>
+  *{
+    font-family: PingFang SC;
+  }
+</style>
 <body class="mat-typography">
   <app-root></app-root>
 </body>

+ 212 - 0
projects/textbook/src/modules/login/account-info/account-info.component.html

@@ -0,0 +1,212 @@
+<div class="region">
+  <div class="nav">
+    <div>
+      <svg
+        width="24"
+        height="27"
+        viewBox="0 0 18 20"
+        fill="none"
+        xmlns="http://www.w3.org/2000/svg"
+      >
+        <path
+          d="M18 2H4C3.46957 2 2.96086 2.21071 2.58579 2.58579C2.21071 2.96086 2 3.46957 2 4C2 4.53043 2.21071 5.03914 2.58579 5.41421C2.96086 5.78929 3.46957 6 4 6H18V19C18 19.2652 17.8946 19.5196 17.7071 19.7071C17.5196 19.8946 17.2652 20 17 20H4C2.93913 20 1.92172 19.5786 1.17157 18.8284C0.421427 18.0783 0 17.0609 0 16V4C0 2.93913 0.421427 1.92172 1.17157 1.17157C1.92172 0.421427 2.93913 0 4 0H17C17.2652 0 17.5196 0.105357 17.7071 0.292893C17.8946 0.48043 18 0.734783 18 1V2Z"
+          fill="url(#paint0_linear_5_11023)"
+        />
+        <defs>
+          <linearGradient
+            id="paint0_linear_5_11023"
+            x1="9"
+            y1="-2.21282e-07"
+            x2="25.5"
+            y2="40"
+            gradientUnits="userSpaceOnUse"
+          >
+            <stop stop-color="#E04860" />
+            <stop offset="1" stop-color="#E99306" />
+          </linearGradient>
+        </defs>
+      </svg>
+    </div>
+    完善账号信息
+    <div class="tips">
+      欢迎使用教材遴选系统 ,为了激活账号使用权限,请先完善您的资料信息。
+    </div>
+  </div>
+  <div class="form">
+    <form
+      nz-form
+      [formGroup]="validateForm"
+      class="account-form"
+      (ngSubmit)="submitForm()"
+    >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >姓名</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="name"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group>
+      </nz-form-item>
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >手机号</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="mobile"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      ><nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >电子邮箱</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="email"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      ><nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >公共电话</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="workPhone"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >省份</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="province"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >单位类型</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="unitType"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >单位名称</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="unit"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >所在部门</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="department"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >职务</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="job"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >身份证号</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="idcard"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >用户类型</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="identity"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+      <nz-form-item>
+        <nz-form-label class="label" [nzNoColon]="true" nzRequired
+          >单位联系人认证文件</nz-form-label
+        >
+        <nz-input-group>
+          <input
+            type="text"
+            formControlName="file"
+            placeholder="请输入用户名"
+          />
+        </nz-input-group> </nz-form-item
+      >
+    </form>
+
+    <button
+      id="basic"
+      class="form-button"
+      type="button"
+      mat-button
+      (click)="submitForm()"
+    >
+      保存
+    </button>
+    <div class="menu">
+      <a nz-dropdown [nzDropdownMenu]="menu">
+        <span style="color: #231c1f99">English</span>
+        <span
+          nz-icon
+          nzType="down"
+          style="color: #756b6d; margin-left: 4px"
+        ></span>
+      </a>
+      <nz-dropdown-menu #menu="nzDropdownMenu">
+        <ul nz-menu nzSelectable>
+          <li nz-menu-item>English</li>
+          <li nz-menu-item>中文简体</li>
+        </ul>
+      </nz-dropdown-menu>
+    </div>
+  </div>
+</div>

+ 84 - 0
projects/textbook/src/modules/login/account-info/account-info.component.scss

@@ -0,0 +1,84 @@
+.region {
+  width: 348px;
+  margin: 20px auto 10px;
+  .nav {
+    text-align: left;
+    margin: 10px 0 20px;
+    font-family: PingFang SC;
+    font-size: 24px;
+    font-weight: 600;
+    line-height: 33.6px;
+    .tips {
+      font-family: PingFang SC;
+      font-size: 14px;
+      font-weight: 400;
+      line-height: 19.6px;
+      text-align: left;
+      color: #545968;
+    }
+  }
+  .account-form {
+    height: 300px;
+    overflow-y: scroll;
+    scrollbar-width: none; /* firefox */
+    -ms-overflow-style: none; /* IE 10+ */
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+  .account-form::-webkit-scrollbar {
+    display: none; /* Chrome Safari */
+  }
+
+  nz-form-item {
+    display: flex;
+    flex-direction: column;
+    justify-content: start;
+    align-items: self-start;
+    margin-bottom: 10px;
+  }
+}
+input {
+  text-align: left;
+  border: none;
+  width: 100%;
+  padding: 4px 6px;
+  background: #f9f9f9;
+  border-radius: 4px;
+  font-family: PingFang SC;
+  font-size: 14px;
+  font-weight: 400;
+  line-height: 22px;
+}
+input {
+  outline: none;
+}
+.form-button {
+  width: 100%;
+  height: 46px;
+  margin: 10px 0;
+  background-color: #c6233f;
+  color: white !important;
+  border-radius: 4px;
+}
+::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
+  color: #c6233f;
+}
+::ng-deep .ant-tabs-ink-bar {
+  background: #c6233f;
+}
+::ng-deep .ant-tabs-tab:hover {
+  color: #e97488;
+}
+::ng-deep .ant-tabs-tab-btn:active {
+  color: #e97488;
+}
+// ::ng-deep .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{
+//   border-color: #c6233f;
+// }
+::ng-deep .ant-checkbox-checked .ant-checkbox-inner {
+  background-color: #c6233f;
+  border-color: #c6233f;
+}
+::ng-deep .ant-checkbox-wrapper:hover .ant-checkbox-inner {
+  border-color: #c6233f;
+}

+ 24 - 0
projects/textbook/src/modules/login/account-info/account-info.component.spec.ts

@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { AccountInfoComponent } from './account-info.component';
+
+describe('AccountInfoComponent', () => {
+  let component: AccountInfoComponent;
+  let fixture: ComponentFixture<AccountInfoComponent>;
+
+  beforeEach(waitForAsync(() => {
+    TestBed.configureTestingModule({
+      declarations: [ AccountInfoComponent ],
+      imports: [IonicModule.forRoot()]
+    }).compileComponents();
+
+    fixture = TestBed.createComponent(AccountInfoComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  }));
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 76 - 0
projects/textbook/src/modules/login/account-info/account-info.component.ts

@@ -0,0 +1,76 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { ReactiveFormsModule } from '@angular/forms';
+import { HttpClient } from '@angular/common/http';
+import { Router } from '@angular/router';
+import { catchError } from 'rxjs/operators';
+import {
+  FormControl,
+  FormGroup,
+  NonNullableFormBuilder,
+  Validators,
+} from '@angular/forms';
+import { CommonCompModule } from '../common.modules';
+import { textbookServer } from '../../../services/textbook';
+import { AuthServr } from '../../../services/auth.service';
+import { CaptchaComponent } from '../../../app/captcha/captcha.component';
+import { NzMessageService } from 'ng-zorro-antd/message';
+import Parse from 'parse';
+@Component({
+  selector: 'app-account-info',
+  standalone: true,
+  imports: [ReactiveFormsModule, CommonCompModule, CaptchaComponent],
+  templateUrl: './account-info.component.html',
+  styleUrls: ['./account-info.component.scss'],
+})
+export class AccountInfoComponent implements OnInit {
+  validateForm: FormGroup<{
+    name: FormControl<string>;//姓名
+    mobile: FormControl<string>;//手机号
+    email: FormControl<string>;//电子邮箱
+    workPhone: FormControl<string>;//公共电话
+    province: FormControl<string>;//省份
+    unitType: FormControl<string>;//单位类型
+    unit: FormControl<string>;//单位名称
+    department: FormControl<string>;//所在部门
+    job: FormControl<string>;//职务
+    idcard: FormControl<string>;//身份证号
+    identity: FormControl<string>;//用户类型
+    file: FormControl<string>; //单位联系人认证文件
+  }> = this.fb.group({
+    name: ['', [Validators.required]],
+    mobile: ['', [Validators.required]],
+    email: ['', [Validators.required]],
+    workPhone: ['', [Validators.required]],
+    province: ['', [Validators.required]],
+    unitType: ['', [Validators.required]],
+    unit: ['', [Validators.required]],
+    department: ['', [Validators.required]],
+    job: ['', [Validators.required]],
+    idcard: ['', [Validators.required]],
+    identity: ['', [Validators.required]],
+    file: ['', [Validators.required]],
+  });
+  constructor(
+    public tbookSer: textbookServer,
+    private fb: NonNullableFormBuilder,
+    public router: Router,
+    private authServr: AuthServr,
+    private message: NzMessageService,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {}
+  submitForm(): void {
+    if (this.validateForm.valid) {
+      let { name } = this.validateForm.value;
+    } else {
+      this.message.warning('请填写完整的信息');
+      Object.values(this.validateForm.controls).forEach((control) => {
+        if (control.invalid) {
+          control.markAsDirty();
+          control.updateValueAndValidity({ onlySelf: true });
+        }
+      });
+    }
+  }
+}

+ 11 - 3
projects/textbook/src/modules/login/common.modules.ts

@@ -2,21 +2,29 @@ import { NgModule } from '@angular/core';
 import { FormsModule } from '@angular/forms';
 import { NzFormModule } from 'ng-zorro-antd/form';
 import { NzIconModule } from 'ng-zorro-antd/icon';
-import { NzButtonModule } from 'ng-zorro-antd/button';
+// import { NzButtonModule } from 'ng-zorro-antd/button';
 import { NzModalModule } from 'ng-zorro-antd/modal';
 import { NzTabsModule } from 'ng-zorro-antd/tabs';
 import { NzInputModule } from 'ng-zorro-antd/input';
 import { NzSelectModule } from 'ng-zorro-antd/select';
+import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
+import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
+import {MatButtonModule} from '@angular/material/button';
+import { NzMessageModule } from 'ng-zorro-antd/message';
 @NgModule({
   exports: [
     FormsModule,
     NzFormModule,
     NzIconModule,
-    NzButtonModule,
+    // NzButtonModule,
     NzModalModule,
     NzTabsModule,
     NzInputModule,
-    NzSelectModule
+    NzSelectModule,
+    NzCheckboxModule,
+    NzDropDownModule,
+    MatButtonModule,
+    NzMessageModule
   ]
 })
 export class CommonCompModule { }

+ 192 - 92
projects/textbook/src/modules/login/login/login.component.html

@@ -1,32 +1,48 @@
 <div class="region">
-  <!-- <div class="selector">
-    @for (item of selector; track $index) {
-    <div
-      class="option"
-      [class.last]="$index == selector.length - 1"
-      [class.active]="item.type == currentProfile.type"
-      (click)="onChange(item)"
-    >
-      {{ item.name }}
+  <div class="nav">
+    <div>
+      <svg
+        width="24"
+        height="27"
+        viewBox="0 0 18 20"
+        fill="none"
+        xmlns="http://www.w3.org/2000/svg"
+      >
+        <path
+          d="M18 2H4C3.46957 2 2.96086 2.21071 2.58579 2.58579C2.21071 2.96086 2 3.46957 2 4C2 4.53043 2.21071 5.03914 2.58579 5.41421C2.96086 5.78929 3.46957 6 4 6H18V19C18 19.2652 17.8946 19.5196 17.7071 19.7071C17.5196 19.8946 17.2652 20 17 20H4C2.93913 20 1.92172 19.5786 1.17157 18.8284C0.421427 18.0783 0 17.0609 0 16V4C0 2.93913 0.421427 1.92172 1.17157 1.17157C1.92172 0.421427 2.93913 0 4 0H17C17.2652 0 17.5196 0.105357 17.7071 0.292893C17.8946 0.48043 18 0.734783 18 1V2Z"
+          fill="url(#paint0_linear_5_11023)"
+        />
+        <defs>
+          <linearGradient
+            id="paint0_linear_5_11023"
+            x1="9"
+            y1="-2.21282e-07"
+            x2="25.5"
+            y2="40"
+            gradientUnits="userSpaceOnUse"
+          >
+            <stop stop-color="#E04860" />
+            <stop offset="1" stop-color="#E99306" />
+          </linearGradient>
+        </defs>
+      </svg>
     </div>
-    }
-  </div> -->
+    登录教材遴选管理系统
+  </div>
   <div class="form">
-    <nz-tabset>
+    <nz-tabset [nzSelectedIndex]="active" (nzSelectChange)="onChange($event)">
       <nz-tab nzTitle="密码登录">
         <form
           nz-form
           [formGroup]="validateForm"
           class="login-form"
-          (ngSubmit)="submitForm()"
+          (ngSubmit)="submitForm('account')"
         >
-          <nz-form-item style="margin-bottom: 16px">
-            <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="user"
-              >用户名</nz-form-label
-            > -->
+          <nz-form-item>
             <nz-form-control>
               <nz-input-group nzPrefixIcon="user">
                 <input
+                  class="ipt"
                   type="text"
                   nz-input
                   formControlName="userName"
@@ -35,14 +51,12 @@
               </nz-input-group>
             </nz-form-control>
           </nz-form-item>
-          <nz-form-item style="margin-bottom: 16px">
-            <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="password"
-              >密码</nz-form-label
-            > -->
+          <nz-form-item>
             <nz-form-control>
               <nz-input-group nzPrefixIcon="lock">
                 <input
                   type="password"
+                  class="ipt"
                   nz-input
                   formControlName="password"
                   placeholder="请输入密码"
@@ -50,21 +64,39 @@
               </nz-input-group>
             </nz-form-control>
           </nz-form-item>
-          <nz-form-item style="margin-bottom: 16px">
-            <!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="code"
-              >验证码</nz-form-label
-            > -->
+          <nz-form-item class="row-code">
             <nz-form-control>
               <nz-input-group nzPrefixIcon="safety-certificate">
                 <input
                   type="text"
+                  class="ipt"
                   nz-input
+                  maxlength="4"
                   formControlName="code"
                   placeholder="请输入验证码"
                 />
               </nz-input-group>
             </nz-form-control>
+            @if(active == 0){
+            <fm-captcha
+              [type]="'text'"
+              [canvas_id]="'canvas_reset'"
+              style="width: 168px"
+              #codelogin
+              (changeVal)="onChangeCode($event)"
+              (onEnter)="submitForm('account')"
+            >
+            </fm-captcha>
+            }
           </nz-form-item>
+          <div class="checked">
+            <label nz-checkbox formControlName="checked"></label>
+            <span
+              >我已阅读并同意<a href="">隐私协议</a>与<a href=""
+                >服务条款</a
+              ></span
+            >
+          </div>
           <!-- <div nz-row class="login-form-margin">
             <div nz-col [nzSpan]="12">
               <a class="login-form-left" (click)="goUrl('/user/register')"
@@ -79,81 +111,149 @@
               >
             </div>
           </div> -->
-          <button nz-button class="login-form-button" [nzType]="'primary'">
+          <button
+            id="basic"
+            mat-raised-button
+            class="login-form-button"
+            type="button"
+            mat-button
+            (click)="submitForm('account')"
+          >
             登录
           </button>
+          <div style="text-align: left">
+            <a style="color: #756b6d"
+              ><span nz-icon nzType="question-circle" nzTheme="outline"></span
+            ></a>
+          </div>
+          <div class="menu">
+            <a nz-dropdown [nzDropdownMenu]="menu">
+              <span style="color: #231c1f99">English</span>
+              <span
+                nz-icon
+                nzType="down"
+                style="color: #756b6d; margin-left: 4px"
+              ></span>
+            </a>
+            <nz-dropdown-menu #menu="nzDropdownMenu">
+              <ul nz-menu nzSelectable>
+                <li nz-menu-item>English</li>
+                <li nz-menu-item>中文简体</li>
+              </ul>
+            </nz-dropdown-menu>
+          </div>
         </form>
       </nz-tab>
-      <nz-tab nzTitle="验证码登录"> 
+      <nz-tab nzTitle="验证码登录">
         <form
-        nz-form
-        [formGroup]="validateForm"
-        class="login-form"
-        (ngSubmit)="submitForm()"
-      >
-        <nz-form-item style="margin-bottom: 16px">
-          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="user"
-            >用户名</nz-form-label
-          >
-          <nz-form-control>
-            <nz-input-group>
-              <input
-                type="text"
-                nz-input
-                formControlName="userName"
-                placeholder="请输入用户名"
-              />
-            </nz-input-group>
-          </nz-form-control>
-        </nz-form-item>
-        <nz-form-item style="margin-bottom: 16px">
-          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="password"
-            >密码</nz-form-label
-          >
-          <nz-form-control>
-            <nz-input-group>
-              <input
-                type="password"
-                nz-input
-                formControlName="password"
-                placeholder="请输入密码"
-              />
-            </nz-input-group>
-          </nz-form-control>
-        </nz-form-item>
-        <nz-form-item style="margin-bottom: 16px">
-          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="code"
-            >验证码</nz-form-label
-          >
-          <nz-form-control>
-            <nz-input-group>
-              <input
-                type="text"
-                nz-input
-                formControlName="code"
-                placeholder="请输入验证码"
-              />
-            </nz-input-group>
-          </nz-form-control>
-        </nz-form-item>
-        <div nz-row class="login-form-margin">
-          <div nz-col [nzSpan]="12">
-            <a class="login-form-left" (click)="goUrl('/user/register')"
-              >立即注册</a
+          nz-form
+          [formGroup]="validateFormPhone"
+          class="login-form"
+          (ngSubmit)="submitForm('mobile')"
+        >
+          <nz-form-item>
+            <nz-form-control>
+              <nz-input-group nzPrefixIcon="mobile">
+                <input
+                  class="ipt"
+                  type="text"
+                  nz-input
+                  placeholder="请输入手机号 / 邮箱"
+                  maxlength="11"
+                  formControlName="phoneNumber"
+                />
+              </nz-input-group>
+            </nz-form-control>
+          </nz-form-item>
+          <nz-form-item class="row-code">
+            <nz-form-control>
+              <nz-input-group nzPrefixIcon="safety-certificate">
+                <input
+                  type="text"
+                  class="ipt"
+                  nz-input
+                  maxlength="4"
+                  formControlName="code"
+                  placeholder="请输入验证码"
+                />
+              </nz-input-group>
+            </nz-form-control>
+            @if(active == 1){
+            <fm-captcha
+              [type]="'text'"
+              [canvas_id]="'canvas_reset_mobile'"
+              style="width: 168px"
+              #codeloginSign
+              (changeVal)="onChangeCode($event)"
+              (onEnter)="submitForm('mobile')"
             >
-          </div>
-          <div nz-col [nzSpan]="12">
-            <a
-              class="login-form-forgot"
-              (click)="goUrl('/user/reset_password')"
-              >忘记密码</a
+            </fm-captcha>
+            }
+          </nz-form-item>
+          <nz-form-item class="row-code">
+            <nz-form-control>
+              <nz-input-group nzPrefixIcon="verified">
+                <input
+                  type="text"
+                  class="ipt"
+                  nz-input
+                  placeholder="请填写短信验证码"
+                  formControlName="checkCode"
+                  maxlength="8"
+                />
+              </nz-input-group>
+            </nz-form-control>
+            <button
+              class="vrifly-btn"
+              [disabled]="isCountingdown"
+              [style.background-color]="isCountingdown ? '#dcdcdc' : '#c6233f'"
+              type="button"
+              mat-button
+              (click)="startCountdown()"
+            >
+              {{ buttonText }}
+            </button>
+          </nz-form-item>
+          <div class="checked">
+            <label nz-checkbox formControlName="checked"></label>
+            <span
+              >我已阅读并同意<a href="">隐私协议</a>与<a href=""
+                >服务条款</a
+              ></span
             >
           </div>
-        </div>
-        <button nz-button class="login-form-button" [nzType]="'primary'">
-          登录
-        </button>
-      </form>
+          <button
+            id="basic"
+            class="login-form-button"
+            type="button"
+            mat-button
+            (click)="submitForm('mobile')"
+          >
+            登录 / 注册
+          </button>
+
+          <div style="text-align: left">
+            <a href="" style="color: #756b6d"
+              ><span nz-icon nzType="question-circle" nzTheme="outline"></span
+            ></a>
+          </div>
+          <div class="menu">
+            <a nz-dropdown [nzDropdownMenu]="menu">
+              <span style="color: #231c1f99">English</span>
+              <span
+                nz-icon
+                nzType="down"
+                style="color: #756b6d; margin-left: 4px"
+              ></span>
+            </a>
+            <nz-dropdown-menu #menu="nzDropdownMenu">
+              <ul nz-menu nzSelectable>
+                <li nz-menu-item>English</li>
+                <li nz-menu-item>中文简体</li>
+              </ul>
+            </nz-dropdown-menu>
+          </div>
+        </form>
       </nz-tab>
     </nz-tabset>
   </div>

+ 72 - 34
projects/textbook/src/modules/login/login/login.component.scss

@@ -1,68 +1,106 @@
 .region {
-  // width: 360px;
-  margin: 20px auto 50px;
-  display: flex;
-  justify-content: center;
-  // background-color: white;
-  // border-radius: 10px;
-  .selector {
-    font-size: 14px;
-    width: 150px;
-    display: flex;
-    flex-direction: column;
-    .option {
-      padding:16px 10px;
-      border-bottom: 1px solid #d9d9d9;
-      text-align: left;
-    }
-    .active {
-      background-color: #215ae5;
-      color: white;
-    }
-    .last{
-      border-bottom: none;
-    }
+  width: 348px;
+  margin: 20px auto 10px;
+  .nav {
+    text-align: left;
+    margin: 10px 0 20px;
+    font-family: PingFang SC;
+    font-size: 24px;
+    font-weight: 600;
+    line-height: 33.6px;
   }
   .form {
-    width: 360px;
+    width: 100%;
     // padding: 10px;
     // box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
     display: flex;
     flex-direction: column;
     justify-content: center;
-    .title{
+    .title {
       text-align: left;
       margin-bottom: 6px;
       font-size: 14px;
       font-weight: 600;
     }
     .login-form {
-      max-width: 300px;
+      max-width: 100%;
+      nz-form-item {
+        margin-bottom: 16px;
+      }
     }
-    .login-form-left{
+    .login-form-left {
       float: left;
     }
     .login-form-forgot {
       float: right;
     }
-    .login-form-margin{
+    .login-form-margin {
       margin-bottom: 8px;
       margin-top: 80px;
     }
     .login-form-button {
-      width: 90%;
+      width: 100%;
+      height: 46px;
+      margin: 10px 0;
+      background-color: #c6233f;
+      color: white;
+      border-radius: 4px;
+    }
+    .ipt {
+      padding: 8px;
+    }
+    .vrifly-btn {
+      height: 48px;
+      color: white;
+      border-radius: 4px;
+      margin-left: 10px;
+    }
+    .row-code {
+      width: 100%;
+      display: flex;
+      align-items: center;
+    }
+    .checked {
+      font-size: 14px;
+      display: flex;
+      align-items: center;
+      a {
+        color: #c6233f;
+      }
+    }
+    .menu {
+      width: 100%;
+      margin: 18px 0 0;
     }
   }
 }
-::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{
+input:-webkit-autofill,
+input:-webkit-autofill:hover,
+input:-webkit-autofill:focus,
+input:-webkit-autofill:active {
+  -webkit-transition-delay: 99999s;
+  -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
+}
+
+::ng-deep .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
   color: #c6233f;
 }
-::ng-deep .ant-tabs-ink-bar{
+::ng-deep .ant-tabs-ink-bar {
   background: #c6233f;
 }
-::ng-deep .ant-tabs-tab:hover{
+::ng-deep .ant-tabs-tab:hover {
   color: #e97488;
 }
-::ng-deep .ant-tabs-tab-btn:active{
+::ng-deep .ant-tabs-tab-btn:active {
   color: #e97488;
-}
+}
+// ::ng-deep .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{
+//   border-color: #c6233f;
+// }
+::ng-deep .ant-checkbox-checked .ant-checkbox-inner {
+  background-color: #c6233f;
+  border-color: #c6233f;
+}
+::ng-deep .ant-checkbox-wrapper:hover .ant-checkbox-inner {
+  border-color: #c6233f;
+}

+ 169 - 56
projects/textbook/src/modules/login/login/login.component.ts

@@ -1,98 +1,147 @@
-import { Component } from '@angular/core';
+import { Component, ViewChild } from '@angular/core';
 import { ReactiveFormsModule } from '@angular/forms';
+import { HttpClient } from "@angular/common/http";
 import { Router } from '@angular/router';
+import { catchError } from "rxjs/operators";
 import {
   FormControl,
   FormGroup,
   NonNullableFormBuilder,
   Validators,
+  ValidatorFn,
+  AbstractControl,
 } from '@angular/forms';
 import { CommonCompModule } from '../common.modules';
 import { textbookServer } from '../../../services/textbook';
 import { AuthServr } from '../../../services/auth.service';
+import { CaptchaComponent } from '../../../app/captcha/captcha.component';
 import Parse from "parse";
-
+import { NzMessageService } from 'ng-zorro-antd/message';
 @Component({
   selector: 'app-login',
   standalone: true,
-  imports: [ReactiveFormsModule, CommonCompModule],
+  imports: [ReactiveFormsModule, CommonCompModule,CaptchaComponent],
   templateUrl: './login.component.html',
   styleUrl: './login.component.scss',
 })
 export class LoginComponent {
+  @ViewChild("codelogin") codelogin: any; 
+  @ViewChild("codeloginSign") codeloginSign: any; 
+
+  code:string = '' //本地生成验证码
+
+  active:number = 0
   validateForm: FormGroup<{
     userName: FormControl<string>;
     password: FormControl<string>;
     code: FormControl<string>;
-    remember: FormControl<boolean>;
+    checked: FormControl<boolean>;
   }> = this.fb.group({
     userName: ['', [Validators.required]],
     password: ['', [Validators.required]],
     code: ['', [Validators.required]],
-    remember: [true],
+    checked: [false]
+  });
+  //校验手机号
+  confirmationValidator: ValidatorFn = (control: AbstractControl): { [s: string]: boolean } => {
+    let a = /^1[3456789]\d{9}$/;
+    if (!control.value || !String(control.value).match(a)) {
+      return { required: true };
+    }
+    return {};
+  };
+
+  validateFormPhone: FormGroup<{
+    phoneNumber: FormControl<string>;
+    code: FormControl<string>;
+    checkCode:FormControl<string>;
+    checked: FormControl<boolean>;
+  }> = this.fb.group({
+    phoneNumber: ['', [Validators.required, this.confirmationValidator]],
+    code: ['', [Validators.required]],
+    checkCode: ['', [Validators.required]],
+    checked: [false]
   });
-  selector: Array<any> = [
-    {
-      name: '国家级管理员',
-      type: 1,
-      route: '/nav-admin',
-    },
-    {
-      name: '省级教育行政部门',
-      type: 2,
-      route: '/nav-province-submit',
-    },
-    {
-      name: '流程管理员登录',
-      type: 3,
-      route: '/nav-province-contact',
-    },
-    {
-      name: '省属高校联系人',
-      type: 4,
-      route: '/nav-province-school-contact',
-    },
-    {
-      name: '教材评审组成员',
-      type: 5,
-      route: '/nav-review',
-    },
-    {
-      name: '作者/教师/主编',
-      type: 6,
-      route:'/nav-author/manage/space'
-    },
-  ];
-  currentProfile: any = this.selector[0];
+
   constructor(
     public tbookSer: textbookServer,
     private fb: NonNullableFormBuilder,
     public router: Router,
-    private authServr: AuthServr
+    private authServr: AuthServr,
+    private message: NzMessageService,
+    private http: HttpClient,
   ) {
     Parse?.User?.logOut()
   }
-  submitForm(): void {
-    if (this.validateForm.valid) {
-      let {userName, password, code } = this.validateForm.value
-      console.log(userName, password,);
-      localStorage.setItem('profile', JSON.stringify(this.currentProfile));
-      this.tbookSer.profile = this.currentProfile;
-      this.authServr.login(userName, password, this.tbookSer.company).then(() => {
-        this.router.navigate([this.currentProfile.route]);
-      });
-    } else {
-      Object.values(this.validateForm.controls).forEach((control) => {
-        if (control.invalid) {
-          control.markAsDirty();
-          control.updateValueAndValidity({ onlySelf: true });
+
+
+  onChangeCode(e:any){
+    let { code } = e
+    this.code = code
+  }
+
+  submitForm(type:string): void {
+    console.log(this.code);
+    if(type == 'account'){//登录
+      if (this.validateForm.valid) {
+        let {userName, password, code, checked } = this.validateForm.value
+        console.log(userName, password, code);
+        if(this.code.toLowerCase() != code?.toLowerCase()){
+          this.message.warning('验证码错误')
+          return
+        }else if(!checked){
+          this.message.warning('请勾选隐私协议与服务条款')
+          return
         }
-      });
+        this.authServr.login(userName, password, this.tbookSer.company).catch(data=>{
+          console.log(data);
+        })
+        this.codelogin.updateDrawCode();
+      } else {
+        this.message.warning('填写信息不正确')
+        Object.values(this.validateForm.controls).forEach((control) => {
+          if (control.invalid) {
+            control.markAsDirty();
+            control.updateValueAndValidity({ onlySelf: true });
+          }
+        });
+      }
+    }else{//手机号登录/注册
+      console.log(this.validateFormPhone.value);
+      if (this.validateFormPhone.valid) {
+        this.codeloginSign.updateDrawCode();
+        let {phoneNumber, code } = this.validateFormPhone.value
+        this.router.navigate(['/user/account_info']);
+
+        if(this.code.toLowerCase() != code?.toLowerCase()){
+          this.message.warning('验证码错误')
+          return
+        }
+        console.log(phoneNumber, code);
+        
+        // this.authServr.login(userName, password, this.tbookSer.company).then(() => {
+          // this.router.navigate(['/user/account_info']);
+        // });
+      } else {
+        this.message.warning('填写信息不正确')
+        Object.values(this.validateFormPhone.controls).forEach((control) => {
+          if (control.invalid) {
+            control.markAsDirty();
+            control.updateValueAndValidity({ onlySelf: true });
+          }
+        });
+      }
     }
+
   }
 
-  onChange(e: string) {
-    this.currentProfile = e;
+  onChange(e: any) {
+    console.log(e);
+    this.active = e.index
+    this.validateForm.reset()
+    this.validateFormPhone.reset()
+    this.codelogin.updateDrawCode();
+    this.codeloginSign.updateDrawCode();
   }
 
   goUrl(path: string) {
@@ -103,4 +152,68 @@ export class LoginComponent {
       },
     ]);
   }
+
+  buttonText = "获取验证码";
+  //添加倒计时开始和结束的判断
+  isCountingdown = false;
+  /* 获取验证码 */
+  codeDown: boolean = false;
+  startCountdown() {
+    let a = /^1[3456789]\d{9}$/;
+    let { phoneNumber, code } = this.validateFormPhone.value
+    console.log(phoneNumber);
+    if (!String(phoneNumber).match(a)) {
+      this.message.error("请填写正确手机号");
+      return;
+    }
+    if (code?.toLowerCase() != this.code.toLowerCase()) {
+      this.message.error("验证码不正确");
+      return;
+    }
+    if (this.codeDown || this.isCountingdown) return;
+    this.codeDown = true;
+    let host =
+      (Parse as any).serverURL?.split("parse")?.[0] ||
+      "https://server.fmode.cn/";
+
+    this.http
+      .post(host + "api/apig/message", {
+        company: this.tbookSer.company,
+        mobile: phoneNumber,
+      })
+      .pipe(
+        catchError(async (e) => {
+          // 显示报错
+          console.log(e);
+          this.message.create("error", e.error.mess || "验证码获取失败");
+          this.codeDown = false;
+          this.isCountingdown = false;
+          return;
+        })
+      )
+      .subscribe((res: any) => {
+        console.log(res);
+        if(res){
+          this.message.success("发送成功");
+          this.isCountingdown = true;
+          this.time();
+        }
+        this.codeloginSign.updateDrawCode();
+        this.codeDown = false;
+      });
+  }
+  /* 倒计时 */
+  time() {
+    this.isCountingdown = true;
+    this.buttonText = `${this.authServr.countdown}秒`;
+    const timer = setInterval(() => {
+      this.authServr.countdown--;
+      this.buttonText = `${this.authServr.countdown}秒`;
+      if (this.authServr.countdown === 0) {
+        clearInterval(timer);
+        this.buttonText = "重新发送";
+        this.isCountingdown = false;
+      }
+    }, 1000);
+  }
 }

+ 5 - 0
projects/textbook/src/modules/login/modules.routes.ts

@@ -3,11 +3,16 @@ import { RouterModule, Routes } from "@angular/router";
 import { LoginComponent } from './login/login.component';
 import { ResetPasswordComponent } from './reset-password/reset-password.component';
 import { RegisterComponent } from './register/register.component';
+import { AccountInfoComponent } from './account-info/account-info.component'
 const routes: Routes = [
   {
     path: 'login',
     component: LoginComponent,
   },
+  {
+    path:'account_info',
+    component:AccountInfoComponent
+  },
   {
     path: 'reset_password',
     component: ResetPasswordComponent,

+ 2 - 2
projects/textbook/src/modules/login/register/register.component.html

@@ -80,7 +80,7 @@
       </nz-input-group>
     </div>
     <div class="login-submit-btn">
-      <button
+      <!-- <button
         nz-button
         nzType="primary"
         nzBlock
@@ -88,7 +88,7 @@
         (click)="onRegister()"
       >
         注册
-      </button>
+      </button> -->
     </div>
   </div>
   <div class="card-fonter">

+ 2 - 2
projects/textbook/src/modules/login/reset-password/reset-password.component.html

@@ -69,7 +69,7 @@
       </nz-input-group>
     </div>
     <div class="login-submit-btn">
-      <button
+      <!-- <button
         nz-button
         nzType="primary"
         nzBlock
@@ -77,7 +77,7 @@
         (click)="onRegister()"
       >
         确认修改
-      </button>
+      </button> -->
     </div>
   </div>
   <div class="card-fonter">

+ 33 - 1
projects/textbook/src/services/auth.service.ts

@@ -10,8 +10,39 @@ export class AuthServr {
   countdown: number = 60; //登录时验证码倒计时
   regcountdown: number = 60; //注册验证码倒计时
   resetcountdown: number = 60; //重置密码验证码倒计时
-
   redirectUrl: string = '';
+  roterPath: Array<any> = [
+    {
+      name: '国家级管理员',
+      type: 1,
+      route: '/nav-admin',
+    },
+    {
+      name: '省级教育行政部门',
+      type: 2,
+      route: '/nav-province-submit',
+    },
+    {
+      name: '流程管理员登录',
+      type: 3,
+      route: '/nav-province-contact',
+    },
+    {
+      name: '省属高校联系人',
+      type: 4,
+      route: '/nav-province-school-contact',
+    },
+    {
+      name: '教材评审组成员',
+      type: 5,
+      route: '/nav-review',
+    },
+    {
+      name: '作者/教师/主编',
+      type: 6,
+      route:'/nav-author/manage/space'
+    },
+  ];
   constructor(public router: Router,private textbook:textbookServer) {}
   login(username:any, password:any, company:string) {
     return new Promise(async (resolve, reject) => {
@@ -35,6 +66,7 @@ export class AuthServr {
           console.log(data);
           localStorage.setItem('profile',JSON.stringify({type:'navAuthor'}))
           this.textbook.profile = {type:'navAuthor'}
+          this.router.navigate([this.roterPath[5].route]);
           resolve(data);
         })
         .catch((err:any) => {