import {Component} from '@angular/core'; import {Router} from '@angular/router' import BasicService from "@common/services/basic"; import StorageService from "@common/services/storage"; import DimmerService from "@common/services/dimmer"; import UserService from "@common/services/user"; import config from "../../config"; @Component({ selector: 'login', templateUrl: './template.html', styleUrls: ['./style.less'], providers: [ BasicService, StorageService, DimmerService, UserService ] }) export default class Login { data: any = { username: 'admin', password: 'li123456' }; otherData: any = { copyRight: config.copyRight }; constructor(private router: Router, private userService: UserService, private storageService: StorageService) { } submit() { this.router.navigateByUrl('/admin/home', { replaceUrl: true }); /*if (!this.data.username || !this.data.password) { return; } this.otherData.loading = true; this.otherData.loginFail = false; this.storageService.clear(); this.userService.login({ loginName: this.data.username, password: this.data.password }).then((data: any) => { this.router.navigateByUrl('/admin/home', { replaceUrl: true }); })*/ } }