一、思维导图
二、项目部署
1、在tomcat中的webapps文件中加入mvc.w
2、在tomcat的bin目录下运行startup.bat
3、在webapps文件中的MVC中复制文件
三、权限登录
商家与买家所登录看到的界面不一致
1、登录方法/注册
①、用户实体类
package com.dhm.entity;
public class User {
private long id;
private String name;
private String pwd;
private int type;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
@Override
public String toString() {
return "User [id=" + id + ", name=" + name + ", pwd=" + pwd + ", type=" + type + "]";
}
}
②、UserDao
package com.dhm.dao;
import java.util.List;
import com.dhm.entity.User;
import com.zking.util.BaseDao;
public class UserDao extends BaseDao<User>{
// 登录的方法,看数据库里能不能查到这个用户
public User login(User user) throws Exception {
String sql="select * from t_easyui_user where name='"+user.getName()+"' and pwd='"+user.getPwd()+"'";
return super.executeQuery(sql,User.class, null).get(0);
}
// 增加用户的方法
public void add(User user) throws Exception {
String sql="insert into t_easyui_user(name,pwd) values(?,?)";
super.executeUpdate(sql, user, new String[] {"name","pwd"});
}
// public List<User> list(String sql, Class<User> clz, PageBean pageBean) throws Exce