优化登录按钮交互
This commit is contained in:
@@ -54,6 +54,12 @@ other.elSvg(app);
|
||||
|
||||
|
||||
app.use(VXETable)
|
||||
app.use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t }).use(i18n).use(VueGridLayout).use(fastCrud).mount('#app');
|
||||
app.use(pinia)
|
||||
.use(router)
|
||||
.use(ElementPlus, { i18n: i18n.global.t })
|
||||
.use(i18n)
|
||||
.use(VueGridLayout)
|
||||
.use(fastCrud)
|
||||
.mount('#app');
|
||||
|
||||
app.config.globalProperties.mittBus = mitt();
|
||||
|
||||
@@ -9,7 +9,7 @@ import {getBaseURL} from '/@/utils/baseUrl';
|
||||
import ui from '@fast-crud/ui-element';
|
||||
import {request} from '/@/utils/service';
|
||||
//扩展包
|
||||
import {FsExtendsEditor, FsExtendsUploader,FsCropperUploader} from '@fast-crud/fast-extends';
|
||||
import {FsExtendsEditor, FsExtendsUploader } from '@fast-crud/fast-extends';
|
||||
import '@fast-crud/fast-extends/dist/style.css';
|
||||
import {successNotification} from '/@/utils/message';
|
||||
import XEUtils from "xe-utils";
|
||||
@@ -75,6 +75,7 @@ export default {
|
||||
}, */
|
||||
};
|
||||
},
|
||||
logger: { off: { tableColumns: false } }
|
||||
});
|
||||
//富文本
|
||||
app.use(FsExtendsEditor, {
|
||||
@@ -89,7 +90,7 @@ export default {
|
||||
action: `/api/system/file/`,
|
||||
name: "file",
|
||||
withCredentials: false,
|
||||
uploadRequest: async ({action, file, onProgress}) => {
|
||||
uploadRequest: async ({ action, file, onProgress }: { action: string; file: any; onProgress: Function }) => {
|
||||
// @ts-ignore
|
||||
const data = new FormData();
|
||||
data.append("file", file);
|
||||
@@ -101,12 +102,12 @@ export default {
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
data,
|
||||
onUploadProgress: (p) => {
|
||||
onUploadProgress: (p: any) => {
|
||||
onProgress({percent: Math.round((p.loaded / p.total) * 100)});
|
||||
}
|
||||
});
|
||||
},
|
||||
successHandle(ret) {
|
||||
successHandle(ret: any) {
|
||||
// 上传完成后的结果处理, 此处应返回格式为{url:xxx,key:xxx}
|
||||
return {
|
||||
url: getBaseURL(ret.data.url),
|
||||
@@ -115,8 +116,8 @@ export default {
|
||||
};
|
||||
}
|
||||
},
|
||||
valueBuilder(context){
|
||||
const {row,key} = context
|
||||
valueBuilder(context: any){
|
||||
const { row, key } = context
|
||||
return getBaseURL(row[key])
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-form ref="formRef" size="large" class="login-content-form" :model="state.ruleForm" :rules="rules">
|
||||
<el-form ref="formRef" size="large" class="login-content-form" :model="state.ruleForm" :rules="rules" @keyup.enter="loginClick">
|
||||
<el-form-item class="login-animation1" prop="username">
|
||||
<el-input type="text" :placeholder="$t('message.account.accountPlaceholder1')" v-model="ruleForm.username"
|
||||
clearable autocomplete="off">
|
||||
@@ -39,7 +39,7 @@
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item class="login-animation4">
|
||||
<el-button type="primary" class="login-content-submit" round @keyup.enter="loginClick" @click="loginClick"
|
||||
<el-button type="primary" class="login-content-submit" round @click="loginClick"
|
||||
:loading="loading.signIn">
|
||||
<span>{{ $t('message.account.accountBtnText') }}</span>
|
||||
</el-button>
|
||||
@@ -126,7 +126,7 @@ export default defineComponent({
|
||||
});
|
||||
};
|
||||
const refreshCaptcha = async () => {
|
||||
state.ruleForm.captcha=''
|
||||
state.ruleForm.captcha=''
|
||||
loginApi.getCaptcha().then((ret: any) => {
|
||||
state.ruleForm.captchaImgBase = ret.data.image_base;
|
||||
state.ruleForm.captchaKey = ret.data.key;
|
||||
@@ -153,9 +153,9 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
}).catch((err: any) => {
|
||||
// 登录错误之后,刷新验证码
|
||||
refreshCaptcha();
|
||||
});
|
||||
// 登录错误之后,刷新验证码
|
||||
refreshCaptcha();
|
||||
});
|
||||
} else {
|
||||
errorMessage("请填写登录信息")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user