admin管理员组文章数量:1332440
本人环境(php7、laravel5),为响应公司要求,内部自研信息系统集成到飞书工作台后,点击工作台应用可支持飞书指定设置浏览器单点登录。 第一步:设置飞书客户端默认浏览器; 第二步:配置飞书自建应用,开启网页应用功能,设定好跳转URL、安全设置配置URL重定向; 第三步:在接口中调用 window.open() 函数,实现新窗口打开效果即可。
echo '<script>window.open("http://www.assets:81/Home", "_blank", "resizable,scrollbars,status");</script>';
exit();
备注:如觉得每次单点都得授权麻烦,可以新建个接口中转一下
/**
* 单点登录资产系统
*/
public function clickSystemLogin(){
//飞书PC端
if (strpos($_SERVER['HTTP_USER_AGENT'],'Electron/Native WebApp/workplace')!== false){
echo '<script>window.open("http://www.baidu/clickSystemLoginViews", "_blank", "resizable,scrollbars,status");</script>';
dd();
}else{
return redirect("assets");
exit();
}
}
/*
* 飞书单点中转函数
*/
public function clickSystemLoginViews(){
if (Session::get('loginUserEmployeeNo')){
return redirect('Home');
exit();
}
if (Session::get('SYSTEM_AUTH')==1){
return redirect('SystemNew');
exit();
}
$url = "Location: https://open.feishu/open-apis/authen/v1/index?redirect_uri=redirect_uri&app_id=app_id=assetSystem";
header($url);
dd();
}
版权声明:本文标题:如何实现飞书自建应用PC端指定浏览器打开 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1726854262a1176587.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论