fix build error

This commit is contained in:
AceDataCloud committed 2023-01-02 00:27:01 +08:00
1 parent 866331343c
commit 89461c8b1a
7 files changed
+29 -456

No files matched your search

+23 -20
View File
@@ -1,10 +1,11 @@
<template></template>
<template>
<div></div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElMessageBox } from 'element-plus';
import AuthService from '@/services/auth/service';
import { ITokenResponse } from '@/services/auth/types';
import { authOperator, ITokenResponse } from '@/operators';
export default defineComponent({
name: 'VerificationAlert',
@@ -16,6 +17,25 @@ export default defineComponent({
return this.$route.query.refresh;
}
},
async mounted() {
if (this.refresh) {
authOperator
.refreshToken({
refresh: this.$store.getters.refreshToken
})
.then(async ({ data: data }: { data: ITokenResponse }) => {
await this.$store.dispatch('setAccessToken', data.access);
await this.$store.dispatch('getMe');
this.$router.push({
...this.$route,
query: {}
});
this.checkAndShowVerificationAlert();
});
} else {
this.checkAndShowVerificationAlert();
}
},
methods: {
checkAndShowVerificationAlert() {
if (this.verified) {
@@ -37,23 +57,6 @@ export default defineComponent({
})
.catch(() => {});
}
},
async mounted() {
if (this.refresh) {
AuthService.refreshToken({
refresh: this.$store.getters.refreshToken
}).then(async ({ data: data }: { data: ITokenResponse }) => {
await this.$store.dispatch('setAccessToken', data.access);
await this.$store.dispatch('getMe');
this.$router.push({
...this.$route,
query: {}
});
this.checkAndShowVerificationAlert();
});
} else {
this.checkAndShowVerificationAlert();
}
}
});
</script>