Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
muchen404 opened this issue Jan 18, 2018 · 4 comments
Open

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

muchen404 opened this issue Jan 18, 2018 · 4 comments

Comments

@muchen404
Copy link

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

@whirly77cai
Copy link

me too. found nothing on the document.

@chuangker
Copy link
Contributor

直接 import 这个 api 就行了呀。

@ghostchan
Copy link

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

@breederComrade
Copy link

breederComrade commented Dec 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants