83 lines
1.7 KiB
Vue
83 lines
1.7 KiB
Vue
<script>
|
|
import {checkAuth, setupRouterInterceptor, getDefaultWhiteList} from './utils/routerInterceptor'
|
|
|
|
export default {
|
|
globalData: {
|
|
user: null
|
|
},
|
|
onLaunch: async function () {
|
|
console.log('App Launch')
|
|
// 检查访问页面是否需要登录(不走拦截器 直接从地址栏进入)
|
|
await checkAuth()
|
|
// 初始化路由拦截器
|
|
setupRouterInterceptor(getDefaultWhiteList())
|
|
},
|
|
onShow: function () {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function () {
|
|
console.log('App Hide')
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/*每个页面公共css */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
}
|
|
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
font-size: 14px;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
color: #333;
|
|
background-color: #f5f5f5;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.page-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
uni-page-body {
|
|
height: 100%;
|
|
}
|
|
|
|
/* 导航栏添加返回按钮文字 */
|
|
:deep(.uni-page-head-btn)::after{
|
|
content: "返回";
|
|
position: absolute;
|
|
left: 30px;
|
|
color: #000;
|
|
font-size: 16px;
|
|
line-height: 26px;
|
|
}
|
|
|
|
/* 隐藏所有页面的滚动条(包括 web 和 小程序) */
|
|
::-webkit-scrollbar {
|
|
display: none;
|
|
width: 0 !important;
|
|
height: 0 !important;
|
|
-webkit-appearance: none;
|
|
background: transparent;
|
|
}
|
|
|
|
/* 针对 H5 的额外设置 */
|
|
page, html, body {
|
|
scrollbar-width: none; /* Firefox */
|
|
-ms-overflow-style: none; /* IE 10+ */
|
|
}
|
|
|
|
</style>
|