feat: 重构锁屏功能
This commit is contained in:
@@ -3,9 +3,9 @@ import { message } from 'ant-design-vue/lib';
|
||||
import { reactive } from 'vue';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useLockedStore from '@/store/modules/locked';
|
||||
import { bootloaderReset } from '@/api/system/quick-start/bootloader';
|
||||
const lockedStore = useLockedStore();
|
||||
import useMaskStore from '@/store/modules/mask';
|
||||
const maskStore = useMaskStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
type StateType = {
|
||||
@@ -36,13 +36,13 @@ function fnModalVisible() {
|
||||
/**对话框提交确认 */
|
||||
function fnModalOk() {
|
||||
// 发送请求
|
||||
lockedStore.fnLock('reset');
|
||||
maskStore.handleMaskType('reset');
|
||||
bootloaderReset().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
fnModalCancel();
|
||||
lockedStore.fnLock('reload');
|
||||
maskStore.handleMaskType('reload');
|
||||
} else {
|
||||
lockedStore.fnLock('none');
|
||||
maskStore.handleMaskType('none');
|
||||
message.error(res.msg, 3);
|
||||
clearInterval(state.timer);
|
||||
state.timer = null;
|
||||
|
||||
Reference in New Issue
Block a user