Files
ningbo/动易的标签库/标签库/问答类/问答登录.config
T
2026-08-31 16:22:00 +08:00

267 lines
9.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0"?>
<root>
<LabelType>问答类</LabelType>
<LabelIntro>问答登录</LabelIntro>
<OutType>txt</OutType>
<LabelDataType>static</LabelDataType>
<EnabelAjax>True</EnabelAjax>
<LabelTemplate><![CDATA[<div id="BOX_overlay" style="display:none;" class="OverLay">
</div>
<div id="MainLogin" style="display:none;" class="mainlogin">
<h2><a href="javascript:CloseDiv();"><span></span></a>登录</h2>
<dl>
<div> <b>问答注册用户请直接登录</b> </div>
<div class="logininput">
<div class="item">
<label for="userName">用户名:</label>
<input type="text" name="TxtUserName" id="TxtUserName">
</div>
<div class="item">
<label for="password">密&nbsp;&nbsp;码:</label>
<input type="password" name="TxtPassword" id="TxtPassword">
</div>
<div id="checkcode" class="item" style="display:none;">
<label for="ValdisplayDate">验证码:</label>
<input name="TxtValdisplayDateCode" type="text" maxlength="6" value="no" id="TxtValdisplayDateCode" onfocus="this.select();" style="width: 50px;" />
<img id="VcodeLogOn" title="看不清楚,换一个" onclick="RefreshValdisplayDateCodeImage(this);" src="{PE.SiteConfig.ApplicationPath /}Controls/ValidateCodeImage.aspx" align="absmiddle" style="border-width: 0px; cursor: hand;" />
</div>
<div class="item">
<label for="Cookie">Cookie:</label>
<select name="DropExpiration" id="DropExpiration">
<option value="None">不保存</option>
<option value="Day">保存一天</option>
<option value="Month">保存一月</option>
<option value="Year">保存一年</option>
</select>
</div>
<div class="buttons">
<input type="submit" value=" 登录 " onClick="Login()">
&nbsp;&nbsp;
<a href="{PE.SiteConfig.ApplicationPath /}User/GetPassword.aspx" linkOpenType="_top">忘记密码?</a>
</div>
<div style="padding-top:10px;">
<hr size="0" style="border-top:1px solid #AAAAAA">
<div>没有问答账号?</div>
<div>
<input type="button" value="立即注册问答帐号" class="regButton" onClick="regUser();" />
</div>
</div>
</div>
</dl>
</div>
<style type="text/css">
.OverLay{
position: absolute;
z-index: 100;
top: 0px;
left: 0px;
background-color: #000;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
opacity: 0.7;
}
</style>
<script type="text/javascript" language="JavaScript">
LoadInit();
CheckEnableValidCode();
function LoadInit()
{
document.getElementById("TxtUserName").value = "";
}
function CheckEnableValidCode(){
var x = new AjaxRequest('XML', 'status');
x.para = [];
x.post('EnableValidCode', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == "yes") {
document.getElementById("checkcode").style.display = '';
document.getElementById("TxtValdisplayDateCode").value = '';
}
});
}
function RefreshValdisplayDateCodeImage(ValdisplayDateCodeImageControl){
ValdisplayDateCodeImageControl.src = ValdisplayDateCodeImageControl.src + '?code=' + RandomNum(10);
}
function RandomNum(n){
var rnd = '';
for (var i = 0; i < n; i++)
rnd += Math.floor(Math.random() * 10);
return rnd;
}
function regUser()
{
url="{PE.SiteConfig.ApplicationPath /}User/Register.aspx";
window.open(url,"_blank");
}
function CloseDiv()
{
BOX_remove('MainLogin');
CheckEnableValidCode();
RefreshValdisplayDateCodeImage(document.getElementById("VcodeLogOn"));
document.getElementById("TxtUserName").value = "";
document.getElementById("TxtPassword").value = "";
document.getElementById("DropExpiration").selectedIndex = 0;
}
function DefaultButton(event, linkOpenType){
if (event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea"))) {
var defaultButton = $(linkOpenType);
if (defaultButton && typeof(defaultButton.click) != "undefined") {
defaultButton.click();
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
return false;
}
}
return true;
}
</script>
<script language="javascript" type="text/javascript">
var isLogin = false;
function Loginin(LoginString){
document.getElementById("MainLogin").innerHTML = document.getElementById("MainLogin").innerHTML + LoginString;
}
function CheckIsLogin(){
var x = new AjaxRequest('XML', 'status');
x.para = [];
x.async = false;
x.post('logincheck', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == 'ok') {
isLogin = true;
}
else {
BOX_show('MainLogin');
isLogin = false;
}
});
}
function CheckEnableValidCode(){
var x = new AjaxRequest('XML', 'status');
x.para = [];
x.post('EnableValidCode', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
if (status == "yes") {
document.getElementById("checkcode").style.display = '';
document.getElementById("TxtValdisplayDateCode").value = '';
}
});
}
var isPost = false;
function Login(){
if (document.getElementById("TxtUserName").value == '') {
alert("请填写用户名!");
document.getElementById("TxtUserName").focus();
return;
}
if (document.getElementById("TxtPassword").value == '') {
alert("请填写密码!");
document.getElementById("TxtPassword").focus();
return;
}
if (document.getElementById("TxtValdisplayDateCode").value == '') {
alert("请填写验证码!");
document.getElementById("TxtValdisplayDateCode").focus();
return;
}
var x = new AjaxRequest('XML', 'status');
x.para = ['username=' + document.getElementById("TxtUserName").value, 'password=' + document.getElementById("TxtPassword").value, 'checkcode=' + document.getElementById("TxtValdisplayDateCode").value, 'expiration=' + document.getElementById("DropExpiration").value];
x.post('userlogin', '{PE.SiteConfig.ajaxsitepath/}ajax.aspx', function(s){
var xml = x.createXmlDom(s);
var status = xml.getElementsByTagName("status")[0].firstChild.data;
switch (status) {
case "ok":
if (xml.getElementsByTagName("API_Enable")[0].firstChild.data == "1") {
var LoginString = xml.getElementsByTagName("LoginString")[0].firstChild.data;
Loginin(LoginString);
}
if(isPost == true)
{
doPost();
isPost = false;
}
else
{
BOX_remove('MainLogin');
LoadCheck();
}
break;
case "err":
var errorMessage = xml.getElementsByTagName("body")[0].firstChild.data;
alert(errorMessage);
break;
}
});
}
</script>
<script type="text/javascript" language="JavaScript">
//显示
function BOX_show(e)
{
if(document.getElementById(e)==null){return;}
BOX_layout(e);
window.onresize = function(){BOX_layout(e);} //改变窗体重新调整位置
window.onscroll = function(){BOX_layout(e);} //滚动窗体重新调整位置
}
//移除
function BOX_remove(e)
{
document.getElementById('BOX_overlay').style.display="none";
document.getElementById(e).style.display="none";
window.onscroll = null;
window.onresize = null;
}
//调整布局
function BOX_layout(e)
{
var a = document.getElementById(e);
//判断是否新建遮掩层
if (document.getElementById('BOX_overlay')==null)
{
var overlay = document.createElement("div");
overlay.setAttribute('id','BOX_overlay');
a.parentNode.appendChild(overlay);
}
//取客户端左上坐标,宽,高
var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
var clientWidth = document.documentElement.clientWidth;
var clientHeight = document.documentElement.clientHeight;
var bo = document.getElementById('BOX_overlay');
bo.style.left = scrollLeft+'px';
bo.style.top = scrollTop+'px';
bo.style.width = clientWidth+'px';
bo.style.height = clientHeight+'px';
bo.style.display="";
//Popup窗口定位
a.style.position = 'absolute';
a.style.zIndex=101;
a.style.display="";
a.style.left = "40%";
a.style.top = "25%";
//document.getElementById('setting').style.display="block";
}
</script>]]></LabelTemplate>
</root>