Blame view

src/http/index.js 376 Bytes
e7ab2c09a   alexYang   权限部分
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  // 导入所有接口
  import api from './api'
  
  const install = Vue => {
      if (install.installed)
          return;
  
      install.installed = true;
  
      Object.defineProperties(Vue.prototype, {
          // 注意,此处挂载在 Vue 原型的 $api 对象上
          $api: {
              get() {
                  return api
              }
          }
      })
  }
  
  export default install