feat: api Extend RebootNormol

This commit is contained in:
手瓜一十雪
2024-05-13 09:32:25 +08:00
parent 94498e58c6
commit 750c6dfe65
3 changed files with 19 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { rebootWithQuickLogin } from '@/common/utils/reboot';
import { rebootWithNormolLogin, rebootWithQuickLogin } from '@/common/utils/reboot';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { selfInfo } from '@/core/data';
@@ -7,7 +7,7 @@ interface Payload {
delay: number
}
export default class Reboot extends BaseAction<Payload, null> {
export class Reboot extends BaseAction<Payload, null> {
actionName = ActionName.Reboot;
protected async _handle(payload: Payload): Promise<null> {
@@ -21,3 +21,17 @@ export default class Reboot extends BaseAction<Payload, null> {
return null;
}
}
export class RebootNormol extends BaseAction<Payload, null> {
actionName = ActionName.Reboot;
protected async _handle(payload: Payload): Promise<null> {
if (payload.delay) {
setTimeout(() => {
rebootWithNormolLogin();
}, payload.delay);
} else {
rebootWithNormolLogin();
}
return null;
}
}