修改BUG
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useUI } from '@/utils/use-ui'
|
||||
import { reLaunch, navigateTo } from '@/utils/router'
|
||||
import { userLogin } from '@/api'
|
||||
import { userLogin, getIpBlack } from '@/api'
|
||||
import { useTokenStore } from '@/stores/token'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const { showToast } = useUI()
|
||||
const { showToast, showDialog } = useUI()
|
||||
const { setToken } = useTokenStore()
|
||||
const { fetchUserInfo } = useUserStore()
|
||||
|
||||
@@ -22,13 +22,18 @@
|
||||
showToast('请同意协议')
|
||||
return
|
||||
}
|
||||
const res = await userLogin({
|
||||
account: formData.username,
|
||||
password: formData.password
|
||||
})
|
||||
setToken(res.token)
|
||||
await fetchUserInfo()
|
||||
reLaunch('/TUIKit/components/TUIConversation/index')
|
||||
const show = await getIpBlack()
|
||||
if (show.data.data) {
|
||||
const res = await userLogin({
|
||||
account: formData.username,
|
||||
password: formData.password
|
||||
})
|
||||
setToken(res.token)
|
||||
await fetchUserInfo()
|
||||
reLaunch('/TUIKit/components/TUIConversation/index')
|
||||
} else {
|
||||
showDialog('提示', '当前账号或者IP已被限制登录!', false)
|
||||
}
|
||||
}
|
||||
|
||||
const onRegister = () => {
|
||||
|
||||
Reference in New Issue
Block a user