小程序封装请求步骤

84 阅读1分钟

第一步建立http文件夹 再建立http.js

内容如下:

image.png 第二步封装具体的请求,建立api.js

内容如下:

image.png 第三步在login页面调用接口:

具体内容如下:

image.png