1 Star 0 Fork 1

Chenyqiang/以物易物-小程序APP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.js 972 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jetwang 提交于 2022-11-05 20:33 +08:00 . 完成了登录支付页面的开发
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import {
$http
} from '@escook/request-miniprogram'
import store from '@/store/store.js'
Vue.config.productionTip = false
uni.$http = $http
$http.baseUrl = 'https://api-ugo-web.itheima.net'
// 请求开始之前做一些事情
$http.beforeRequest = function(options) {
if (options.url.indexOf('/my/') !== -1) {
options.header = {
Authorization: store.state.m_user.token
}
}
uni.showLoading({
title: "数据加载中..."
})
}
// 响应拦截器
$http.afterRequest = function() {
uni.hideLoading()
}
uni.$showMsg = function(title = "数据请求失败!", duration = 1500) {
uni.showToast({
title,
duration,
icon: 'none'
})
}
App.mpType = 'app'
const app = new Vue({
...App,
store
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Chenyqiang/uni-project.git
git@gitee.com:Chenyqiang/uni-project.git
Chenyqiang
uni-project
以物易物-小程序APP
master

搜索帮助