Files
tyc-uniapp_V2/src/App.vue
2026-05-21 14:51:06 +08:00

23 lines
432 B
Vue

<script setup>
import { onLaunch } from '@dcloudio/uni-app'
// #ifdef MP-WEIXIN
import { hasToken } from '@/utils/session'
import { tryWxMiniProgramAuth } from '@/utils/wxMiniAuth'
// #endif
onLaunch(async () => {
// #ifdef MP-WEIXIN
if (hasToken())
return
try {
await tryWxMiniProgramAuth({ silent: true })
}
catch (e) {
console.warn('[app] wx silent login', e)
}
// #endif
})
</script>
<style></style>