fixed bug, filelist page support pagination, do not load captcha component for user login first time

This commit is contained in:
RockYang
2024-09-13 17:03:05 +08:00
parent 5c77e67b0f
commit 6c7fa17e50
11 changed files with 33 additions and 19 deletions

View File

@@ -143,7 +143,7 @@ onMounted(() => {
const links = props.data.content.match(linkRegex);
if (links) {
httpPost("/api/upload/list", {urls: links}).then(res => {
files.value = res.data
files.value = res.data.items
for (let link of links) {
if (isExternalImg(link, files.value)) {

View File

@@ -60,6 +60,7 @@ const removeFile = (file) => {
display flex
flex-flow row
margin-right 10px
max-width 600px
position relative
.el-image {

View File

@@ -68,7 +68,7 @@ const fileList = ref([])
const fetchFiles = () => {
show.value = true
httpPost("/api/upload/list").then(res => {
fileList.value = res.data
fileList.value = res.data.items
}).catch(() => {
})
}

View File

@@ -263,8 +263,8 @@ watch(() => props.show, (newValue) => {
const login = ref(true)
const data = ref({
username: "",
password: "",
username: process.env.VUE_APP_USER,
password: process.env.VUE_APP_PASS,
mobile: "",
email: "",
repass: "",
@@ -285,6 +285,8 @@ const action = ref("login")
const enableVerify = ref(false)
const showResetPass = ref(false)
const router = useRouter()
// 是否需要验证码,输入一次密码错之后就要验证码
const needVerify = ref(false)
onMounted(() => {
const returnURL = `${location.protocol}//${location.host}/login/callback?action=login`
@@ -338,7 +340,7 @@ const submitLogin = () => {
if (data.value.password === '') {
return ElMessage.error('请输入密码');
}
if (enableVerify.value) {
if (enableVerify.value && needVerify.value) {
captchaRef.value.loadCaptcha()
action.value = "login"
} else {
@@ -355,8 +357,10 @@ const doLogin = (verifyData) => {
ElMessage.success("登录成功!")
emits("hide")
emits('success')
needVerify.value = false
}).catch((e) => {
ElMessage.error('登录失败,' + e.message)
needVerify.value = true
})
}