Merge refs/remotes/origin/master into refs/heads/master

master
zjh19990323 6 years ago
commit 2519da14e9

@ -1,7 +1,11 @@
<form bindsubmit="formSubmit" > <form bindsubmit="formSubmit" >
<view class="container"> <view class="container">
<view class="login-icon"> <view class="login-icon">
<<<<<<< HEAD
<image class="login-img" src="../images/123.jpg"></image>
=======
<image class="login-img" src="../image/123.jpg"></image> <image class="login-img" src="../image/123.jpg"></image>
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6
</view> </view>
<view class="login-from"> <view class="login-from">
@ -20,7 +24,11 @@
</view> </view>
<!--按钮--> <!--按钮-->
<view class="loginBtnView"> <view class="loginBtnView">
<<<<<<< HEAD
<button class="loginBtn" size="{{primarySize}}" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="login" formType="submit">登录</button>
=======
<button class="loginBtn" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="login" formType="submit">登录</button> <button class="loginBtn" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="login" formType="submit">登录</button>
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6
</view> </view>
</view> </view>
</view> </view>

@ -48,7 +48,11 @@ page{
text-align: right; text-align: right;
margin-right: 22px; margin-right: 22px;
margin-top: 11px; margin-top: 11px;
<<<<<<< HEAD
color: #cccccc;
=======
color: #000; color: #000;
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6
font-size: 14px font-size: 14px
} }
@ -62,7 +66,11 @@ page{
.loginBtnView { .loginBtnView {
width: 100%; width: 100%;
height: auto; height: auto;
<<<<<<< HEAD
background-color: rgb(253,253,65);
=======
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6
margin-top: 0px; margin-top: 0px;
margin-bottom: 0px; margin-bottom: 0px;
padding-bottom: 0px; padding-bottom: 0px;
@ -71,5 +79,8 @@ page{
.loginBtn { .loginBtn {
width: 80%; width: 80%;
margin-top: 35px; margin-top: 35px;
<<<<<<< HEAD
=======
background-color:rgb(253, 153, 65); background-color:rgb(253, 153, 65);
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6
} }

@ -1,56 +1,115 @@
package controller; <<<<<<< HEAD
package controller;
import java.io.IOException;
import java.io.Writer; import java.io.IOException;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import service.LoginService;
import domain.UserPO; import service.LoginService;
import domain.UserPO;
@Controller
public class LoginController { @Controller
@Autowired@Qualifier("LoginServiceImpl") public class LoginController {
private LoginService loginService; @Autowired@Qualifier("LoginServiceImpl")
@RequestMapping("/login") private LoginService loginService;
public void login(int userid, int userpassword, @RequestMapping("/login")
HttpServletRequest request, HttpServletResponse response) throws IOException { public void login(int s_id, int s_password,
UserPO userPO=this.loginService.FindByUserid(userid); HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("text/html;charset=utf-8"); UserPO userPO=this.loginService.FindByUserid(s_id);
/* 设置响应头允许ajax跨域访问 */ response.setContentType("text/html;charset=utf-8");
response.setHeader("Access-Control-Allow-Origin", "*"); /* 设置响应头允许ajax跨域访问 */
/* 星号表示所有的异域请求都可以接受, */ response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "GET,POST"); /* 星号表示所有的异域请求都可以接受, */
System.out.println(userid); response.setHeader("Access-Control-Allow-Methods", "GET,POST");
if(userPO!=null) System.out.println(s_id);
if(userpassword==userPO.getUserpassword()) if(userPO!=null)
{ if(s_password==userPO.getUserpassword())
System.out.println("密码正确"); {
Writer out = response.getWriter(); System.out.println("密码正确");
out.write("111"); Writer out = response.getWriter();
out.flush(); out.write("111");
} out.flush();
}
else{
System.out.println("密码错误"); else{
Writer out = response.getWriter(); System.out.println("密码错误");
out.write("100"); Writer out = response.getWriter();
out.flush(); out.write("100");
} out.flush();
else{ }
System.out.println("不存在用户名"); else{
Writer out = response.getWriter(); System.out.println("不存在用户名");
out.write("001"); Writer out = response.getWriter();
out.flush(); out.write("001");
} out.flush();
}
}
} }
}
=======
package controller;
import java.io.IOException;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import service.LoginService;
import domain.UserPO;
@Controller
public class LoginController {
@Autowired@Qualifier("LoginServiceImpl")
private LoginService loginService;
@RequestMapping("/login")
public void login(int userid, int userpassword,
HttpServletRequest request, HttpServletResponse response) throws IOException {
UserPO userPO=this.loginService.FindByUserid(userid);
response.setContentType("text/html;charset=utf-8");
/* 设置响应头允许ajax跨域访问 */
response.setHeader("Access-Control-Allow-Origin", "*");
/* 星号表示所有的异域请求都可以接受, */
response.setHeader("Access-Control-Allow-Methods", "GET,POST");
System.out.println(userid);
if(userPO!=null)
if(userpassword==userPO.getUserpassword())
{
System.out.println("密码正确");
Writer out = response.getWriter();
out.write("111");
out.flush();
}
else{
System.out.println("密码错误");
Writer out = response.getWriter();
out.write("100");
out.flush();
}
else{
System.out.println("不存在用户名");
Writer out = response.getWriter();
out.write("001");
out.flush();
}
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,29 +1,61 @@
package domain; <<<<<<< HEAD
package domain;
import java.io.Serializable;
import java.io.Serializable;
public class UserPO implements Serializable{
private int userid; public class UserPO implements Serializable{
private int userpassword; private int s_id;
private String username; private int userpassword;
public int getUserid() { private String username;
return userid; public int getUserid() {
} return userid;
public void setUserid(int userid) { }
this.userid = userid; public void setUserid(int userid) {
} this.userid = userid;
public int getUserpassword() { }
return userpassword; public int getUserpassword() {
} return userpassword;
public void setUserpassword(int userpassword) { }
this.userpassword = userpassword; public void setUserpassword(int userpassword) {
} this.userpassword = userpassword;
public String getUsername() { }
return username; public String getUsername() {
} return username;
public void setUsername(String username) { }
this.username = username; public void setUsername(String username) {
} this.username = username;
}
}
}
=======
package domain;
import java.io.Serializable;
public class UserPO implements Serializable{
private int userid;
private int userpassword;
private String username;
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public int getUserpassword() {
return userpassword;
}
public void setUserpassword(int userpassword) {
this.userpassword = userpassword;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,12 +1,27 @@
package mapperDAO; <<<<<<< HEAD
package mapperDAO;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Repository;
import domain.UserPO;
import domain.UserPO;
@Repository("UserDAO")
public interface UserDAO { @Repository("UserDAO")
public UserPO FindByUserid(int userid); public interface UserDAO {
public UserPO FindByUserid(int s_id);
}
}
=======
package mapperDAO;
import org.springframework.stereotype.Repository;
import domain.UserPO;
@Repository("UserDAO")
public interface UserDAO {
public UserPO FindByUserid(int userid);
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,8 +1,19 @@
package service; <<<<<<< HEAD
package service;
import domain.UserPO;
import domain.UserPO;
public interface LoginService{
public interface LoginService{
public UserPO FindByUserid(int userid);
} public UserPO FindByUserid(int s_id);
}
=======
package service;
import domain.UserPO;
public interface LoginService{
public UserPO FindByUserid(int userid);
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

@ -1,22 +1,47 @@
package serviceimpl; <<<<<<< HEAD
package serviceimpl;
import mapperDAO.UserDAO;
import mapperDAO.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import domain.UserPO;
import service.LoginService; import domain.UserPO;
import service.LoginService;
@Component("LoginServiceImpl")
public class LoginServiceImpl implements LoginService{ @Component("LoginServiceImpl")
@Autowired@Qualifier("UserDAO") public class LoginServiceImpl implements LoginService{
private UserDAO userDAO; @Autowired@Qualifier("UserDAO")
private UserDAO userDAO;
public UserPO FindByUserid(int userid){
return this.userDAO.FindByUserid(userid); public UserPO FindByUserid(int s_id){
} return this.userDAO.FindByUserid(s_id);
}
}
}
=======
package serviceimpl;
import mapperDAO.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import domain.UserPO;
import service.LoginService;
@Component("LoginServiceImpl")
public class LoginServiceImpl implements LoginService{
@Autowired@Qualifier("UserDAO")
private UserDAO userDAO;
public UserPO FindByUserid(int userid){
return this.userDAO.FindByUserid(userid);
}
}
>>>>>>> 0877d8ad681d47bc72cd343cd73f8dfb7321c3b6

Loading…
Cancel
Save