Commit d6d11a65 authored by guxukai's avatar guxukai

chore: query-wrapper完善

parent cbb7678a
...@@ -72,6 +72,7 @@ const layoutStore = useLayout() ...@@ -72,6 +72,7 @@ const layoutStore = useLayout()
const $router = useRouter() const $router = useRouter()
const captchaUrl = ref(`${process.env.API_PREFIX}/api/kaptcha/kaptcha`) const captchaUrl = ref(`${process.env.API_PREFIX}/api/kaptcha/kaptcha`)
const authLoginForm = reactive(new AuthLoginPostReq({})) const authLoginForm = reactive(new AuthLoginPostReq({}))
authStore.$reset()
const rules: any = { const rules: any = {
username: { required: helpers.withMessage('用户名不能为空', required) }, username: { required: helpers.withMessage('用户名不能为空', required) },
password: { required: helpers.withMessage('密码不能为空', required) }, password: { required: helpers.withMessage('密码不能为空', required) },
......
...@@ -18,8 +18,7 @@ const { ...@@ -18,8 +18,7 @@ const {
loading: userLoading, loading: userLoading,
error: userError, error: userError,
run: userRun, run: userRun,
} = useRequest( } = useRequest(() =>
() =>
UserToken.get({ UserToken.get({
token: authStore.loginInfo.token, token: authStore.loginInfo.token,
}).then(res => { }).then(res => {
...@@ -43,6 +42,5 @@ const { ...@@ -43,6 +42,5 @@ const {
} }
return res return res
}), }),
{ manual: true },
) )
</script> </script>
...@@ -222,8 +222,6 @@ const { ...@@ -222,8 +222,6 @@ const {
const handleLogout = () => { const handleLogout = () => {
logoutRun().then(res => { logoutRun().then(res => {
if (res?.code === GATEWAY_CODE.success) { if (res?.code === GATEWAY_CODE.success) {
const authStore = useAuth()
authStore.$reset()
window.location.replace(window.location.origin + '/entry/login') window.location.replace(window.location.origin + '/entry/login')
} else { } else {
MessageUtils.warning(res?.message) 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