1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/dcloud-song-guessing-game-admin

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
App.vue 1.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
anne-lxm Отправлено 08.08.2022 15:20 86ee16e
<script>
import {
mapGetters,
mapActions
} from 'vuex'
import config from '@/admin.config.js'
import {
version
} from './package.json'
export default {
created() {
this.clear = undefined
},
computed: {
...mapGetters({
isTokenValid: 'user/isTokenValid'
})
},
methods: {
...mapActions({
init: 'app/init'
}),
clearPlatform() {
const keysOfPlatform = uni.getStorageInfoSync().keys.filter(key => key.indexOf('platform') > -1)
keysOfPlatform.length && keysOfPlatform.forEach(key => uni.removeStorageSync(key))
}
},
onPageNotFound(msg) {
uni.redirectTo({
url: config.error.url
})
},
onLaunch: function() {
// #ifdef H5
console.log(
`%c uni-admin %c v${version} `,
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;'
)
// #endif
// 线上示例使用
// console.log('%c uni-app官方团队诚邀优秀前端工程师加盟,一起打造更卓越的uni-app & uniCloud,欢迎投递简历到 hr2013@dcloud.io', 'color: red');
console.log('App Launch')
if (!this.isTokenValid) {
uni.redirectTo({
url: config.login.url
})
} else {
this.init()
}
},
onShow: function() {
console.log('App Show')
this.clear = setInterval(() => this.clearPlatform(), 15*60*1000)
},
onHide: function() {
console.log('App Hide')
this.clear && clearInterval(this.clear)
}
}
</script>
<style>
@import '@/common/uni.css';
@import '@/common/uni-icons.css';
@import '@/common/admin-icons.css';
</style>

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/dcloud-song-guessing-game-admin.git
git@api.gitlife.ru:oschina-mirror/dcloud-song-guessing-game-admin.git
oschina-mirror
dcloud-song-guessing-game-admin
dcloud-song-guessing-game-admin
master