f
This commit is contained in:
22
src/App.vue
Normal file
22
src/App.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user