1. Download the pluginpocky-request:Address 1: UNI – Plug-in Market 与 Address 2: Github
  2. Address will automatically generate directory, as shown below. Address 2 can be manually added

  1. Mount to vUE

main.js

  import Vue from 'vue'
  import App from './App'
  / / = = = = = = the import
  import Request from '/ js_sdk/pocky - request/pocky - request - v. 2.0.4 / index js'

  Vue.config.productionTip = false
  
  / / = = = = = = = mount
  Vue.prototype.$axios = Request()

  App.mpType = 'app'

  const app = newVue({ ... App }) app.$mount()Copy the code
  1. Basic configuration, baseURL, etc

5. Initiate a request

  getArcList(interval, info) {
      this.$axios.request({
          url: 'infos/informations/'.method: 'get'.params: {
              interval
          }
      }).then(res= > {
          this[info] = res.data.dataInfo.listData
      })
  }
Copy the code
  1. Have good beginning

Attached the official document: www.yuque.com/pocky/aaeyu…