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 c18d272413
commit 69cb479e01
11 changed files with 33 additions and 19 deletions

View File

@@ -349,7 +349,6 @@ onMounted(() => {
onUnmounted(() => {
if (socket.value !== null) {
socket.value.close()
socket.value = null
}
})
@@ -518,9 +517,9 @@ const loadChat = function (chat) {
modelID.value = chat.model_id;
chatId.value = chat.chat_id;
showStopGenerate.value = false;
router.push(`/chat/${chatId.value}`)
loadHistory.value = true
socket.value.close()
connect()
router.replace(`/chat/${chatId.value}`)
}
// 编辑会话标题
@@ -757,7 +756,7 @@ const sendMessage = function () {
if (files.value.length === 1) {
content += files.value.map(file => file.url).join(" ")
} else if (files.value.length > 1) {
showMessageError("当前只支持一个文件!")
showMessageError("当前只支持上传一个文件!")
return false
}
// 追加消息

View File

@@ -76,7 +76,6 @@ import {setUserToken} from "@/store/session";
import ResetPass from "@/components/ResetPass.vue";
import {showMessageError} from "@/utils/dialog";
import Captcha from "@/components/Captcha.vue";
import QRCode from "qrcode";
import {setRoute} from "@/store/system";
const router = useRouter();
@@ -89,6 +88,8 @@ const licenseConfig = ref({})
const wechatLoginURL = ref('')
const enableVerify = ref(false)
const captchaRef = ref(null)
// 是否需要验证码,输入一次密码错之后就要验证码
const needVerify = ref(false)
onMounted(() => {
// 获取系统配置
@@ -137,7 +138,7 @@ const login = function () {
return showMessageError('请输入密码');
}
if (enableVerify.value) {
if (enableVerify.value && needVerify.value) {
captchaRef.value.loadCaptcha()
} else {
doLogin({})
@@ -153,6 +154,7 @@ const doLogin = (verifyData) => {
x: verifyData.x
}).then((res) => {
setUserToken(res.data.token)
needVerify.value = false
if (isMobile()) {
router.push('/mobile')
} else {
@@ -161,6 +163,7 @@ const doLogin = (verifyData) => {
}).catch((e) => {
showMessageError('登录失败,' + e.message)
needVerify.value = true
})
}
</script>

View File

@@ -610,7 +610,7 @@ const publishJob = (item) => {
}
const getShareURL = (item) => {
return `${location.protocol}//${location.host}/song/${item.id}`
return `${location.protocol}//${location.host}/song/${item.song_id}`
}
const uploadCover = (file) => {