首页 > 其他 > 详细

接口的三种写法

时间:2021-07-29 22:05:24      阅读:27      评论:0      收藏:0      [点我收藏+]

 

 

  query: {},
 
 
接口 1

aa(){

 this.lockLoading = true
 
  this.loading = true;
      request.get(‘/api/commission/v1/getStoreManagerPerformanceList‘, {
        params: this.query
      }).then(result => {
        this.loading = false;
        this.dataList = result.data;
      })
    },
 
}
 

接口 2

aa(){

 this.lockLoading = true
 await request.get(`/api/commission/v1/storeManagerPerformanceListLock?beginDate=${this.query.beginDate}&endDate=${this.query.endDate}`)
            .then( res => {
              console.log(‘res‘,res)
              if (res.code == 200) {
                //this.dataList = result.data;
                this.$message.success("操作成功!")
              } else {
                this.$message.error(res.err);
              }
              this.lockLoading = false
            })
 
}
 

接口 3

aa(){

 this.lockLoading = true
 await request.get(‘/api/commission/v1/getConsultantPerformanceList/excel?beginDate=‘ + this.query.beginDate +‘&endDate=‘+this.query.endDate)
 
            .then( res => {
              console.log(‘res‘,res)
              if (res.code == 200) {
                //this.dataList = result.data;
                this.$message.success("操作成功!")
              } else {
                this.$message.error(res.err);
              }
              this.lockLoading = false
            })
 
}
 
 
 
 

接口的三种写法

原文:https://www.cnblogs.com/HouKnowledge/p/15076574.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!