feat: websocket 调试

This commit is contained in:
2026-01-14 23:35:54 +08:00
parent ba7861f04b
commit 9b4ee536c7
3 changed files with 24 additions and 10 deletions

View File

@@ -87,10 +87,21 @@
</template>
<script setup lang="ts">
import { useUserStore } from "@renderer/store/userinfo"
import { reactive, ref, onMounted } from "vue"
import { useUserStore } from "../../../renderer/store/userinfo"
import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue'
import { generateUUID } from "@utils/generateUUID"
import { rule } from '@utils/validate'
import { generateUUID } from "../../../renderer/utils/generateUUID"
import { rule } from '../../../renderer/utils/validate'
// form 表单数据类型声明
interface LoginForm {
username: string;
password: string;
randomStr: string;
code: string;
grant_type: string;
scope: string;
}
const userStore = useUserStore()
const form = reactive<LoginForm>({ username: "", password: "", randomStr: '', code: "", grant_type: '', scope: '' });
@@ -106,10 +117,12 @@ const rules = reactive({
//获取验证码图片
const { VITE_SERVICE_URL } = (import.meta as any).env
const getVerifyCode = async () => {
form.randomStr = generateUUID()
imgSrc.value = `${VITE_SERVICE_URL}/auth/code/image?randomStr=${form.randomStr}`
const url = `${VITE_SERVICE_URL}/auth/code/image?randomStr=${form.randomStr}`
console.log('验证码地址', url)
imgSrc.value = url
}
onMounted(() => getVerifyCode())