From 54979feba74bd3c7dea2630e1ba96401b25f60d8 Mon Sep 17 00:00:00 2001 From: wlzboy <66905212@qq.com> Date: 星期四, 07 八月 2025 14:26:13 +0800 Subject: [PATCH] feat: login index.asp --- pay.asp | 112 ++++++++++++ index.asp | 195 --------------------- inc/login_input.asp | 187 ++++++++++++++++++++ 3 files changed, 303 insertions(+), 191 deletions(-) diff --git a/inc/login_input.asp b/inc/login_input.asp new file mode 100644 index 0000000..8068f06 --- /dev/null +++ b/inc/login_input.asp @@ -0,0 +1,187 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>鐧诲綍鐮佽緭鍏�</title> + <style> + body { + font-family: Arial, sans-serif; + background-color: #f5f5f5; + margin: 0; + padding: 20px; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + } + .container { + background: white; + padding: 30px; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + text-align: center; + max-width: 400px; + width: 100%; + } + .title { + font-size: 24px; + color: #333; + margin-bottom: 30px; + } + .input-group { + margin-bottom: 20px; + } + .input-group label { + display: block; + text-align: left; + margin-bottom: 8px; + color: #555; + font-weight: bold; + } + .input-group input { + width: 100%; + padding: 12px; + border: 2px solid #ddd; + border-radius: 5px; + font-size: 16px; + box-sizing: border-box; + } + .input-group input:focus { + outline: none; + border-color: #007bff; + } + .btn { + background-color: #007bff; + color: white; + padding: 12px 30px; + border: none; + border-radius: 5px; + font-size: 16px; + cursor: pointer; + margin: 5px; + transition: background-color 0.3s; + } + .btn:hover { + background-color: #0056b3; + } + .btn:disabled { + background-color: #ccc; + cursor: not-allowed; + } + .tip { + color: #666; + font-size: 14px; + margin-top: 20px; + line-height: 1.5; + } + .error { + color: #dc3545; + font-size: 14px; + margin-top: 10px; + } + </style> +</head> +<body> + <div class="container"> + <div class="title">骞夸笢姘戣埅鍖荤枟蹇嚎 鏀粯鐧诲綍</div> + <form id="loginForm"> + <div class="input-group"> + <label for="loginCode">鐧诲綍鐮侊細</label> + <input type="text" id="loginCode" name="loginCode" maxlength="6" placeholder="璇疯緭鍏�6浣嶇櫥褰曠爜" autocomplete="off"> + </div> + <div class="input-group"> + <button type="button" id="payBtn" class="btn" disabled>鍘绘敮浠�</button> + </div> + <div class="tip">璇疯緭鍏ユ敮浠樼煭淇′腑鍙戦�佺殑鐧诲綍鍙�</div> + <div id="errorMsg" class="error" style="display: none;"></div> + </form> + </div> + + <script> + const loginCodeInput = document.getElementById('loginCode'); + const payBtn = document.getElementById('payBtn'); + const errorMsg = document.getElementById('errorMsg'); + let autoRedirectTimer = null; + + function validateLoginCode(code) { + return /^[A-Za-z0-9]{6}$/.test(code); + } + + function redirectToLogin(code) { + const currentUrl = window.location.href.split('?')[0]; + window.location.href = currentUrl + '?n=' + encodeURIComponent(code); + } + + function updateButtonState() { + const code = loginCodeInput.value.trim(); + const isValid = validateLoginCode(code); + payBtn.disabled = !isValid; + + if (isValid) { + errorMsg.style.display = 'none'; + // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒 + if (autoRedirectTimer) { + clearTimeout(autoRedirectTimer); + } + // 璁剧疆鑷姩璺宠浆瀹氭椂鍣紙2绉掑悗鑷姩璺宠浆锛� + autoRedirectTimer = setTimeout(() => { + redirectToLogin(code); + }, 2000); + } else { + if (autoRedirectTimer) { + clearTimeout(autoRedirectTimer); + autoRedirectTimer = null; + } + } + } + + function showError(message) { + errorMsg.textContent = message; + errorMsg.style.display = 'block'; + } + + function hideError() { + errorMsg.style.display = 'none'; + } + + // 杈撳叆妗嗕簨浠剁洃鍚� + loginCodeInput.addEventListener('input', function() { + const code = this.value.trim(); + + // 鍙厑璁歌緭鍏ユ暟瀛楀拰瀛楁瘝 + this.value = code.replace(/[^A-Za-z0-9]/g, ''); + + updateButtonState(); + hideError(); + }); + + // 鏀粯鎸夐挳鐐瑰嚮浜嬩欢 + payBtn.addEventListener('click', function() { + const code = loginCodeInput.value.trim(); + if (validateLoginCode(code)) { + redirectToLogin(code); + } else { + showError('璇疯緭鍏ユ纭殑6浣嶇櫥褰曠爜'); + } + }); + + // 鍥炶溅閿彁浜� + loginCodeInput.addEventListener('keypress', function(e) { + if (e.key === 'Enter') { + const code = this.value.trim(); + if (validateLoginCode(code)) { + redirectToLogin(code); + } else { + showError('璇疯緭鍏ユ纭殑6浣嶇櫥褰曠爜'); + } + } + }); + + // 椤甸潰鍔犺浇鏃惰仛鐒﹀埌杈撳叆妗� + window.addEventListener('load', function() { + loginCodeInput.focus(); + }); + </script> +</body> +</html> \ No newline at end of file diff --git a/index.asp b/index.asp index 6b37550..3a6dba1 100644 --- a/index.asp +++ b/index.asp @@ -11,197 +11,10 @@ l = Request("l") '娉ㄥ唽鐢ㄦ埛/鐧诲綍 ' 濡傛灉娌℃湁浼犻�掍换浣曞弬鏁帮紝鏄剧ず鐧诲綍鐮佽緭鍏ラ〉闈� -If n="" And s="" And u="" And l="" Then -%> -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>鐧诲綍鐮佽緭鍏�</title> - <style> - body { - font-family: Arial, sans-serif; - background-color: #f5f5f5; - margin: 0; - padding: 20px; - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - } - .container { - background: white; - padding: 30px; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0,0,0,0.1); - text-align: center; - max-width: 400px; - width: 100%; - } - .title { - font-size: 24px; - color: #333; - margin-bottom: 30px; - } - .input-group { - margin-bottom: 20px; - } - .input-group label { - display: block; - text-align: left; - margin-bottom: 8px; - color: #555; - font-weight: bold; - } - .input-group input { - width: 100%; - padding: 12px; - border: 2px solid #ddd; - border-radius: 5px; - font-size: 16px; - box-sizing: border-box; - } - .input-group input:focus { - outline: none; - border-color: #007bff; - } - .btn { - background-color: #007bff; - color: white; - padding: 12px 30px; - border: none; - border-radius: 5px; - font-size: 16px; - cursor: pointer; - margin: 5px; - transition: background-color 0.3s; - } - .btn:hover { - background-color: #0056b3; - } - .btn:disabled { - background-color: #ccc; - cursor: not-allowed; - } - .tip { - color: #666; - font-size: 14px; - margin-top: 20px; - line-height: 1.5; - } - .error { - color: #dc3545; - font-size: 14px; - margin-top: 10px; - } - </style> -</head> -<body> - <div class="container"> - <div class="title">骞夸笢姘戣埅鍖荤枟蹇嚎 鏀粯鐧诲綍</div> - <form id="loginForm"> - <div class="input-group"> - <label for="loginCode">鐧诲綍鐮侊細</label> - <input type="text" id="loginCode" name="loginCode" maxlength="6" placeholder="璇疯緭鍏�6浣嶇櫥褰曠爜" autocomplete="off"> - </div> - <div class="input-group"> - <button type="button" id="payBtn" class="btn" disabled>鍘绘敮浠�</button> - </div> - <div class="tip">璇疯緭鍏ユ敮浠樼煭淇′腑鍙戦�佺殑鐧诲綍鐮�</div> - <div id="errorMsg" class="error" style="display: none;"></div> - </form> - </div> - - <script> - const loginCodeInput = document.getElementById('loginCode'); - const payBtn = document.getElementById('payBtn'); - const errorMsg = document.getElementById('errorMsg'); - let autoRedirectTimer = null; - - function validateLoginCode(code) { - return /^[A-Za-z0-9]{6}$/.test(code); - } - - function redirectToLogin(code) { - const currentUrl = window.location.href.split('?')[0]; - window.location.href = currentUrl + '?n=' + encodeURIComponent(code); - } - - function updateButtonState() { - const code = loginCodeInput.value.trim(); - const isValid = validateLoginCode(code); - payBtn.disabled = !isValid; - - if (isValid) { - errorMsg.style.display = 'none'; - // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒 - if (autoRedirectTimer) { - clearTimeout(autoRedirectTimer); - } - // 璁剧疆鑷姩璺宠浆瀹氭椂鍣紙2绉掑悗鑷姩璺宠浆锛� - autoRedirectTimer = setTimeout(() => { - redirectToLogin(code); - }, 2000); - } else { - if (autoRedirectTimer) { - clearTimeout(autoRedirectTimer); - autoRedirectTimer = null; - } - } - } - - function showError(message) { - errorMsg.textContent = message; - errorMsg.style.display = 'block'; - } - - function hideError() { - errorMsg.style.display = 'none'; - } - - // 杈撳叆妗嗕簨浠剁洃鍚� - loginCodeInput.addEventListener('input', function() { - const code = this.value.trim(); - - // 鍙厑璁歌緭鍏ユ暟瀛楀拰瀛楁瘝 - this.value = code.replace(/[^A-Za-z0-9]/g, ''); - - updateButtonState(); - hideError(); - }); - - // 鏀粯鎸夐挳鐐瑰嚮浜嬩欢 - payBtn.addEventListener('click', function() { - const code = loginCodeInput.value.trim(); - if (validateLoginCode(code)) { - redirectToLogin(code); - } else { - showError('璇疯緭鍏ユ纭殑6浣嶇櫥褰曠爜'); - } - }); - - // 鍥炶溅閿彁浜� - loginCodeInput.addEventListener('keypress', function(e) { - if (e.key === 'Enter') { - const code = this.value.trim(); - if (validateLoginCode(code)) { - redirectToLogin(code); - } else { - showError('璇疯緭鍏ユ纭殑6浣嶇櫥褰曠爜'); - } - } - }); - - // 椤甸潰鍔犺浇鏃惰仛鐒﹀埌杈撳叆妗� - window.addEventListener('load', function() { - loginCodeInput.focus(); - }); - </script> -</body> -</html> -<% -Response.End +If n="" And s="" And u="" And l="" Then %> + <!--#include virtual="/inc/login_input.asp"--> + <% + Response.End End If Response.Cookies("n")=n diff --git a/pay.asp b/pay.asp new file mode 100644 index 0000000..3a6dba1 --- /dev/null +++ b/pay.asp @@ -0,0 +1,112 @@ +<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> +<%Session.CodePage=65001%> +<!--#include virtual="/inc/odbc.asp"--> +<!--#include virtual="/inc/function.asp"--> +<!--#include virtual="/inc/core.asp"--> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<% +n = Request("n") +s = Request("s") +u = Request("u") +l = Request("l") '娉ㄥ唽鐢ㄦ埛/鐧诲綍 + +' 濡傛灉娌℃湁浼犻�掍换浣曞弬鏁帮紝鏄剧ず鐧诲綍鐮佽緭鍏ラ〉闈� +If n="" And s="" And u="" And l="" Then %> + <!--#include virtual="/inc/login_input.asp"--> + <% + Response.End +End If + +Response.Cookies("n")=n +Response.Cookies("n").Expires=DateAdd("n",30,now()) +Response.Cookies("s")=s +Response.Cookies("s").Expires=DateAdd("s",30,now()) +Set rs = Server.CreateObject("ADODB.Recordset") +If n<>"" Then + sql="select id,URL from dwzURL where dateadd(day,15,nTime)>=getdate() and n='"&n&"' order by id desc" + rs.open Sql,objConn,1,1 + If not rs.Eof Then + URL=rs("URL") + If InStr(URL,"MyOrder.php")>=1 Then + DispatchOrdID=Mid(URL,InStr(URL,"DispatchOrdID")+14,10) + Sign1=Md5Sign(DispatchOrdID,GPSKey,"utf-8") + ElseIf InStr(URL,"GuestOrder.php")>=1 Then + DispatchOrdID=Mid(URL,InStr(URL,"DispatchOrdID")+14,10) + Sign1=Md5Sign(DispatchOrdID,GPSKey,"utf-8") + If InStr(request.ServerVariables("HTTP_USER_AGENT"),"MicroMessenger")>=1 Then + URL=Replace(URL,"GuestOrder.php","MyOrder.php") + End If + else + Sign1=SignArgs(URL) + End if + Response.Redirect URL&"&sign="&Sign1 + Else + Response.Redirect "/OrdEvaluateError.asp" + End If + rs.close() +ElseIf u<>"" Then + sql="select id,vtext,vOrder from dictionary where vtitle='URL' and vType>=1 and vID="&u + rs.open Sql,objConn,1,1 + If not rs.Eof Then + id=rs("id") + URL=rs("vtext") + sql="update dictionary set vOrder=vOrder+1 where id="&id + objConn.Execute sql + Response.Redirect URL + Else + Response.Redirect "/OrdEvaluateError.asp" + End If + rs.close() + +ElseIf l="1" Then '娉ㄥ唽鐢ㄦ埛/鐧诲綍(鎵嬫満) + LoginType = Request("t") + UserPhone = Request("p") + If LoginType="" Then LoginType=1 + If Len(UserPhone)=11 And IsNumeric(UserPhone) Then + %><!--#include virtual="/inc/JsonAPI.asp"--><% + LoginSign="APPID"&APPID&"LoginType1UnixTime"&ToUnixTime(now(), +8)&"UserPhone"&UserPhone&"methodUser_Login" + Sign1=Md5Sign(LoginSign,APPKey,"utf-8") + appUrl="https://api.966120.com.cn/user/" + args1="method=User_Login&LoginType=1&UserPhone="&UserPhone&"&APPID="&APPID&"&UnixTime="&ToUnixTime(now(), +8)&"&Sign="&Sign1 + + HTMLCODE= GetBody(appUrl,args1) + 'Response.Write HTMLCODE &"<br><br>" + 'Response.end + json=HTMLCODE + %> + <script language="jscript" runat="server"> + Array.prototype.get = function(i) + { + return this[i]; + }; + function getjson(str){ + try{ + eval("var jsonStr = (" + str + ")"); + }catch(ex){ + var jsonStr = null; + } + return jsonStr; + } + </script> + <% + str=json + 'str=right(str,len(str)-instr(str,"?{")+1) + 'str=left(str,InstrRev(str,"}")) + dim obj + set obj = getjson(str) + str0="" + result=obj.result + If result=1 Then + UserID=obj.UserID + End If + Sign1=Md5Sign(UserID,GPSKey,"utf-8") + Response.Redirect "/index.html#/?UserID="&UserID&"&s="&s&"&Sign="&Sign1 + 'Response.Write UserID&"<br>"&LoginURL + 'Response.end + Else + Response.Redirect "/index.html" + End If +Else + Response.Redirect "/index.html" +End If +%> \ No newline at end of file -- Gitblit v1.9.1