Browse Source

添加接口请求方式

xuqiaoying 3 years ago
parent
commit
3f2156a1c3
1 changed files with 5 additions and 1 deletions
  1. 5 1
      main.js

+ 5 - 1
main.js

@@ -1,8 +1,12 @@
 import Vue from 'vue'
 import Vue from 'vue'
 import App from './App'
 import App from './App'
-//异步请求
+//接口请求方式一
 import api from '@/common/api'
 import api from '@/common/api'
 Vue.prototype.$api = api
 Vue.prototype.$api = api
+// 接口请求方式二 (url,method,data(请求参数),noToken, noLoading)
+import { myRequest } from '@/common/request.js'
+Vue.prototype.$http = myRequest
+
 import store from './store'
 import store from './store'
 Vue.prototype.$store = store
 Vue.prototype.$store = store
 //提示框
 //提示框