feat: Reboot Api(未经测试)

This commit is contained in:
手瓜一十雪
2024-05-12 22:19:03 +08:00
parent b9688e46d4
commit 2c89311770
3 changed files with 26 additions and 0 deletions

View File

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