You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<script>
|
|
|
|
import {config} from "./common/config";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
onLaunch: function() {
|
|
|
|
console.info('App Launch,检测服务端'+config.server+'配置')
|
|
|
|
let url=config.server+'/api/test.php'
|
|
|
|
console.info('服务端测试接口:'+url)
|
|
|
|
uni.showLoading({
|
|
|
|
title:"检测服务端中"
|
|
|
|
})
|
|
|
|
let test=false
|
|
|
|
uni.request({
|
|
|
|
url:url,
|
|
|
|
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>
|