23 lines
432 B
Vue
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>
|