App.vue 947 字节
<script>
	export default {
		onLaunch: function(e) {
			let that = this;
			// #ifdef MP-WEIXIN
			uni.login({
				provider: 'weixin',
				success(ret) {
					uni.$u.http.post('/wxUserLogin/isAdminCanLongin', {
						wxCode: ret.code
					}, {
						custom: {
							toast: false,
							catch: true
						}
					}).then((res) => {
						uni.setStorageSync('token', res.result.token || '')
						that.$isResolve()
					}).catch((res) => {
						let token = uni.getStorageSync('token') || '';
						if (token == '') {
							uni.reLaunch({
								url: '/pages/index/login'
							})
						}
						that.$isResolve()
					});
				}
			})
			// #endif
		},
		onShow: function() {

		},
		onHide: function() {

		},
		globalData: {

		}

	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import "@/common/demo.scss";
	page{
		background-color: #F7F8FA;
		height: 100%!important;
	}
</style>