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

在router/index.js 中引入 api文件下接口,request为null #767

Open
zc24 opened this issue Aug 22, 2023 · 1 comment
Open

在router/index.js 中引入 api文件下接口,request为null #767

zc24 opened this issue Aug 22, 2023 · 1 comment

Comments

@zc24
Copy link

zc24 commented Aug 22, 2023

在router/index.js 中引入 api文件下接口,request为null

  1. router/index.js
image 2.api/setting/role.js image 如果是这种调用方式,会输出request = undefined

如果是放到组件里,能正常输出request函数

这是为什么呢?

@zc24
Copy link
Author

zc24 commented Aug 22, 2023

感觉好像是循环引用导致的,utils/request文件里引用了store,store引用了router

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

1 participant