easy-mock-cli icon indicating copy to clipboard operation
easy-mock-cli copied to clipboard

生成api文件夹之后怎么使用

Open muchen404 opened this issue 7 years ago • 4 comments

image 已经在项目的根目录生成api文件加了,但是不知道怎么使用,我的是vue项目

muchen404 avatar Jan 18 '18 07:01 muchen404

me too. found nothing on the document.

whirly77cai avatar Jan 25 '18 09:01 whirly77cai

直接 import 这个 api 就行了呀。

chuangker avatar Jan 26 '18 03:01 chuangker

同不会用,能不能提供个小demo,谢谢

ghostchan avatar May 07 '18 07:05 ghostchan

image 在你需要调用的地方导入接口,我项目叫sass_admin,具体你可以看api/index 文件导出的 import { sass_admin } from '../../api/index'; 在你需要调用的地方调用/api/sass_admin/index 内的方法 方法对应的是你在easymack上新建的方法 因为他是创建了一个axios实例对象 所以你可以通过下面方法传参 sass_admin.test_get({ params: { fuck: 1 } });

breederComrade avatar Dec 11 '18 03:12 breederComrade