1 Star 1 Fork 5

xingfaup/uni-book小说

forked from 加菲猫/uni-book小说 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.vue 2.63 KB
一键复制 编辑 原始数据 按行查看 历史
一个飘逸白 提交于 2024-03-10 00:25 . plugins
<script>
import utils from '@/static/js/utils.js'
import store from '@/static/js/store.js'
export default {
onLaunch: function() {
console.log('App Launch')
// 获取 token
const tokenVo = store.getters.tokenVo
const isLogin = store.getters.isLogin
if (isLogin) {
console.log("登录状态保持中")
utils.http.get("/user/profile").then(res => {
if (res.status == 200) {
// utils.globalData.setUserInfo(res.data)
store.commit('SET_USER_INFO', res.data)
}
})
// 1个小时执行一次判断
setInterval(() => {
let time = store.getters.expireTime
console.log("登录状态检查", time)
if (time - new Date().getTime() < 60 * 1000 * 60 * 24) {
utils.http.get("/login/changeToken").then(res => {
if (res.status == 200) {
store.commit("REFRESH_TOKEN", res.data)
}
})
}
}, 3 * 1000 * 60)
} else {
console.log("未登录")
}
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
@import "uview-ui/theme.scss";
@import "@/static/iconfont.css";
@import "@/static/css/app.scss";
/*每个页面公共css */
page {
height: 100%;
min-height: 100%;
}
.light {
}
.dark {
background-color: #111 !important;
color: #ccc !important;
border-color: #999 !important;
// opacity: 0.8;
}
.flex {
display: flex;
}
.flex-col {
flex-direction: column;
}
.flex-row {
flex-direction: row;
}
.justify-center {
justify-content: center;
}
.justify-space-between {
justify-content: space-between;
}
.justify-space-around {
justify-content: space-around;
}
.align-center {
align-items: center;
}
.flex-wrap {
flex-wrap: wrap;
}
.flex-1 {
flex: 1;
}
.flex-2 {
flex: 2;
}
.flex-3 {
flex: 3;
}
.flex-direction-column {
flex-direction: column;
}
.flex-direction-row {
flex-direction: row;
}
.margin-10 {
margin: 10px 10px;
}
.margin-15 {
margin: 15px 15px;
}
.margin-20 {
margin: 20px 20px;
}
.margin-10 {
margin: 10px 10px;
}
.margin-15 {
margin: 15px 15px;
}
.margin-top-10 {
margin-top: 10px;
}
.padding-20 {
padding: 20px 20px;
}
.padding-15 {
padding: 15px 15px;
}
.padding-10 {
padding: 10px 10px;
}
.width-100 {
width: 100%;
}
.width-90 {
width: 90%;
}
.width-95 {
width: 95%;
}
.width-85 {
width: 85%;
}
.width-80 {
width: 80%;
}
.w80 {
width: 80%;
}
.w90 {
width: 90%;
}
.h100 {
height: 100%;
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xingfaup/uni-book.git
git@gitee.com:xingfaup/uni-book.git
xingfaup
uni-book
uni-book小说
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385