feat: Reboot Api(未经测试)
This commit is contained in:
1 parent
25b39cb39a
commit
c2b4dd2afd
3 files changed
+26
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user