|
@ -27,7 +27,7 @@ import Open from '@/assets/img/login/open.png' |
|
|
import { useWebSocketStore, useUserStore } from '@/store' |
|
|
import { useWebSocketStore, useUserStore } from '@/store' |
|
|
import { ref, watch } from 'vue' |
|
|
import { ref, watch } from 'vue' |
|
|
import { useRouter } from 'vue-router' |
|
|
import { useRouter } from 'vue-router' |
|
|
import { loginJSON } from '@/mock/command' |
|
|
|
|
|
|
|
|
import { loginJSON, getAllUserJSON } from '@/mock/command' |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
handleShowKey: { |
|
|
handleShowKey: { |
|
@ -50,6 +50,10 @@ const props = defineProps({ |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: false, |
|
|
default: false, |
|
|
}, |
|
|
}, |
|
|
|
|
|
changeTab: { |
|
|
|
|
|
type: Function, |
|
|
|
|
|
default: () => {}, |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const activeInput = ref(1) |
|
|
const activeInput = ref(1) |
|
@ -92,7 +96,6 @@ const handleLogin = () => { |
|
|
tip.value = '' |
|
|
tip.value = '' |
|
|
webSocketStore?.sendCommandMsg(loginJSON(username.value, password.value)) |
|
|
webSocketStore?.sendCommandMsg(loginJSON(username.value, password.value)) |
|
|
// 前端自己校验 |
|
|
// 前端自己校验 |
|
|
console.log(userStore.allUserList) |
|
|
|
|
|
let flag = false |
|
|
let flag = false |
|
|
userStore.allUserList?.map(item => { |
|
|
userStore.allUserList?.map(item => { |
|
|
if (item.uid == username.value && password.value == item.passwd) { |
|
|
if (item.uid == username.value && password.value == item.passwd) { |
|
@ -101,10 +104,13 @@ const handleLogin = () => { |
|
|
userStore.updatePermission(item.permission_level) |
|
|
userStore.updatePermission(item.permission_level) |
|
|
userStore.updateLoginUser(item.uid) |
|
|
userStore.updateLoginUser(item.uid) |
|
|
if (props.modal) { |
|
|
if (props.modal) { |
|
|
|
|
|
props.changeTab(5) |
|
|
props.hideLoginModal() |
|
|
props.hideLoginModal() |
|
|
|
|
|
// 判断是否在消毒中,如果在消毒中,将TAB切换到设置 |
|
|
} else { |
|
|
} else { |
|
|
window.location.href = 'http://127.0.0.1/' |
|
|
window.location.href = 'http://127.0.0.1/' |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(props.modal) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (!flag) { |
|
|
if (!flag) { |
|
|