dev
This commit is contained in:
parent
937b597a2e
commit
fce0559691
|
|
@ -42,20 +42,21 @@ const handleLogin = async () => {
|
||||||
const loginCore=async ()=>{
|
const loginCore=async ()=>{
|
||||||
let token:any=await post(apiConfig.ManagerUserLogin, {username: username.value, password: password.value},{catch_error: true})
|
let token:any=await post(apiConfig.ManagerUserLogin, {username: username.value, password: password.value},{catch_error: true})
|
||||||
localStorage.setItem('token', token)
|
localStorage.setItem('token', token)
|
||||||
|
try{
|
||||||
await post(apiConfig.signIn, {mac: netWork.value.mac, ip: netWork.value.ip}, {catch_error: true})
|
await post(apiConfig.signIn, {mac: netWork.value.mac, ip: netWork.value.ip}, {catch_error: true})
|
||||||
|
}catch (e){
|
||||||
|
ElMessage.warning("签到失败,将以非签到状态访问本系统")
|
||||||
|
}finally {
|
||||||
success()
|
success()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const success = () => {
|
const success = () => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
ElMessageBox.alert('登录成功且签到,即将为您进入到首页', '签到提示', {
|
|
||||||
type:'success',
|
|
||||||
showClose: false,
|
|
||||||
callback: (action: Action) => {
|
|
||||||
router.push("/home/index")
|
router.push("/home/index")
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const error = (message:any) => {
|
const error = (message:any) => {
|
||||||
ElMessageBox.alert(message)
|
ElMessageBox.alert(message)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue