public ActionResult CheckLogon() { var con = "document.write('{0}')"; if (AuthManager.UserWebIdentity == null) { const string text = "<div class="count_login"><span>欢迎来到路游租车!</span><div class="login"><a href="http://passport.luyou666.com/Account/Logon">登录</a><a class="zhuce" href="http://passport.luyou666.com/Account/VerificationPhoneUser">注册</a></div></div>"; con = con.FormatValue(text); } else { var text = "<div class="count_login"><span><a href="http://my.luyou666.com">" + AuthManager.UserWebIdentity.Profile.LoginId + "<img src="http://passport.luyou666.com/Content/User/icon/name.gif" /></a>欢迎来到路游租车!</span><div class="tuichu"><a href="/logout">退出</a></div></div>"; con = con.FormatValue(text); } return Content(con, MimeCollection.Js.ContentType); }
前端调用
<script type="text/javascript" src="http://passport.luyou666.com/Account/CheckLogon"></script>