PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

xiyou大佬看看那里错误呢 [复制链接]

1#
<div class="login-box">
                    <div id="loginBox">
                        
                    </div>
                </div>
                <script type="text/javascript">
                    var userToken;
                    $(function () {
                        $.ajax({
                            url: "http://域名/e/GetUserToken/",
                            type: "GET",
                            xhrFields: { withCredentials: true },
                            dataType: "json", //指定服务器返回的数据类型
                            success: function (data) {
                                if (data != "") {
                                    var redirectUrl = encodeURIComponent(location.href);
                                    var loginedHtml = '<a class="denglu" href="//域名/?redirectUrl=' + redirectUrl + '" target="_blank">登录</a><a class="zhuce" href="//域名/Reg/?redirectUrl=' + redirectUrl + '" target="_blank">注册</a>';
                                    userToken = data.UserToken;
                                    var currentUser = data.CurrentUser;
                                    if (isNullOrEmpty(userToken) || isNullOrEmpty(currentUser)) {
                                        $("#loginBox").html(loginedHtml);
                                        return;
                                    }
                                    var nickName = data.NickName;
                                    if (isNullOrEmpty(nickName)) {
                                        nickName = currentUser.UserName;
                                    }
                                    nickName = nickName.left(10);
                                    loginedHtml = '<a href="http://域名/" class="denglu" title="进入会员中心" target="_blank">您好,' + nickName + '</a>';
                                    $("#loginBox").html(loginedHtml);
                                }
                            }
                        });
                    });
                </script>

运行的以后的结果没任何显示
微信截图_20210110203558.png (, 下载次数:0)

(2021/1/10 20:36:46 上传)

微信截图_20210110203558.png

分享 转发
TOP
2#

域名发出来,需要浏览器开发工具找错误
TOP
3#
TOP
4#

回复 2楼xiyou的帖子

xiyou大佬看看呢
TOP
5#




https不能向http发请求,被浏览器阻止,要么都启用ssl,要么都不启用
TOP
6#

回复 5楼xiyou的帖子

谢谢!
TOP
7#

回复 5楼xiyou的帖子

https不能向http发请求,被浏览器阻止,要么都启用ssl,要么都不启用
---
请问怎么全部启用或者全部禁用啊?
TOP
8#

回复 6楼jingyi的帖子

https不能向http发请求,被浏览器阻止,要么都启用ssl,要么都不启用
---
请问怎么全部启用或者全部禁用啊?
TOP
发新话题 回复该主题