<script>
    import {config} from "./common/config";

    export default {
		onLaunch: function() {
			console.log('App Launch')
            uni.showLoading({
                title:"检测服务端中"
            })
            let test=false
            uni.request({
                url:config.server+'/api/test.php',
                success:function (res) {
                    console.info(res)
                    if(res.data==="ok"){
                        uni.showToast({
                            title:"连接服务端成功"
                        })
                    }
                },fail:function (res) {
                    console.error(res)
                    uni.showModal({
                        title:"错误提示",
                        content:"服务端连接失败，请检查服务端地址"+config.server+"是否正确",
                        showCancel:false,
                        success:function (res) {
                            if(res.confirm){

                            }
                        }
                    })
                },
                complete:function () {
                    uni.hideLoading()
                    test=true
                }

            })


		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */

    /* #ifndef APP-PLUS-NVUE */
    /* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
    @import './common/uni.css';
    @import '../node_modules/mpvue-weui/src/style/weui.css';
</style>
