<script>
import { ref, getCurrentInstance } from 'vue'
export default {
	onLaunch: function () {
		const { $Http } = getCurrentInstance().proxy;
		if (uni.getStorageSync('userMsg').token) {
			$Http.basic({
				"classname": "webmanage.site.site",
				"method": "querySite_Parameter", //查询站点数据
				content: {
					nocache: true
				}
			}).then(res => {
				if (res.code == 1) {
					uni.removeStorageSync('siteP');
					uni.setStorageSync("siteP", res.data)
					try {
						let currentPages = getCurrentPages().pop();
						if (currentPages.route == 'pages/login/login' || currentPages.$page.fullPath == "/pages/login/login") uni.redirectTo({
							url: '/pages/index/index',
						});
					} catch (error) {
						uni.redirectTo({
							url: '/pages/index/index',
						});
					}
				}
			})
		}
	},
	onShow: function () {
		try {
			const { $Http } = getCurrentInstance().proxy;
			$Http.uploadNumber && $Http.uploadNumber();
		} catch (error) {

		}
	},
	onHide: function () {
	}
}
</script>

<style lang="scss">
/* 注意要写在第一行，注意不能引入至uni.scss，同时给style标签加入lang="scss"属性 */
@import "@/uni_modules/uview-plus/index.scss";
@import '/static/iconfont.css';

page {
	background-color: #F7F7FF;
}
</style>