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

WeChatProvider下的getAuthUrl个人觉得应该暴露出来 #432

Closed
cnjack opened this issue May 30, 2016 · 10 comments
Closed

WeChatProvider下的getAuthUrl个人觉得应该暴露出来 #432

cnjack opened this issue May 30, 2016 · 10 comments

Comments

@cnjack
Copy link

cnjack commented May 30, 2016

如题,不然总会出现跳转的链接,太不好了

@cnjack
Copy link
Author

cnjack commented May 30, 2016

找到了$oauth->redirect()->getTargetUrl() 直接这样就行了

@cnjack cnjack closed this as completed May 30, 2016
@overtrue
Copy link
Collaborator

@cnjack 其实你不需要这样,你的用法肯定错误了,我猜你应该是:

echo $response;

或者:

return $response;

应该是这样用法所致,在页面出现链接的原因估计是你的框架并不支持返回 Response 对象,这种情况下你应该这样用:

$response->send();

@cnjack
Copy link
Author

cnjack commented May 30, 2016

应该是的我用的是yaf

@overtrue
Copy link
Collaborator

@cnjack yaf:

$response->send(); exit;

@cnjack
Copy link
Author

cnjack commented May 30, 2016

我最终用的$this->redirect($oauth->redirect()->getTargetUrl());
感觉yaf自带的跳转蛮叼的样子,然而只是心理作用

@overtrue
Copy link
Collaborator

@cnjack 好吧。。。

@cnjack
Copy link
Author

cnjack commented May 30, 2016

我看到了,应该不行的,因为在setTargetUrl() 里面设置了$this->setContent里面加了一些html,所以打开很丑,我并不想让用户觉得跳转了,所以还是直接header 或者用框架自带的
用send的话line378 $this->sendContent();这样会输出内容的

@overtrue
Copy link
Collaborator

$oauth->redirect()->send(); exit;

这样肯定是行的

@cnjack
Copy link
Author

cnjack commented May 30, 2016

实验了一下,确实可以~~哈哈,瞬间打脸

@overtrue
Copy link
Collaborator

@cnjack 没事,不疼。:laughing:

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