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