代码拉取完成,页面将自动刷新
import Vue from 'vue'
import App from './App'
// 导入仓库实例对象
import store from './store/store'
// 导入请求库
import { $http } from '@escook/request-miniprogram'
// 配置请求根路径
// #ifdef H5 || APP-PLUS
$http.baseUrl = '/api'
// #endif
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO
$http.baseUrl = 'https://www.uinav.com'
// #endif
// 配置请求之前做的事情(请求拦截器的味道)
$http.beforeRequest = function(){
uni.showLoading({
title: '数据加载中...',
})
}
// 配置请求之后做的事情(响应拦截器的味道)
$http.afterRequest = function () {
uni.hideLoading()
}
// uni 是uni-app项目的顶层对象,我们可以将一些全局要用的东西直接挂载到这个上面来
uni.$http = $http
// 封装一个提示框方法
uni.$showMsg = function(title='数据加载失败!',duration=1500){
uni.showToast({
title,
duration,
icon:'none'
})
}
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App,
store
})
app.$mount()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。