mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-02-02 18:08:40 +08:00
refactor(sys): change to setup syntax
This commit is contained in:
parent
66feb779a8
commit
bb89c5059c
@ -25,6 +25,7 @@ module.exports = defineConfig({
|
|||||||
'plugin:jest/recommended',
|
'plugin:jest/recommended',
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
'vue/script-setup-uses-vars': 'error',
|
||||||
'@typescript-eslint/ban-ts-ignore': 'off',
|
'@typescript-eslint/ban-ts-ignore': 'off',
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
@ -61,7 +62,6 @@ module.exports = defineConfig({
|
|||||||
'vue/singleline-html-element-content-newline': 'off',
|
'vue/singleline-html-element-content-newline': 'off',
|
||||||
'vue/attribute-hyphenation': 'off',
|
'vue/attribute-hyphenation': 'off',
|
||||||
'vue/require-default-prop': 'off',
|
'vue/require-default-prop': 'off',
|
||||||
'vue/script-setup-uses-vars': 'off',
|
|
||||||
'vue/html-self-closing': [
|
'vue/html-self-closing': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
|
13
src/App.vue
13
src/App.vue
@ -6,23 +6,14 @@
|
|||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import { ConfigProvider } from 'ant-design-vue';
|
import { ConfigProvider } from 'ant-design-vue';
|
||||||
import { AppProvider } from '/@/components/Application';
|
import { AppProvider } from '/@/components/Application';
|
||||||
import { useTitle } from '/@/hooks/web/useTitle';
|
import { useTitle } from '/@/hooks/web/useTitle';
|
||||||
import { useLocale } from '/@/locales/useLocale';
|
import { useLocale } from '/@/locales/useLocale';
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'App',
|
|
||||||
components: { ConfigProvider, AppProvider },
|
|
||||||
setup() {
|
|
||||||
useTitle();
|
|
||||||
|
|
||||||
// support Multi-language
|
// support Multi-language
|
||||||
const { getAntdLocale } = useLocale();
|
const { getAntdLocale } = useLocale();
|
||||||
|
|
||||||
return { getAntdLocale };
|
useTitle();
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<Button v-bind="getBindValue" :class="getButtonClass" @click="onClick">
|
<Button v-bind="getBindValue" :class="getButtonClass" @click="onClick">
|
||||||
<template #default="data">
|
<template #default>
|
||||||
<Icon :icon="preIcon" v-if="preIcon" :size="iconSize" />
|
<Icon :icon="preIcon" v-if="preIcon" :size="iconSize" />
|
||||||
<slot v-bind="data"></slot>
|
<slot></slot>
|
||||||
<Icon :icon="postIcon" v-if="postIcon" :size="iconSize" />
|
<Icon :icon="postIcon" v-if="postIcon" :size="iconSize" />
|
||||||
</template>
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -14,18 +14,13 @@
|
|||||||
<Description @register="registerDev" class="enter-y" />
|
<Description @register="registerDev" class="enter-y" />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
|
||||||
import { Tag } from 'ant-design-vue';
|
import { Tag } from 'ant-design-vue';
|
||||||
import { PageWrapper } from '/@/components/Page';
|
import { PageWrapper } from '/@/components/Page';
|
||||||
import { Description, DescItem, useDescription } from '/@/components/Description/index';
|
import { Description, DescItem, useDescription } from '/@/components/Description/index';
|
||||||
|
|
||||||
import { GITHUB_URL, SITE_URL, DOC_URL } from '/@/settings/siteSetting';
|
import { GITHUB_URL, SITE_URL, DOC_URL } from '/@/settings/siteSetting';
|
||||||
export default defineComponent({
|
|
||||||
name: 'AboutPage',
|
|
||||||
components: { Description, PageWrapper },
|
|
||||||
setup() {
|
|
||||||
const { pkg, lastBuildTime } = __APP_INFO__;
|
const { pkg, lastBuildTime } = __APP_INFO__;
|
||||||
|
|
||||||
const { dependencies, devDependencies, name, version } = pkg;
|
const { dependencies, devDependencies, name, version } = pkg;
|
||||||
@ -100,8 +95,4 @@
|
|||||||
schema: infoSchema,
|
schema: infoSchema,
|
||||||
column: 2,
|
column: 2,
|
||||||
});
|
});
|
||||||
|
|
||||||
return { register, registerDev, infoRegister, name, GITHUB_URL };
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,40 +3,26 @@
|
|||||||
<Description :data="info" @register="register" />
|
<Description :data="info" @register="register" />
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
import type { ErrorLogInfo } from '/#/store';
|
import type { ErrorLogInfo } from '/#/store';
|
||||||
|
import { defineProps } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import { BasicModal } from '/@/components/Modal/index';
|
import { BasicModal } from '/@/components/Modal/index';
|
||||||
import { Description, useDescription } from '/@/components/Description/index';
|
import { Description, useDescription } from '/@/components/Description/index';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
|
||||||
import { getDescSchema } from './data';
|
import { getDescSchema } from './data';
|
||||||
|
|
||||||
export default defineComponent({
|
defineProps({
|
||||||
name: 'ErrorLogDetailModal',
|
|
||||||
components: { BasicModal, Description },
|
|
||||||
props: {
|
|
||||||
info: {
|
info: {
|
||||||
type: Object as PropType<ErrorLogInfo>,
|
type: Object as PropType<ErrorLogInfo>,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const [register] = useDescription({
|
const [register] = useDescription({
|
||||||
column: 2,
|
column: 2,
|
||||||
schema: getDescSchema()!,
|
schema: getDescSchema()!,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
register,
|
|
||||||
useI18n,
|
|
||||||
t,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,30 +27,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import type { ErrorLogInfo } from '/#/store';
|
import type { ErrorLogInfo } from '/#/store';
|
||||||
|
import { watch, ref, nextTick } from 'vue';
|
||||||
import { defineComponent, watch, ref, nextTick } from 'vue';
|
|
||||||
|
|
||||||
import DetailModal from './DetailModal.vue';
|
import DetailModal from './DetailModal.vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table/index';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table/index';
|
||||||
|
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
|
||||||
import { useErrorLogStore } from '/@/store/modules/errorLog';
|
import { useErrorLogStore } from '/@/store/modules/errorLog';
|
||||||
|
|
||||||
import { fireErrorApi } from '/@/api/demo/error';
|
import { fireErrorApi } from '/@/api/demo/error';
|
||||||
|
|
||||||
import { getColumns } from './data';
|
import { getColumns } from './data';
|
||||||
|
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'ErrorHandler',
|
|
||||||
components: { DetailModal, BasicTable, TableAction },
|
|
||||||
setup() {
|
|
||||||
const rowInfo = ref<ErrorLogInfo>();
|
const rowInfo = ref<ErrorLogInfo>();
|
||||||
const imgList = ref<string[]>([]);
|
const imgList = ref<string[]>([]);
|
||||||
|
|
||||||
@ -100,18 +89,4 @@
|
|||||||
async function fireAjaxError() {
|
async function fireAjaxError() {
|
||||||
await fireErrorApi();
|
await fireErrorApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
register,
|
|
||||||
registerModal,
|
|
||||||
handleDetail,
|
|
||||||
fireVueError,
|
|
||||||
fireResourceError,
|
|
||||||
fireAjaxError,
|
|
||||||
imgList,
|
|
||||||
rowInfo,
|
|
||||||
t,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
|
||||||
import { Result, Button } from 'ant-design-vue';
|
import { Result, Button } from 'ant-design-vue';
|
||||||
import { defineComponent, ref, computed, unref } from 'vue';
|
import { defineComponent, ref, computed, unref } from 'vue';
|
||||||
|
|
||||||
import { ExceptionEnum } from '/@/enums/exceptionEnum';
|
import { ExceptionEnum } from '/@/enums/exceptionEnum';
|
||||||
|
|
||||||
import notDataSvg from '/@/assets/svg/no-data.svg';
|
import notDataSvg from '/@/assets/svg/no-data.svg';
|
||||||
import netWorkSvg from '/@/assets/svg/net-error.svg';
|
import netWorkSvg from '/@/assets/svg/net-error.svg';
|
||||||
|
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useGo, useRedo } from '/@/hooks/web/usePage';
|
import { useGo, useRedo } from '/@/hooks/web/usePage';
|
||||||
|
|
||||||
import { PageEnum } from '/@/enums/pageEnum';
|
import { PageEnum } from '/@/enums/pageEnum';
|
||||||
|
|
||||||
interface MapValue {
|
interface MapValue {
|
||||||
|
@ -10,24 +10,19 @@
|
|||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import type { CSSProperties } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
import { defineComponent, ref, unref, computed } from 'vue';
|
import { ref, unref, computed, defineProps } from 'vue';
|
||||||
import { Spin } from 'ant-design-vue';
|
import { Spin } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
|
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
|
||||||
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { useLayoutHeight } from '/@/layouts/default/content/useContentViewHeight';
|
import { useLayoutHeight } from '/@/layouts/default/content/useContentViewHeight';
|
||||||
|
|
||||||
export default defineComponent({
|
defineProps({
|
||||||
name: 'IFrame',
|
|
||||||
components: { Spin },
|
|
||||||
props: {
|
|
||||||
frameSrc: propTypes.string.def(''),
|
frameSrc: propTypes.string.def(''),
|
||||||
},
|
});
|
||||||
setup() {
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const topRef = ref(50);
|
const topRef = ref(50);
|
||||||
const heightRef = ref(window.innerHeight);
|
const heightRef = ref(window.innerHeight);
|
||||||
@ -59,17 +54,6 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
calcHeight();
|
calcHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
getWrapStyle,
|
|
||||||
loading,
|
|
||||||
frameRef,
|
|
||||||
prefixCls,
|
|
||||||
|
|
||||||
hideLoading,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@prefix-cls: ~'@{namespace}-iframe-page';
|
@prefix-cls: ~'@{namespace}-iframe-page';
|
||||||
|
@ -92,25 +92,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { Input } from 'ant-design-vue';
|
import { Input } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { useLockStore } from '/@/store/modules/lock';
|
import { useLockStore } from '/@/store/modules/lock';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
|
||||||
import { useNow } from './useNow';
|
import { useNow } from './useNow';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
|
||||||
import { LockOutlined } from '@ant-design/icons-vue';
|
import { LockOutlined } from '@ant-design/icons-vue';
|
||||||
import headerImg from '/@/assets/images/header.jpg';
|
import headerImg from '/@/assets/images/header.jpg';
|
||||||
|
|
||||||
export default defineComponent({
|
const InputPassword = Input.Password;
|
||||||
name: 'LockPage',
|
|
||||||
components: { LockOutlined, InputPassword: Input.Password },
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const errMsg = ref(false);
|
const errMsg = ref(false);
|
||||||
@ -120,7 +114,7 @@
|
|||||||
const lockStore = useLockStore();
|
const lockStore = useLockStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const { ...state } = useNow(true);
|
const { hour, month, minute, meridiem, year, day, week } = useNow(true);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@ -153,23 +147,6 @@
|
|||||||
function handleShowForm(show = false) {
|
function handleShowForm(show = false) {
|
||||||
showDate.value = show;
|
showDate.value = show;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
goLogin,
|
|
||||||
userinfo,
|
|
||||||
unLock,
|
|
||||||
errMsg,
|
|
||||||
loading,
|
|
||||||
t,
|
|
||||||
prefixCls,
|
|
||||||
showDate,
|
|
||||||
password,
|
|
||||||
handleShowForm,
|
|
||||||
headerImg,
|
|
||||||
...state,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@prefix-cls: ~'@{namespace}-lock-page';
|
@prefix-cls: ~'@{namespace}-lock-page';
|
||||||
|
@ -3,18 +3,11 @@
|
|||||||
<LockPage v-if="getIsLock" />
|
<LockPage v-if="getIsLock" />
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import LockPage from './LockPage.vue';
|
import LockPage from './LockPage.vue';
|
||||||
|
|
||||||
import { useLockStore } from '/@/store/modules/lock';
|
import { useLockStore } from '/@/store/modules/lock';
|
||||||
export default defineComponent({
|
|
||||||
name: 'Lock',
|
|
||||||
components: { LockPage },
|
|
||||||
setup() {
|
|
||||||
const lockStore = useLockStore();
|
const lockStore = useLockStore();
|
||||||
const getIsLock = computed(() => lockStore?.getLockInfo?.isLock ?? false);
|
const getIsLock = computed(() => lockStore?.getLockInfo?.isLock ?? false);
|
||||||
return { getIsLock };
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -32,27 +32,15 @@
|
|||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, reactive, ref, computed, unref } from 'vue';
|
import { reactive, ref, computed, unref } from 'vue';
|
||||||
|
|
||||||
import LoginFormTitle from './LoginFormTitle.vue';
|
import LoginFormTitle from './LoginFormTitle.vue';
|
||||||
import { Form, Input, Button } from 'ant-design-vue';
|
import { Form, Input, Button } from 'ant-design-vue';
|
||||||
import { CountdownInput } from '/@/components/CountDown';
|
import { CountdownInput } from '/@/components/CountDown';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useLoginState, useFormRules, LoginStateEnum } from './useLogin';
|
import { useLoginState, useFormRules, LoginStateEnum } from './useLogin';
|
||||||
|
|
||||||
export default defineComponent({
|
const FormItem = Form.Item;
|
||||||
name: 'ForgetPasswordForm',
|
|
||||||
components: {
|
|
||||||
Button,
|
|
||||||
Form,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Input,
|
|
||||||
CountdownInput,
|
|
||||||
LoginFormTitle,
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { handleBackLogin, getLoginState } = useLoginState();
|
const { handleBackLogin, getLoginState } = useLoginState();
|
||||||
const { getFormRules } = useFormRules();
|
const { getFormRules } = useFormRules();
|
||||||
@ -73,17 +61,4 @@
|
|||||||
if (!form) return;
|
if (!form) return;
|
||||||
await form.resetFields();
|
await form.resetFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
t,
|
|
||||||
formRef,
|
|
||||||
formData,
|
|
||||||
getFormRules,
|
|
||||||
handleReset,
|
|
||||||
loading,
|
|
||||||
handleBackLogin,
|
|
||||||
getShow,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -61,9 +61,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, computed } from 'vue';
|
import { computed, defineProps } from 'vue';
|
||||||
|
|
||||||
import { AppLogo } from '/@/components/Application';
|
import { AppLogo } from '/@/components/Application';
|
||||||
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
|
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
|
||||||
import LoginForm from './LoginForm.vue';
|
import LoginForm from './LoginForm.vue';
|
||||||
@ -71,43 +70,23 @@
|
|||||||
import RegisterForm from './RegisterForm.vue';
|
import RegisterForm from './RegisterForm.vue';
|
||||||
import MobileForm from './MobileForm.vue';
|
import MobileForm from './MobileForm.vue';
|
||||||
import QrCodeForm from './QrCodeForm.vue';
|
import QrCodeForm from './QrCodeForm.vue';
|
||||||
|
|
||||||
import { useGlobSetting } from '/@/hooks/setting';
|
import { useGlobSetting } from '/@/hooks/setting';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { useLocaleStore } from '/@/store/modules/locale';
|
import { useLocaleStore } from '/@/store/modules/locale';
|
||||||
|
|
||||||
export default defineComponent({
|
defineProps({
|
||||||
name: 'Login',
|
|
||||||
components: {
|
|
||||||
AppLogo,
|
|
||||||
LoginForm,
|
|
||||||
ForgetPasswordForm,
|
|
||||||
RegisterForm,
|
|
||||||
MobileForm,
|
|
||||||
QrCodeForm,
|
|
||||||
AppLocalePicker,
|
|
||||||
AppDarkModeToggle,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
sessionTimeout: {
|
sessionTimeout: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
setup() {
|
|
||||||
const globSetting = useGlobSetting();
|
const globSetting = useGlobSetting();
|
||||||
const { prefixCls } = useDesign('login');
|
const { prefixCls } = useDesign('login');
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const localeStore = useLocaleStore();
|
const localeStore = useLocaleStore();
|
||||||
|
const showLocale = localeStore.getShowPicker;
|
||||||
return {
|
const title = computed(() => globSetting?.title ?? '');
|
||||||
t,
|
|
||||||
prefixCls,
|
|
||||||
title: computed(() => globSetting?.title ?? ''),
|
|
||||||
showLocale: localeStore.getShowPicker,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@prefix-cls: ~'@{namespace}-login';
|
@prefix-cls: ~'@{namespace}-login';
|
||||||
|
@ -81,8 +81,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, reactive, ref, toRaw, unref, computed } from 'vue';
|
import { reactive, ref, toRaw, unref, computed } from 'vue';
|
||||||
|
|
||||||
import { Checkbox, Form, Input, Row, Col, Button, Divider } from 'ant-design-vue';
|
import { Checkbox, Form, Input, Row, Col, Button, Divider } from 'ant-design-vue';
|
||||||
import {
|
import {
|
||||||
@ -102,26 +102,10 @@
|
|||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
//import { onKeyStroke } from '@vueuse/core';
|
//import { onKeyStroke } from '@vueuse/core';
|
||||||
|
|
||||||
export default defineComponent({
|
const ACol = Col;
|
||||||
name: 'LoginForm',
|
const ARow = Row;
|
||||||
components: {
|
const FormItem = Form.Item;
|
||||||
[Col.name]: Col,
|
const InputPassword = Input.Password;
|
||||||
[Row.name]: Row,
|
|
||||||
Checkbox,
|
|
||||||
Button,
|
|
||||||
Form,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Input,
|
|
||||||
Divider,
|
|
||||||
LoginFormTitle,
|
|
||||||
InputPassword: Input.Password,
|
|
||||||
GithubFilled,
|
|
||||||
WechatFilled,
|
|
||||||
AlipayCircleFilled,
|
|
||||||
GoogleCircleFilled,
|
|
||||||
TwitterCircleFilled,
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notification, createErrorModal } = useMessage();
|
const { notification, createErrorModal } = useMessage();
|
||||||
const { prefixCls } = useDesign('login');
|
const { prefixCls } = useDesign('login');
|
||||||
@ -174,20 +158,4 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
t,
|
|
||||||
prefixCls,
|
|
||||||
formRef,
|
|
||||||
formData,
|
|
||||||
getFormRules,
|
|
||||||
rememberMe,
|
|
||||||
handleLogin,
|
|
||||||
loading,
|
|
||||||
setLoginState,
|
|
||||||
LoginStateEnum,
|
|
||||||
getShow,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,15 +3,11 @@
|
|||||||
{{ getFormTitle }}
|
{{ getFormTitle }}
|
||||||
</h2>
|
</h2>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, computed, unref } from 'vue';
|
import { computed, unref } from 'vue';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { LoginStateEnum, useLoginState } from './useLogin';
|
import { LoginStateEnum, useLoginState } from './useLogin';
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'LoginFormTitle',
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const { getLoginState } = useLoginState();
|
const { getLoginState } = useLoginState();
|
||||||
@ -26,10 +22,4 @@
|
|||||||
};
|
};
|
||||||
return titleObj[unref(getLoginState)];
|
return titleObj[unref(getLoginState)];
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
getFormTitle,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -30,27 +30,15 @@
|
|||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, reactive, ref, computed, unref } from 'vue';
|
import { reactive, ref, computed, unref } from 'vue';
|
||||||
|
|
||||||
import { Form, Input, Button } from 'ant-design-vue';
|
import { Form, Input, Button } from 'ant-design-vue';
|
||||||
import { CountdownInput } from '/@/components/CountDown';
|
import { CountdownInput } from '/@/components/CountDown';
|
||||||
import LoginFormTitle from './LoginFormTitle.vue';
|
import LoginFormTitle from './LoginFormTitle.vue';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useLoginState, useFormRules, useFormValid, LoginStateEnum } from './useLogin';
|
import { useLoginState, useFormRules, useFormValid, LoginStateEnum } from './useLogin';
|
||||||
|
|
||||||
export default defineComponent({
|
const FormItem = Form.Item;
|
||||||
name: 'MobileForm',
|
|
||||||
components: {
|
|
||||||
Button,
|
|
||||||
Form,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Input,
|
|
||||||
CountdownInput,
|
|
||||||
LoginFormTitle,
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { handleBackLogin, getLoginState } = useLoginState();
|
const { handleBackLogin, getLoginState } = useLoginState();
|
||||||
const { getFormRules } = useFormRules();
|
const { getFormRules } = useFormRules();
|
||||||
@ -72,17 +60,4 @@
|
|||||||
if (!data) return;
|
if (!data) return;
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
t,
|
|
||||||
formRef,
|
|
||||||
formData,
|
|
||||||
getFormRules,
|
|
||||||
handleLogin,
|
|
||||||
loading,
|
|
||||||
handleBackLogin,
|
|
||||||
getShow,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,37 +14,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, computed, unref } from 'vue';
|
import { computed, unref } from 'vue';
|
||||||
|
|
||||||
import LoginFormTitle from './LoginFormTitle.vue';
|
import LoginFormTitle from './LoginFormTitle.vue';
|
||||||
import { Button, Divider } from 'ant-design-vue';
|
import { Button, Divider } from 'ant-design-vue';
|
||||||
import { QrCode } from '/@/components/Qrcode/index';
|
import { QrCode } from '/@/components/Qrcode/index';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useLoginState, LoginStateEnum } from './useLogin';
|
import { useLoginState, LoginStateEnum } from './useLogin';
|
||||||
|
|
||||||
const qrCodeUrl = 'https://vvbin.cn/next/login';
|
const qrCodeUrl = 'https://vvbin.cn/next/login';
|
||||||
export default defineComponent({
|
|
||||||
name: 'QrCodeForm',
|
|
||||||
components: {
|
|
||||||
Button,
|
|
||||||
QrCode,
|
|
||||||
Divider,
|
|
||||||
LoginFormTitle,
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { handleBackLogin, getLoginState } = useLoginState();
|
const { handleBackLogin, getLoginState } = useLoginState();
|
||||||
|
|
||||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.QR_CODE);
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.QR_CODE);
|
||||||
|
|
||||||
return {
|
|
||||||
t,
|
|
||||||
handleBackLogin,
|
|
||||||
qrCodeUrl,
|
|
||||||
getShow,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -65,31 +65,17 @@
|
|||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, reactive, ref, unref, computed } from 'vue';
|
import { reactive, ref, unref, computed } from 'vue';
|
||||||
|
|
||||||
import LoginFormTitle from './LoginFormTitle.vue';
|
import LoginFormTitle from './LoginFormTitle.vue';
|
||||||
import { Form, Input, Button, Checkbox } from 'ant-design-vue';
|
import { Form, Input, Button, Checkbox } from 'ant-design-vue';
|
||||||
import { StrengthMeter } from '/@/components/StrengthMeter';
|
import { StrengthMeter } from '/@/components/StrengthMeter';
|
||||||
import { CountdownInput } from '/@/components/CountDown';
|
import { CountdownInput } from '/@/components/CountDown';
|
||||||
|
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useLoginState, useFormRules, useFormValid, LoginStateEnum } from './useLogin';
|
import { useLoginState, useFormRules, useFormValid, LoginStateEnum } from './useLogin';
|
||||||
|
|
||||||
export default defineComponent({
|
const FormItem = Form.Item;
|
||||||
name: 'RegisterPasswordForm',
|
const InputPassword = Input.Password;
|
||||||
components: {
|
|
||||||
Button,
|
|
||||||
Form,
|
|
||||||
FormItem: Form.Item,
|
|
||||||
Input,
|
|
||||||
InputPassword: Input.Password,
|
|
||||||
Checkbox,
|
|
||||||
StrengthMeter,
|
|
||||||
CountdownInput,
|
|
||||||
LoginFormTitle,
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { handleBackLogin, getLoginState } = useLoginState();
|
const { handleBackLogin, getLoginState } = useLoginState();
|
||||||
|
|
||||||
@ -115,17 +101,4 @@
|
|||||||
if (!data) return;
|
if (!data) return;
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
t,
|
|
||||||
formRef,
|
|
||||||
formData,
|
|
||||||
getFormRules,
|
|
||||||
handleRegister,
|
|
||||||
loading,
|
|
||||||
handleBackLogin,
|
|
||||||
getShow,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,19 +5,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, onBeforeUnmount, onMounted, ref } from 'vue';
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||||
import Login from './Login.vue';
|
import Login from './Login.vue';
|
||||||
|
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { usePermissionStore } from '/@/store/modules/permission';
|
import { usePermissionStore } from '/@/store/modules/permission';
|
||||||
import { useAppStore } from '/@/store/modules/app';
|
import { useAppStore } from '/@/store/modules/app';
|
||||||
import { PermissionModeEnum } from '/@/enums/appEnum';
|
import { PermissionModeEnum } from '/@/enums/appEnum';
|
||||||
export default defineComponent({
|
|
||||||
name: 'SessionTimeoutLogin',
|
|
||||||
components: { Login },
|
|
||||||
setup() {
|
|
||||||
const { prefixCls } = useDesign('st-login');
|
const { prefixCls } = useDesign('st-login');
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const permissionStore = usePermissionStore();
|
const permissionStore = usePermissionStore();
|
||||||
@ -43,10 +39,6 @@
|
|||||||
document.location.reload();
|
document.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return { prefixCls };
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@prefix-cls: ~'@{namespace}-st-login';
|
@prefix-cls: ~'@{namespace}-st-login';
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div></div>
|
<div></div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, unref } from 'vue';
|
import { unref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'Redirect',
|
|
||||||
setup() {
|
|
||||||
const { currentRoute, replace } = useRouter();
|
const { currentRoute, replace } = useRouter();
|
||||||
|
|
||||||
const { params, query } = unref(currentRoute);
|
const { params, query } = unref(currentRoute);
|
||||||
@ -19,8 +16,4 @@
|
|||||||
path: '/' + _path,
|
path: '/' + _path,
|
||||||
query,
|
query,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user