📄 logon_action.jsp
字号:
<%@ page language="java" contentType="text/vnd.wap.wml; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.wap.common.db.DBObject" %>
<%
request.setCharacterEncoding("UTF-8");
//System.out.println("访问时间2logon_action:"+ new java.util.Date().getTime() );
String nocache= String.valueOf(new java.util.Date().getTime())+"_time";
%>
<%
String operStr = "";
try{
//获取参数
String request_type = request.getParameter("request_type");
String userid = request.getParameter("userid");//主叫方
String password = request.getParameter("password");
request_type = request_type == null ? "" : request_type.trim();
userid = userid==null? "" : userid.trim();
password = password==null? "" : password.trim();
//System.out.println("______登陆密码,编码前_____");
//System.out.println("userid:"+userid);
//System.out.println("password:"+password);
//System.out.println("----------------------");
//userid = new String(userid.getBytes("ISO8859-1"),"UTF-8");
//password = new String(password.getBytes("ISO8859-1"),"UTF-8");
//System.out.println("______登陆密码,编码后_____");
//System.out.println("userid:"+userid);
//System.out.println("password:"+password);
//System.out.println("----------------------");
java.util.ArrayList list = null;
//验证登陆用户名/密码
if(userid != null && !userid.equals("") && password != null && !password.equals("")){
com.wap.common.db.DBObject db = new com.wap.common.db.DBObject();
String sql = "select id from manycall_user where users = '" + userid +"'"+
" and pwd='"+password+"'";
//boolean bLogin = db.executeQuery(sql);
//System.out.println("登陆的SQL:"+sql);
list = (java.util.ArrayList)db.executeQueryAndRetrieveList(sql);
if(list != null && list.size() > 0){ //登陆成功
int id = ((DBObject)list.get(0)).getFieldInt("id");
long key = (new java.util.Date()).getTime()/(1000*60*60*24); //对ID进行简单的加密。(每小时密钥就会更新一次)
//System.out.println("登陆时的密咬:"+key);
key = key + id;
String url = "main.jsp?id=" + key;
response.sendRedirect(url);
}else{
operStr ="用户名或密码出错,请重试!";
}
}else{
operStr ="用户名,密码不能为空!";
}
}catch(Exception e){
operStr="系统出现故障,请检查!";
e.printStackTrace();
}
%>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=3600"/>
<meta equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<card id='mainCard' title='118166多方通话' >
<p align='center'><strong>118166多方通话</strong></p>
<p>
<%=operStr %>
</p>
<p>
<anchor>返回<go href='index.jsp?nocache=<%=nocache %>' sendreferer='true'></go></anchor>
</p>
</card>
</wml>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -