使用javascript查找登录用户 [英] find logged in user using javascript

查看:82
本文介绍了使用javascript查找登录用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,

我可以使用javascript找到登录用户吗?有人可以分享相同的代码吗?

Hi Team,
Can i find the logged in user using javascript? can someone please share the code for the same?

推荐答案

取决于您如何登录用户。如果它是服务器端,你可能需要做一个AJAX请求。如果你把用户名放在一个cookie中,你应该没问题。
that depends on how you log in the user. if it''s server side, you probably need to do an AJAX request. if you put the username in a cookie, you should get that without problems.


你好Dormilich,


我会解释你的问题。

我有一个应用程序正在使用.net'的模拟功能上传文档并使用\\< path>。代码工作正常,因为一切都在同一个.cs文件中。现在,当我尝试打开保存的文档时,我使用相同的模拟功能并使用同一用户登录。但是我在打开文档时遇到错误它会问我用户名/密码没有上传的内容。

打开文档的代码是在.js文件上并使用http://< path> ;阅读文件。
Hi Dormilich,

I will explain you my problem.
I am having one app which is uploading doc using .net''s impersonation functionality and using \\<path>. the code is working fine as everything is on the same .cs file. Now when i am trying to open the saved document i am using the same impersonation functionality and logging in with same user. but i am getting error while opening the doc it is asking me username/pwd which is not happening for uploading.
code for opening the doc is on .js file and using http://<path> to read the file.


为什么要用javascript打开文件?


你可以传递登录详细信息和网址:
why do you open the file using javascript?

you can pass login details along with the url:
展开 | 选择 | Wrap | 行号


这篇关于使用javascript查找登录用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆