Commit d6d11a65 authored by guxukai's avatar guxukai

chore: query-wrapper完善

parent cbb7678a
......@@ -72,6 +72,7 @@ const layoutStore = useLayout()
const $router = useRouter()
const captchaUrl = ref(`${process.env.API_PREFIX}/api/kaptcha/kaptcha`)
const authLoginForm = reactive(new AuthLoginPostReq({}))
authStore.$reset()
const rules: any = {
username: { required: helpers.withMessage('用户名不能为空', required) },
password: { required: helpers.withMessage('密码不能为空', required) },
......
......@@ -18,31 +18,29 @@ const {
loading: userLoading,
error: userError,
run: userRun,
} = useRequest(
() =>
UserToken.get({
token: authStore.loginInfo.token,
}).then(res => {
if (res.code === GATEWAY_CODE.success) {
userStore.$patch({ userInfo: res.data })
//超管跳转
if (authStore.loginInfo.id === 10000000) {
authStore.$patch({
consoleInfo: {
consoleName: '超管',
consoleObjectId: '1',
consoleTypeId: '1',
},
})
window.location.replace(`${origin}/super/proxy`)
return
}
//其余跳转
authStore.$reset()
window.location.replace(`${origin}/account/proxy`)
} = useRequest(() =>
UserToken.get({
token: authStore.loginInfo.token,
}).then(res => {
if (res.code === GATEWAY_CODE.success) {
userStore.$patch({ userInfo: res.data })
//超管跳转
if (authStore.loginInfo.id === 10000000) {
authStore.$patch({
consoleInfo: {
consoleName: '超管',
consoleObjectId: '1',
consoleTypeId: '1',
},
})
window.location.replace(`${origin}/super/proxy`)
return
}
return res
}),
{ manual: true },
//其余跳转
authStore.$reset()
window.location.replace(`${origin}/account/proxy`)
}
return res
}),
)
</script>
......@@ -222,8 +222,6 @@ const {
const handleLogout = () => {
logoutRun().then(res => {
if (res?.code === GATEWAY_CODE.success) {
const authStore = useAuth()
authStore.$reset()
window.location.replace(window.location.origin + '/entry/login')
} else {
MessageUtils.warning(res?.message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment