Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复了一些类型错误和eslint的报错 #6896

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jeecgboot-vue3/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ module.exports = defineConfig({
math: 'always',
},
],
'vue/multi-word-component-names': 'off',
},
});
4 changes: 2 additions & 2 deletions jeecgboot-vue3/src/api/common/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export const downloadFile = (url, fileName?, parameter?) => {
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName);
} else {
let url = window.URL.createObjectURL(new Blob([data]));
let link = document.createElement('a');
const url = window.URL.createObjectURL(new Blob([data]));
const link = document.createElement('a');
link.style.display = 'none';
link.href = url;
link.setAttribute('download', fileName);
Expand Down
31 changes: 18 additions & 13 deletions jeecgboot-vue3/src/views/sys/lock/LockPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@
{{ userinfo.realname }}
</p>
</div>
<InputPassword @change="unLock('change')" @keyup.enter="unLock('enter')" :placeholder="t('sys.lock.placeholder')" class="enter-x" v-model:value="password" />
<InputPassword
@change="unLock('change')"
@keyup.enter="unLock('enter')"
:placeholder="t('sys.lock.placeholder')"
class="enter-x"
v-model:value="password"
/>
<span :class="`${prefixCls}-entry__err-msg enter-x`" v-if="errMsg">
{{ t('sys.lock.alert') }}
</span>
<div :class="`${prefixCls}-entry__footer enter-x`" style="justify-content:center;margin-top: 4px">
<div :class="`${prefixCls}-entry__footer enter-x`" style="justify-content: center; margin-top: 4px">
<!-- <a-button type="link" size="small" class="mt-2 mr-2 enter-x" :disabled="loading" @click="handleShowForm(true)">
{{ t('common.back') }}
</a-button>-->
<a-button type="link" size="small" :disabled="loading" @click="goLogin">
<a-button type="link" size="small" :disabled="loading" @click="goLogin">
{{ t('sys.lock.backToLogin') }}
</a-button>
<!-- <a-button class="mt-2" type="link" size="small" @click="unLock()" :loading="loading">
Expand All @@ -58,7 +64,7 @@
</div>
</template>
<script lang="ts" setup>
import {ref, computed, onMounted, onUnmounted} from 'vue';
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { Input } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
import { useLockStore } from '/@/store/modules/lock';
Expand Down Expand Up @@ -89,7 +95,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';

/**
* @description: unLock
*
*
* @param type enter 回车 change input值发生改变 不提示锁屏密码错误
*/
async function unLock(type) {
Expand All @@ -100,7 +106,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
try {
loading.value = true;
const res = await lockStore.unLock(pwd);
if(type === 'enter'){
if (type === 'enter') {
errMsg.value = !res;
}
} finally {
Expand All @@ -119,7 +125,7 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';

/**
* 监听键盘触发事件
*
*
* @param event
*/
function handleKeyDown(event) {
Expand All @@ -129,15 +135,14 @@ import {ref, computed, onMounted, onUnmounted} from 'vue';
password.value = '';
}
}
onMounted(()=>{

onMounted(() => {
window.addEventListener('keydown', handleKeyDown);
})
});

onUnmounted(()=>{
onUnmounted(() => {
window.removeEventListener('keydown', handleKeyDown);
})

});
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-lock-page';
Expand Down
3 changes: 2 additions & 1 deletion jeecgboot-vue3/src/views/sys/login/Login.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- eslint-disable vue/multi-word-component-names -->
<template>
<div :class="prefixCls" class="relative w-full h-full px-4">
<AppLocalePicker class="absolute text-white top-4 right-4 enter-x xl:text-gray-600" :showText="false" v-if="!sessionTimeout && showLocale" />
Expand Down Expand Up @@ -49,7 +50,7 @@
import { useI18n } from '/@/hooks/web/useI18n';
import { useDesign } from '/@/hooks/web/useDesign';
import { useLocaleStore } from '/@/store/modules/locale';
import { useLoginState, LoginStateEnum } from './useLogin';
import { useLoginState } from './useLogin';
defineProps({
sessionTimeout: {
type: Boolean,
Expand Down
5 changes: 5 additions & 0 deletions jeecgboot-vue3/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ declare global {
[elem: string]: any;
}
}

interface Navigator {
// fix:msSaveBlob dose exist on type Navigator
msSaveBlob?: (blob: any, defaultName?: string) => boolean;
}
}

declare module 'vue' {
Expand Down