登录页添加loading效果
This commit is contained in:
parent
4bf4aa13d7
commit
1f6e55a0dc
@ -48,6 +48,7 @@
|
||||
</q-card>
|
||||
</q-page>
|
||||
</q-page-container>
|
||||
<q-inner-loading :showing="visible" />
|
||||
</q-layout>
|
||||
</template>
|
||||
|
||||
@ -56,7 +57,7 @@ import { useQuasar } from 'quasar';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
import { login } from 'src/api/UserApi';
|
||||
import { clearJwtToken, saveJwtToken } from 'src/configs/TokenManage';
|
||||
import { reactive } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const $q = useQuasar();
|
||||
@ -69,6 +70,7 @@ const loginInfo = reactive({
|
||||
|
||||
async function doLogin() {
|
||||
try {
|
||||
visible.value = true;
|
||||
clearJwtToken();
|
||||
const token = await login(loginInfo);
|
||||
saveJwtToken(token);
|
||||
@ -81,6 +83,8 @@ async function doLogin() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const visible = ref(false);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user