Skip to content

Commit

Permalink
Fix: validate
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyCreeper committed Oct 15, 2023
1 parent fa5a754 commit b544f44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/views/CreateRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const formData = ref({
const savePwd = ref(false);
const operateRoom = async () => {
if (formData.value?.username === "" || formData.value?.roomId === "") {
if (
formData.value?.username === "" ||
formData.value?.userPassword === "" ||
formData.value?.roomId === ""
) {
ElNotification({
title: "错误",
message: "请填写表单完整",
Expand Down
6 changes: 5 additions & 1 deletion src/views/JoinRoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ const savePwd = ref(localStorage.getItem("uPasswd") ? true : false);
const { state: joinRoomToken, execute: reqJoinRoomApi } = joinRoomApi();
const JoinRoom = async () => {
if (formData.value?.username === "" || formData.value?.roomId === "") {
if (
formData.value?.username === "" ||
formData.value?.userPassword === "" ||
formData.value?.roomId === ""
) {
ElNotification({
title: "错误",
message: "请填写表单完整",
Expand Down

0 comments on commit b544f44

Please sign in to comment.