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

使用setResponseCodeKey这个方法的问题 #2

Open
www295686243 opened this issue Jan 18, 2024 · 5 comments
Open

使用setResponseCodeKey这个方法的问题 #2

www295686243 opened this issue Jan 18, 2024 · 5 comments

Comments

@www295686243
Copy link

我想修改默认的err_code err_msg这样的key,我看你内置了几个,我想改成code和message这样的key,但我应该在哪里使用setResponseCodeKey方法来全局改掉?

@www295686243
Copy link
Author

我看你success方法和fail方法都调用了一次setResponseCodeKey,这好像就定死了,没法统一改,必须每次调用success的时候改,这样太麻烦了

@mouyong
Copy link
Owner

mouyong commented Jan 18, 2024

我也想过这个,当时就是想要修改掉这俩key,后来这个set的方式也没能解决。

有啥好用的方法吗。

@mouyong
Copy link
Owner

mouyong commented Jan 18, 2024

我考虑把这个项目迁移到 https://github.com/plugins-world/PhpSupport 项目

@mouyong
Copy link
Owner

mouyong commented Jan 18, 2024

我目前是在 laravel 的 serviceprovider 使用的这个函数调用。因为似乎会失败,才每次调用。

@www295686243
Copy link
Author

我也想过这个,当时就是想要修改掉这俩key,后来这个set的方式也没能解决。

有啥好用的方法吗。

你改成从配置读取不就完事了嘛,别人也好改个配置全局就变了

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

2 participants