|
@@ -44,6 +44,17 @@ export class LoginPageComponent implements OnInit, OnDestroy {
|
|
|
private readonly route = inject(ActivatedRoute);
|
|
private readonly route = inject(ActivatedRoute);
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
ngOnInit(): void {
|
|
|
|
|
+ // WeChat links may reopen the login URL directly. The session service
|
|
|
|
|
+ // restores the device's persisted session before this page initializes,
|
|
|
|
|
+ // so skip the form when that session is still present.
|
|
|
|
|
+ if (this.session.isLoggedIn()) {
|
|
|
|
|
+ const requestedReturnUrl = this.route.snapshot.queryParamMap.get('returnUrl');
|
|
|
|
|
+ const returnUrl = requestedReturnUrl?.startsWith('/') && !requestedReturnUrl.startsWith('//')
|
|
|
|
|
+ ? requestedReturnUrl
|
|
|
|
|
+ : '/pages/home/index';
|
|
|
|
|
+ void this.router.navigateByUrl(returnUrl, { replaceUrl: true });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if(this.route.snapshot.queryParamMap.get('passwordChanged')==='1')this.sessionMessage.set('密码已修改,请使用新密码重新登录');
|
|
if(this.route.snapshot.queryParamMap.get('passwordChanged')==='1')this.sessionMessage.set('密码已修改,请使用新密码重新登录');
|
|
|
if (this.route.snapshot.queryParamMap.get('expired') === '1') {
|
|
if (this.route.snapshot.queryParamMap.get('expired') === '1') {
|
|
|
this.sessionMessage.set('登录状态已过期,请重新登录后继续学习');
|
|
this.sessionMessage.set('登录状态已过期,请重新登录后继续学习');
|