E应用调接口

1.get请求+塞token

 dd.httpRequest({
          url: url,
          method: 'GET',
          headers : {'token':'ios#1p4hk6oh31g9771a0d597ee6aalj4mj4a9g2'},
          // data: {
          //     authCode: res.authCode
          // },
          dataType: 'json',
          success: function(res) {
             console.log(res.data)
          },
          fail: function(res) {
              dd.alert({content: JSON.stringify(res)});
          },
          complete: function(res) {
              dd.hideLoading();
          }
      });

2.get请求拼接参数

效果:

Request URL:

http://lseqa.hengtiansoft.com:80/home/region/list?&type=1&parentId=21

dd.httpRequest({
          url: 'http://lseqa.hengtiansoft.com:80/home/region/list?',
          method: 'GET',
          data: {
            type: 1,
            parentId: 21
          },
          dataType: 'json',
          success: function(res) {
             console.log(res.data)
          },
          fail: function(res) {
              dd.alert({content: JSON.stringify(res)});
          },
          complete: function(res) {
              dd.hideLoading();
          }
      });

猜你喜欢

转载自blog.csdn.net/tt18473481961/article/details/85328427