优化H5刷新后页面跳转不正确问题(IC92FN)

This commit is contained in:
RuoYi
2025-06-12 11:21:13 +08:00
parent a0c493d05e
commit 60a4028047

View File

@@ -38,10 +38,12 @@
</view>
</template>
<script setup>
<script setup>
import { ref, getCurrentInstance } from "vue"
import { onLoad } from "@dcloudio/uni-app"
import { getToken } from '@/utils/auth'
import { getCodeImg } from '@/api/login'
import { useConfigStore, useUserStore } from '@/store'
import { ref, getCurrentInstance } from "vue"
const { proxy } = getCurrentInstance()
const globalConfig = useConfigStore().config
@@ -117,7 +119,15 @@
useUserStore().getInfo().then(res => {
proxy.$tab.reLaunch('/pages/index')
})
}
}
onLoad(() => {
//#ifdef H5
if (getToken()) {
proxy.$tab.reLaunch('/pages/index')
}
//#endif
})
getCode()
</script>