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

页面 models 调用 页面 services 错误 #6028

Closed
rskmin opened this issue Mar 7, 2023 · 4 comments
Closed

页面 models 调用 页面 services 错误 #6028

rskmin opened this issue Mar 7, 2023 · 4 comments
Labels

Comments

@rskmin
Copy link

rskmin commented Mar 7, 2023

Describe the bug

我在页面级的 models 下尝试调用页面级的 services 出现了错误,这属于正常现象么?

image

image

image

Expected behavior

页面 models 下能正常调用页面 services 下定义的 API

Actual behavior

No response

Version of ice.js

3.0.0

Content of build.json or ice.config.mts

No response

Additional context

No response

@rskmin rskmin added the bug label Mar 7, 2023
@rskmin
Copy link
Author

rskmin commented Mar 7, 2023

我将页面级数据请求提升为全局数据请求解决了这个问题,但是我依旧无法理解为什么页面级 models 无法使用页面级 services,我希望能得到一份详细的说明。

@rskmin rskmin closed this as completed Mar 7, 2023
@rskmin rskmin reopened this Mar 7, 2023
@ClarkXia
Copy link
Collaborator

ClarkXia commented Mar 8, 2023

提供下 ice.config.mts 的配置

@luhc228
Copy link
Collaborator

luhc228 commented Mar 8, 2023

你需要添加类似 pages/*/services/**routes.ignoreFiles,否则它会当做是路由文件去进行处理。

@luhc228 luhc228 closed this as completed Mar 8, 2023
@rskmin
Copy link
Author

rskmin commented Mar 8, 2023

是的我通过添加 routes.ignoreFiles 成功了,感谢,这太容易被忽视了

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

No branches or pull requests

3 participants