diff --git a/src/app/AbstractRoute.ts b/src/app/AbstractRoute.ts new file mode 100644 index 0000000..fcafe99 --- /dev/null +++ b/src/app/AbstractRoute.ts @@ -0,0 +1,39 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs'; +import {NavigationStart, Router} from '@angular/router'; +import {filter} from 'rxjs/operators'; +import {environment} from '../environments/environment'; +import {CookieService} from 'ngx-cookie-service'; +import {RouteInterface} from './RouteInterface'; + +/** + * 导航开始时触发的事件 + */ +@Injectable({ + providedIn: 'root' +}) +export class AbstractRoute { + + // 登陆状态 + isLogin = false; + // 当前登陆账户 + managerName = null; + + navStart: Observable; + + constructor( + private router: Router, + private cookieService: CookieService + ) { + this.navStart = router.events.pipe( + filter(evt => evt instanceof NavigationStart) + ) as Observable; + } + + checkUser(routeInterface: RouteInterface): void { + this.isLogin = this.cookieService.check(environment.tokenKey); + this.managerName = this.cookieService.get(environment.managerKey); + + this.navStart.subscribe(evt => routeInterface.doNavigationStart(evt, this.isLogin, this.managerName)); + } +} diff --git a/src/app/RouteInterface.ts b/src/app/RouteInterface.ts new file mode 100644 index 0000000..924074d --- /dev/null +++ b/src/app/RouteInterface.ts @@ -0,0 +1,18 @@ +import {RouterEvent} from '@angular/router'; +import {Injectable} from '@angular/core'; + +/** + * 导航开始时触发事件验证用户 + */ +export interface RouteInterface { + doNavigationStart(evt: RouterEvent, isLogin: boolean, managerName: string); +} + +@Injectable({ + providedIn: 'root' +}) +export class RouteInterfaceImpl implements RouteInterface { + doNavigationStart(evt: RouterEvent, isLogin: boolean, managerName: string) { + console.debug(evt.url); + } +} diff --git a/src/app/account/login/login.component.ts b/src/app/account/login/login.component.ts index 4c6aba6..4f8b18c 100644 --- a/src/app/account/login/login.component.ts +++ b/src/app/account/login/login.component.ts @@ -6,7 +6,7 @@ import {LoginService} from './login.service'; import {Result} from '../../interface/Result'; import {environment} from '../../../environments/environment'; import {CookieService} from 'ngx-cookie-service'; -import {MessageService} from '../../message/message.service'; +import {MessageInterface, MessageUtil} from '../../message/message.service'; @Component({ selector: 'app-login', @@ -14,7 +14,7 @@ import {MessageService} from '../../message/message.service'; styleUrls: ['./login.component.scss'] }) // 登陆模块 -export class LoginComponent extends Commons implements OnInit { +export class LoginComponent extends Commons implements OnInit, MessageInterface { // 登陆表单 loginForm = this.fb.group({ // 管理员名 @@ -28,7 +28,7 @@ export class LoginComponent extends Commons implements OnInit { private router: Router, private loginService: LoginService, private cookieService: CookieService, - private messageService: MessageService + private messageUtil: MessageUtil ) { super(); @@ -44,17 +44,17 @@ export class LoginComponent extends Commons implements OnInit { // 发送登陆请求 this.loginService.login(JSON.stringify(this.loginForm.value)).subscribe(r => { - if (r.result === Result.OK) { - this.messageService.info('登陆成功'); - const time = new Date(); - time.setTime(r.body.useTime); - this.cookieService.set(environment.managerKey, r.body.managerName, time); - this.cookieService.set(environment.tokenKey, r.body.token, time); - this.router.navigateByUrl('/forum'); - } else { - this.messageService.danger('登陆失败'); - } - }); + if (r.result === Result.OK) { + this.messageUtil.info(this.prefix(r.message)); + const time = new Date(); + time.setTime(r.managerToken.useTime); + this.cookieService.set(environment.managerKey, r.managerToken.managerName, time); + this.cookieService.set(environment.tokenKey, r.managerToken.token, time); + location.href = '/forum'; + } else { + this.messageUtil.danger(this.prefix(r.message)); + } + }); } @@ -62,4 +62,8 @@ export class LoginComponent extends Commons implements OnInit { return this.loginForm; } + prefix(key: string): string { + return 'server.login.' + key; + } + } diff --git a/src/app/account/login/login.service.ts b/src/app/account/login/login.service.ts index 705bdc2..95cd937 100644 --- a/src/app/account/login/login.service.ts +++ b/src/app/account/login/login.service.ts @@ -2,9 +2,9 @@ import {Injectable} from '@angular/core'; import {JSONRequest} from '../../interface/JSONRequest'; import {HttpClient} from '@angular/common/http'; import {HttpInterface} from '../../interface/HttpInterface'; -import {JSONResponse} from '../../interface/JSONResponse'; import {catchError} from 'rxjs/operators'; import {Observable} from 'rxjs'; +import {LoginResponse, LogoutResponse} from '../../interface/Response'; @Injectable({ providedIn: 'root' @@ -20,8 +20,8 @@ export class LoginService extends JSONRequest { /** * 注销登录 */ - logout(): Observable> { - return this.http.post>(HttpInterface.logout, {}, this.httpOptions) + logout(body): Observable { + return this.http.post(HttpInterface.logout, body, this.httpOptions) .pipe( catchError(this.handleError('注销')) ); @@ -30,8 +30,8 @@ export class LoginService extends JSONRequest { /** * 登陆 */ - login(body): Observable> { - return this.http.post>(HttpInterface.login, body, this.httpOptions) + login(body): Observable { + return this.http.post(HttpInterface.login, body, this.httpOptions) .pipe( catchError(this.handleError('登陆')) ); diff --git a/src/app/account/register/register.component.ts b/src/app/account/register/register.component.ts index 63d835b..ab0b6c1 100644 --- a/src/app/account/register/register.component.ts +++ b/src/app/account/register/register.component.ts @@ -5,7 +5,7 @@ import {RegisterService} from './register.service'; import {AppService} from '../../app.service'; import {Result} from '../../interface/Result'; import {Router} from '@angular/router'; -import {MessageService} from '../../message/message.service'; +import {MessageInterface, MessageUtil} from '../../message/message.service'; @Component({ selector: 'app-register', @@ -15,8 +15,7 @@ import {MessageService} from '../../message/message.service'; // 注册模块 -export class RegisterComponent extends Commons implements OnInit { - +export class RegisterComponent extends Commons implements OnInit, MessageInterface { // 注册表单 registerForm = this.fb.group({ @@ -40,13 +39,12 @@ export class RegisterComponent extends Commons implements OnInit { */ emailType$ = this.appService.getEmailType(); - constructor( private fb: FormBuilder, private registerService: RegisterService, private appService: AppService, private router: Router, - private messageService: MessageService + private messageUtil: MessageUtil ) { super(); } @@ -70,10 +68,10 @@ export class RegisterComponent extends Commons implements OnInit { register() { this.registerService.register(this.registerForm.value).subscribe(r => { if (r.result === Result.OK) { - this.messageService.info('注册成功'); + this.messageUtil.info(this.prefix(r.message)); this.router.navigateByUrl('/login'); } else { - this.messageService.danger('注册失败'); + this.messageUtil.danger(this.prefix(r.message)); } }); } @@ -90,5 +88,9 @@ export class RegisterComponent extends Commons implements OnInit { form(): FormGroup { return this.registerForm; } + + prefix(key: string): string { + return 'server.register.' + key; + } } diff --git a/src/app/account/register/register.service.ts b/src/app/account/register/register.service.ts index 4772fc6..bf86a7c 100644 --- a/src/app/account/register/register.service.ts +++ b/src/app/account/register/register.service.ts @@ -2,12 +2,9 @@ import {Injectable} from '@angular/core'; import {JSONRequest} from '../../interface/JSONRequest'; import {HttpClient} from '@angular/common/http'; import {catchError} from 'rxjs/operators'; -import {JSONResponse} from '../../interface/JSONResponse'; import {HttpInterface} from '../../interface/HttpInterface'; -import {Result} from '../../interface/Result'; -import {Router} from '@angular/router'; -import {MessageService} from '../../message/message.service'; import {Observable} from 'rxjs'; +import {RegisterResponse} from '../../interface/Response'; @Injectable({ @@ -25,8 +22,8 @@ export class RegisterService extends JSONRequest { * * @param body 注册表单 */ - register(body): Observable> { - return this.http.post>(HttpInterface.register, body, this.httpOptions) + register(body): Observable { + return this.http.post(HttpInterface.register, body, this.httpOptions) .pipe( catchError(this.handleError('注册')) ); diff --git a/src/app/account/resetpwd/resetpwd.component.html b/src/app/account/resetpwd/resetpwd.component.html index e4d6e2b..e96b636 100644 --- a/src/app/account/resetpwd/resetpwd.component.html +++ b/src/app/account/resetpwd/resetpwd.component.html @@ -15,7 +15,7 @@ -
+
{{ 'register.email' | translate }}
@@ -24,7 +24,7 @@ [class.is-invalid]="getValue('email').invalid"/> diff --git a/src/app/account/resetpwd/resetpwd.component.ts b/src/app/account/resetpwd/resetpwd.component.ts index 2eaf343..c2815d6 100644 --- a/src/app/account/resetpwd/resetpwd.component.ts +++ b/src/app/account/resetpwd/resetpwd.component.ts @@ -4,7 +4,7 @@ import {Commons} from '../../commons'; import {AppService} from '../../app.service'; import {ResetpwdService} from './resetpwd.service'; import {Result} from '../../interface/Result'; -import {MessageService} from '../../message/message.service'; +import {MessageInterface, MessageUtil} from '../../message/message.service'; import {Router} from '@angular/router'; @Component({ @@ -13,7 +13,7 @@ import {Router} from '@angular/router'; styleUrls: ['./resetpwd.component.scss'] }) // 重置密码模块 -export class ResetpwdComponent extends Commons implements OnInit { +export class ResetpwdComponent extends Commons implements OnInit, MessageInterface { // 重置密码表单 resetForm = this.fb.group({ @@ -43,7 +43,7 @@ export class ResetpwdComponent extends Commons implements OnInit { private fb: FormBuilder, private appService: AppService, private resetpwdService: ResetpwdService, - private messageService: MessageService, + private messageUtil: MessageUtil, private router: Router ) { super(); @@ -59,15 +59,13 @@ export class ResetpwdComponent extends Commons implements OnInit { checkEmail() { this.resetpwdService.checkEmail(this.resetForm.value).subscribe(r => { if (r.result === Result.OK) { - // this.messageService.info('邮箱正确'); + this.messageUtil.info(this.prefix(r.message)); // 进入第二步 this.step = 2; - // 清空提示 - this.messageService.message = null; // 第二步不允许编辑账户和邮箱 this.disabled(); } else { - this.messageService.danger('账号或邮箱错误'); + this.messageUtil.danger(this.prefix(r.message)); } }); } @@ -88,13 +86,13 @@ export class ResetpwdComponent extends Commons implements OnInit { // 发送验证码 sendCode() { this.resetpwdService.sendCode({ - managerName: this.getValue('managerName').value + email: this.getValue('email').value, + emailType: this.getValue('emailType').value }).subscribe(res => { - this.disabled(); if (res.result === Result.OK) { - this.messageService.info('验证码发送成功,请查收验证码'); + this.messageUtil.info(this.prefix(res.message)); } else { - this.messageService.danger('验证码发送失败,请重试或联系管理员'); + this.messageUtil.danger(this.prefix(res.message)); } }); } @@ -111,15 +109,16 @@ export class ResetpwdComponent extends Commons implements OnInit { */ checkCode() { this.resetpwdService.checkCode({ - managerName: this.getValue('managerName').value + email: this.getValue('email').value, + emailType: this.getValue('emailType').value, + verificationCode: this.getValue('verificationCode').value }).subscribe(res => { if (res.result === Result.OK) { + this.messageUtil.info(this.prefix(res.message)); // 进入第三步 this.step = 3; - // 清空提示 - this.messageService.message = null; } else { - this.messageService.danger('验证码不正确,请重新输入'); + this.messageUtil.danger(this.prefix(res.message)); } }); } @@ -133,10 +132,10 @@ export class ResetpwdComponent extends Commons implements OnInit { password: this.getValue('password').value }).subscribe(res => { if (res.result === Result.OK) { - this.messageService.info('重制密码成功'); + this.messageUtil.info(this.prefix(res.message)); this.router.navigateByUrl('/login'); } else { - this.messageService.danger('重置密码失败'); + this.messageUtil.danger(this.prefix(res.message)); } }); } @@ -152,4 +151,7 @@ export class ResetpwdComponent extends Commons implements OnInit { return this.getValue('managerName').invalid || this.getValue('email').invalid || this.getValue('emailType').invalid; } + prefix(key: string): string { + return 'server.resetpwd.' + key; + } } diff --git a/src/app/account/resetpwd/resetpwd.service.ts b/src/app/account/resetpwd/resetpwd.service.ts index e35260c..306a5d3 100644 --- a/src/app/account/resetpwd/resetpwd.service.ts +++ b/src/app/account/resetpwd/resetpwd.service.ts @@ -1,11 +1,10 @@ import {Injectable} from '@angular/core'; import {JSONRequest} from '../../interface/JSONRequest'; -import {Router} from '@angular/router'; import {HttpClient} from '@angular/common/http'; import {HttpInterface} from '../../interface/HttpInterface'; import {catchError} from 'rxjs/operators'; -import {JSONResponse} from '../../interface/JSONResponse'; import {Observable} from 'rxjs'; +import {ResetpwdResponse} from '../../interface/Response'; @Injectable({ providedIn: 'root' @@ -16,8 +15,7 @@ import {Observable} from 'rxjs'; export class ResetpwdService extends JSONRequest { constructor( - private http: HttpClient, - private router: Router + private http: HttpClient ) { super(); } @@ -25,8 +23,8 @@ export class ResetpwdService extends JSONRequest { /** * 检查邮箱 */ - checkEmail(body): Observable> { - return this.http.post>(HttpInterface.checkEmail, body, this.httpOptions) + checkEmail(body): Observable { + return this.http.post(HttpInterface.checkEmail, body, this.httpOptions) .pipe( catchError(this.handleError('检查邮箱')) ); @@ -35,8 +33,8 @@ export class ResetpwdService extends JSONRequest { /** * 发送验证码 */ - sendCode(body): Observable> { - return this.http.post>(HttpInterface.sendCode, body, this.httpOptions) + sendCode(body): Observable { + return this.http.post(HttpInterface.sendCode, body, this.httpOptions) .pipe( catchError(this.handleError('发送验证码')) ); @@ -46,8 +44,8 @@ export class ResetpwdService extends JSONRequest { * 检查验证码 * @param body 表单值 */ - checkCode(body): Observable> { - return this.http.post>(HttpInterface.checkCode, body, this.httpOptions) + checkCode(body): Observable { + return this.http.post(HttpInterface.checkCode, body, this.httpOptions) .pipe( catchError(this.handleError('检查验证码')) ); @@ -56,8 +54,8 @@ export class ResetpwdService extends JSONRequest { /** * 重置密码 */ - resetPwd(body): Observable> { - return this.http.post>(HttpInterface.resetPwd, body, this.httpOptions) + resetPwd(body): Observable { + return this.http.post(HttpInterface.resetPwd, body, this.httpOptions) .pipe( catchError(this.handleError('重置密码')) ); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dc4c47c..8643143 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,85 +1,78 @@ import {Component, OnInit} from '@angular/core'; // 路由 -import {NavigationStart, Router} from '@angular/router'; +import {Router, RouterEvent} from '@angular/router'; // 国际化服务 import {TranslateService} from '@ngx-translate/core'; // 路由事件 -import {Observable} from 'rxjs'; -import {filter} from 'rxjs/operators'; // cookie操作 import {CookieService} from 'ngx-cookie-service'; // 环境变量 -import {environment} from '../environments/environment'; import {LoginService} from './account/login/login.service'; import {Result} from './interface/Result'; -import {MessageService} from './message/message.service'; +import {MessageInterface, MessageUtil} from './message/message.service'; +import {AbstractRoute} from './AbstractRoute'; +import {RouteInterface} from './RouteInterface'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent implements OnInit { +export class AppComponent implements OnInit, MessageInterface { // 登陆状态 isLogin = false; // 当前登陆账户 managerName = null; - navStart: Observable; - /** * * @param translate 国际化 * @param router 路由器 * @param cookieService cookie管理服务 * @param loginService 登陆服务 - * @param messageService 信息反馈服务 + * @param messageUtil 弹窗信息管理 + * @param abstractRoute 路由事件处理器 */ constructor( public translate: TranslateService, private router: Router, private cookieService: CookieService, private loginService: LoginService, - private messageService: MessageService, + private messageUtil: MessageUtil, + private abstractRoute: AbstractRoute ) { - this.navStart = router.events.pipe( - filter(evt => evt instanceof NavigationStart) - ) as Observable; } /** * 注销登录 */ logout() { - this.loginService.logout().subscribe(r => { + this.loginService.logout({managerName: this.managerName}).subscribe(r => { if (r.result === Result.OK) { this.cookieService.deleteAll(); - this.messageService.info('注销成功'); - this.router.navigateByUrl('/login'); + location.href = '/login'; + this.messageUtil.info(this.prefix(r.message)); } else { - alert('注销失败'); + this.messageUtil.danger(this.prefix(r.message)); } }); } - async ngOnInit() { - this.navStart.subscribe(evt => { + ngOnInit() { - this.isLogin = this.cookieService.check(environment.tokenKey); - this.managerName = this.cookieService.get(environment.managerKey); - if (evt.url !== '/forum' && this.isLogin) { - this.router.navigateByUrl('/forum'); - } else if (evt.url !== '/login' && !this.isLogin) { - this.router.navigateByUrl('/login'); - } else { - console.debug('当前路由' + evt.url + '不需要重定向'); + const that = this; + // tslint:disable-next-line:new-parens + this.abstractRoute.checkUser(new class implements RouteInterface { + doNavigationStart(evt: RouterEvent, isLogin: boolean, managerName: string) { + that.isLogin = isLogin; + that.managerName = managerName; } }); // 语言初始化(若未设置语言, 则取浏览器语言) - const currentLanguage = await localStorage.getItem('currentLanguage') || this.translate.getBrowserCultureLang(); + const currentLanguage = this.translate.getBrowserCultureLang(); // 当在assets/i18n中找不到对应的语言翻译时,使用'zh-CN'作为默认语言 this.translate.setDefaultLang('zh-CN'); this.translate.use(currentLanguage); @@ -87,4 +80,9 @@ export class AppComponent implements OnInit { localStorage.setItem('currentLanguage', currentLanguage); } + prefix(key: string): string { + return 'server.logout.' + key; + } + + } diff --git a/src/app/app.service.ts b/src/app/app.service.ts index 4d57aaf..3298b23 100644 --- a/src/app/app.service.ts +++ b/src/app/app.service.ts @@ -1,10 +1,10 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs'; -import {JSONResponse} from './interface/JSONResponse'; import {HttpInterface} from './interface/HttpInterface'; import {catchError} from 'rxjs/operators'; import {JSONRequest} from './interface/JSONRequest'; import {HttpClient} from '@angular/common/http'; +import {EmailTypeResponse} from './interface/Response'; @Injectable({ providedIn: 'root' @@ -20,8 +20,8 @@ export class AppService extends JSONRequest { /** * 获取邮箱类型 */ - getEmailType(): Observable> { - return this.http.get>(HttpInterface.getEmailType) + getEmailType(): Observable { + return this.http.get(HttpInterface.getEmailType) .pipe( catchError(this.handleError('获取邮箱类型')) ); diff --git a/src/app/interface/EmailType.ts b/src/app/interface/EmailType.ts new file mode 100644 index 0000000..a4a5267 --- /dev/null +++ b/src/app/interface/EmailType.ts @@ -0,0 +1,7 @@ +// 邮箱类型 +export class EmailType { + // 邮箱标志 + name: string; + // 邮箱后缀 + suffix: string; +} diff --git a/src/app/interface/Response.ts b/src/app/interface/Response.ts new file mode 100644 index 0000000..01572ea --- /dev/null +++ b/src/app/interface/Response.ts @@ -0,0 +1,42 @@ +import {Result} from './Result'; +import {Token} from './Token'; +import {EmailType} from './EmailType'; + +export interface Response { + // 响应结果 + result: Result; + // 响应详细结果 + message: string; +} + +/** + * 注销响应 + */ +// tslint:disable-next-line:no-empty-interface +export interface LogoutResponse extends Response { + +} + +/** + * 管理员登录响应 + */ +export interface LoginResponse extends Response { + managerToken: Token; +} + +// 注册响应 +// tslint:disable-next-line:no-empty-interface +export interface RegisterResponse extends Response { + +} + +// 邮箱类型响应 +export interface EmailTypeResponse extends Response { + emailTypeList: Array; +} + +// 重置密码响应 +// tslint:disable-next-line:no-empty-interface +export interface ResetpwdResponse extends Response { + +} diff --git a/src/app/interface/Token.ts b/src/app/interface/Token.ts new file mode 100644 index 0000000..5667f5a --- /dev/null +++ b/src/app/interface/Token.ts @@ -0,0 +1,10 @@ +export interface Token { + // 令牌 + token: string; + // 创建时间 + createTime: number; +// 有效时间 + useTime: number; + // 管理员名 + managerName: string; +} diff --git a/src/app/message/message.service.ts b/src/app/message/message.service.ts index ef7a311..38de931 100644 --- a/src/app/message/message.service.ts +++ b/src/app/message/message.service.ts @@ -1,10 +1,9 @@ import {Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; @Injectable({ providedIn: 'root' }) - - export class MessageService { // 提示框信息 @@ -47,3 +46,36 @@ export class MessageService { } + +@Injectable({ + providedIn: 'root' +}) +// 获取国际化翻译 +export class MessageUtil { + constructor(private translate: TranslateService, + private messageService: MessageService) { + } + + // tslint:disable-next-line:ban-types + info(key: string | Array, interpolateParams?: Object) { + this.translate.get(key, interpolateParams).subscribe(s => { + this.messageService.info(s); + }); + } + + // tslint:disable-next-line:ban-types + danger(key: string | Array, interpolateParams?: Object) { + this.translate.get(key, interpolateParams).subscribe(s => { + this.messageService.danger(s); + }); + } + + reset() { + this.messageService.message = null; + } +} + +// 国际化前缀 +export interface MessageInterface { + prefix(key: string): string; +} diff --git a/src/assets/i18n/en-US.json b/src/assets/i18n/en-US.json index 7aae835..8726d25 100644 --- a/src/assets/i18n/en-US.json +++ b/src/assets/i18n/en-US.json @@ -31,7 +31,8 @@ "complaint": "time:{{time}}", "plaintiff": "plaintiff", "defendant": "defendant", - "load_notices": "Loading advertising information" + "load_notices": "Loading advertising information", + "load_posts": "Loading posts" }, "tip":{ "input": "please input {{value}}", @@ -54,5 +55,37 @@ "next_page": "Next", "prev_page": "Previous", "check_code": "check_code" + }, + "server": { + "login": { + "manager": "管理员不能为空!", + "password": "密码不能为空!", + "fail": "账号或密码错误!", + "ok": "登陆成功" + }, + "register": { + "manager": "管理员不能为空", + "password": "密码不能为空", + "confirmPassword": "确认密码不能为空", + "passwordNotMatch": "两次密码输入不一致", + "mobie": "手机号不能为空", + "email": "邮箱不能为空", + "username": "用户已存在", + "ok": "注册成功" + }, + "logout": { + "ok": "注销成功", + "fail": "注销失败" + }, + "resetpwd": { + "check_ok": "校验成功", + "check_fail": "账号或邮箱错误", + "send_code_ok": "验证码发送成功,请查收验证码", + "send_code_fail": "验证码发送失败,请重试或联系管理员", + "valid_code_ok": "校验成功", + "valid_code_fail": "验证码不正确,请重新输入", + "resetpwd_ok": "重置密码成功", + "resetpwd_fail": "重置密码失败" + } } } diff --git a/src/assets/i18n/zh-CN.json b/src/assets/i18n/zh-CN.json index f10e8e8..182177c 100644 --- a/src/assets/i18n/zh-CN.json +++ b/src/assets/i18n/zh-CN.json @@ -55,5 +55,37 @@ "next_page": "下一页", "prev_page": "上一页", "check_code": "检查验证码" + }, + "server": { + "login": { + "manager": "管理员不能为空!", + "password": "密码不能为空!", + "fail": "账号或密码错误!", + "ok": "登陆成功" + }, + "register": { + "manager": "管理员不能为空", + "password": "密码不能为空", + "confirmPassword": "确认密码不能为空", + "passwordNotMatch": "两次密码输入不一致", + "mobie": "手机号不能为空", + "email": "邮箱不能为空", + "username": "用户已存在", + "ok": "注册成功" + }, + "logout": { + "ok": "注销成功", + "fail": "注销失败" + }, + "resetpwd": { + "check_ok": "校验成功", + "check_fail": "账号或邮箱错误", + "send_code_ok": "验证码发送成功,请查收验证码", + "send_code_fail": "验证码发送失败,请重试或联系管理员", + "valid_code_ok": "校验成功", + "valid_code_fail": "验证码不正确,请重新输入", + "resetpwd_ok": "重置密码成功", + "resetpwd_fail": "重置密码失败" + } } }