feat: 完成对接
This commit is contained in:
+22
-6
@@ -1,21 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
|
||||
import { onLaunch, onHide } from '@dcloudio/uni-app'
|
||||
import { useUserStore } from './store'
|
||||
import { checkWithRedirectLogin, loginRoute } from './interceptors/route'
|
||||
|
||||
onLaunch(() => {
|
||||
uni.showModal({ title: '提示', content: 'App Launch' })
|
||||
console.log('App Launch')
|
||||
onLaunch((options) => {
|
||||
if (checkWithRedirectLogin(options.path)) {
|
||||
uni.reLaunch({
|
||||
url: loginRoute,
|
||||
// query: {
|
||||
// redirect: options.path,
|
||||
// },
|
||||
})
|
||||
}
|
||||
})
|
||||
onShow(() => {
|
||||
console.log('App Show')
|
||||
|
||||
onPageNotFound(() => {
|
||||
console.log(1)
|
||||
uni.reLaunch({
|
||||
url: '/',
|
||||
})
|
||||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('App Hide')
|
||||
})
|
||||
|
||||
const userStore = useUserStore()
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 覆盖 uniapp 自带rpx效果 */
|
||||
html {
|
||||
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
/* stylelint-disable-next-line selector-type-no-unknown */
|
||||
|
||||
Reference in New Issue
Block a user