Excel超链接需要不必要的额外login

我创build了一个excel超链接,使用如下所示:= HYPERLINK(“ https://abc.com/ ”&A1)

当我点击它时,它会在Chrome中打开一个新标签,要求我login(该页面有敏感信息,需要用户身份validation),即使我以前已经login过。

不过,如果我要从单元格复制并直接粘贴到Chrome浏览器的url栏中,它会自动将我带到页面,而不会再次login。

有没有办法避开这个问题?

请参阅Bharath在这里的类似问题的答案: Excel超链接redirect到login

  1. 在公用文件夹中创build一个redirect.html页面(公用文件夹,因为您使用的是ROR)
  2. 将此复制到您的redirect.html
<html> <body> Please wait, loading your page... <script type="text/javascript"> function getQuerystring(key) { key = key.replace(/[\[]/,"\\\[").replace(/ [\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var query = regex.exec(window.location.href); return query[1]; } window.location = "http://" + window.location.host + "/" + getQuerystring('page'); </script> </body> </html> 

你在Excel中build立的链接应该被修改

对于例如旧链接 – http://test.com/post/comments/1新的链接应该是 – http://test.com/redirect.html?page=post/comments/1

你需要将URL的部分(在基本url之后)作为parameter passing。

当用户在excel中点击一个链接时,它指向redirect.html并且javascript构造实际的URL并且再次redirect到适当的页面,如果已经login,用户将被导航到实际页面,否则被redirect到login/主页面。