| | |
| | | import { NzMessageService } from 'ng-zorro-antd'; |
| | | import { SocialService, SocialOpenType, ITokenService, DA_SERVICE_TOKEN } from '@delon/auth'; |
| | | import { environment } from '@env/environment'; |
| | | import { CookieService } from 'angular2-cookie/services/cookies.service'; |
| | | @Component({ |
| | | selector: 'passport-login', |
| | | templateUrl: './login.component.html', |
| | | styleUrls: [ './login.component.less' ], |
| | | providers: [ SocialService] |
| | | providers: [ SocialService,CookieService] |
| | | }) |
| | | export class UserLoginComponent implements OnDestroy { |
| | | |
| | |
| | | private settingsService: SettingsService, |
| | | private socialService: SocialService, |
| | | private loginService:LoginService, |
| | | private _cookieService:CookieService, |
| | | @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) { |
| | | this.form = fb.group({ |
| | | userName: [null, [Validators.required, Validators.minLength(5)]], |
| | |
| | | captcha: [null, [Validators.required]], |
| | | remember: [true] |
| | | }); |
| | | let nowTime = new Date(); |
| | | nowTime.setDate(nowTime.getDate()+1); |
| | | this._cookieService.put('test','test',{expires:nowTime}); |
| | | } |
| | | |
| | | // region: fields |
| | |
| | | } |
| | | }, |
| | | (err) => { |
| | | console.log(err); |
| | | // console.log(err); |
| | | if(err instanceof ProgressEvent){ |
| | | const error = <ProgressEvent>err; |
| | | let xmlHttp = error.target; |