代码拉取完成,页面将自动刷新
import Vue from 'vue'
import App from './App'
import store from '@/store/store.js'
// 导入网络请求的包
import {$http} from "@escook/request-miniprogram"
// 挂载
uni.$http = $http
// 根路径
$http.baseUrl ='https://api-hmugo-web.itheima.net'
// 请求开始之前做一些事情
// 请求拦截器
$http.beforeRequest = function (options) {
uni.showLoading({
title: '数据加载中...',
})
}
// 请求完成之后做一些事情
// 响应拦截器
$http.afterRequest = function () {
uni.hideLoading()
}
// 封装弹框的方法
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()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。