This commit is contained in:
parent
10b714e441
commit
4ae72d107c
|
|
@ -7,7 +7,7 @@ import { HTTP_CONFIG, checkApiAuth } from './config.js'
|
|||
* 初始化HTTP配置
|
||||
* @param {Object} vm Vue实例,用于访问vuex等全局状态
|
||||
*/
|
||||
module.exports = (vm) => {
|
||||
export default (vm) => {
|
||||
// 初始化请求配置
|
||||
uni.$u.http.setConfig((config) => {
|
||||
config.baseURL = HTTP_CONFIG.baseURL
|
||||
|
|
|
|||
5
main.js
5
main.js
|
|
@ -1,5 +1,6 @@
|
|||
import App from './App'
|
||||
import uViewNext from '@/uni_modules/uview-next';
|
||||
import httpConfig from './http/config/request.js';
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
|
|
@ -12,7 +13,7 @@ const app = new Vue({
|
|||
})
|
||||
|
||||
// 引入HTTP请求配置,将app参数传递到配置中
|
||||
require('./http/config/request.js')(app)
|
||||
httpConfig(app)
|
||||
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
|
@ -24,7 +25,7 @@ export function createApp() {
|
|||
app.use(uViewNext)
|
||||
|
||||
// 引入HTTP请求配置
|
||||
require('./http/config/request.js')(app)
|
||||
httpConfig(app)
|
||||
|
||||
return {
|
||||
app
|
||||
|
|
|
|||
Loading…
Reference in New Issue