54 lines
951 B
Vue
54 lines
951 B
Vue
<script setup>
|
|
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
|
|
import { getEvnUrl } from "@/request/base/config";
|
|
import { refreshToken } from "@/hooks/useGoLogin";
|
|
import { getAccessToken } from "@/constant/token";
|
|
|
|
onLaunch(async () => {
|
|
/// 获取环境配置
|
|
await getEvnUrl();
|
|
|
|
/// 获取token
|
|
const token = getAccessToken();
|
|
|
|
if (token) {
|
|
/// 刷新token
|
|
refreshToken();
|
|
}
|
|
});
|
|
|
|
onShow(() => {
|
|
console.log("App Show");
|
|
});
|
|
|
|
onHide(() => {
|
|
console.log("App Hide");
|
|
});
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import "@/static/fonts/iconfont.css";
|
|
@import "@/static/scss/index.scss";
|
|
|
|
/* 添加全局样式 */
|
|
page,
|
|
body,
|
|
#app {
|
|
font-family: PingFang SC, PingFang SC;
|
|
background-color: #f5f7fa;
|
|
height: 100vh;
|
|
width: 100vw;
|
|
}
|
|
|
|
/*每个页面公共css */
|
|
::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
@font-face {
|
|
font-family: znicons;
|
|
src: url("https://oss.nianxx.cn/mp/static/fonts/znicons.ttf");
|
|
}
|
|
</style>
|