|
@@ -5,14 +5,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { onMounted } from 'vue';
|
|
|
-import { setStorage, storageKey } from '../static/utils/storage'
|
|
|
+import { onMounted, nextTick } from 'vue';
|
|
|
+import { setStorage, getStorage, storageKey } from '../static/utils/storage'
|
|
|
|
|
|
const close = () => {
|
|
|
window.close()
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
+const setParams = () => {
|
|
|
let url = new URL(window.location.href);
|
|
|
let search = url.search;
|
|
|
let urlParams = new URLSearchParams(search);
|
|
@@ -20,12 +20,27 @@ onMounted(() => {
|
|
|
// set
|
|
|
if (verifier) {
|
|
|
setStorage(storageKey.verifier, verifier)
|
|
|
- // @ts-ignore
|
|
|
- let time = process.env.NODE_ENV === 'production' ? 500 : 500;
|
|
|
+ let val = getStorage(storageKey.verifier)
|
|
|
+ if (val) {
|
|
|
+ setTimeout(() => {
|
|
|
+ close()
|
|
|
+ }, 500)
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ setParams()
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
setTimeout(() => {
|
|
|
- close()
|
|
|
- }, time)
|
|
|
+ setParams()
|
|
|
+ }, 500)
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ setParams()
|
|
|
+ })
|
|
|
})
|
|
|
</script>
|
|
|
|