favicon.ico

This commit is contained in:
裴浩宇 2020-01-06 18:26:08 +08:00
parent ad03b6617d
commit e05ad8a2e3
14 changed files with 245 additions and 31 deletions

22
pom.xml
View File

@ -100,6 +100,28 @@
</includes>
</resource>
</resources>
<!--<resources>-->
<!--<resource>-->
<!--<directory>src/main/webapp</directory>-->
<!--</resource>-->
<!--<resource>-->
<!--<directory>src/main/java</directory>-->
<!--<includes>-->
<!--<include>**/*.*</include>-->
<!--</includes>-->
<!--<excludes>-->
<!--<exclude>**/*.java</exclude>-->
<!--</excludes>-->
<!--<filtering>false</filtering>-->
<!--</resource>-->
<!--<resource>-->
<!--<directory>src/main/resources</directory>-->
<!--<includes>-->
<!--<include>**/*.*</include>-->
<!--</includes>-->
<!--<filtering>false</filtering>-->
<!--</resource>-->
<!--</resources>-->
</build>

View File

@ -1,8 +1,9 @@
package com.phy.ebuy;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@MapperScan(basePackages = {"com.phy.ebuy.dao"})
@SpringBootApplication
public class EbuyApplication {

View File

@ -1,14 +1,42 @@
package com.phy.ebuy.controller;
import com.phy.ebuy.service.EbuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/ebuy")
public class EbuyController {
@Autowired
private EbuyService ebuyService;
//跳转登录页面
@RequestMapping("/login")
public String login() {
return "/login.html";
}
//验证登录
@ResponseBody
@RequestMapping("/verifyLogin")
public Map<String,Object> verifyLogin(@RequestParam("userName")String userName,@RequestParam("passWord")String passWord) {
//参数
Map<String,Object> parameter = new HashMap<>();
parameter.put("userName",userName);
parameter.put("passWord",passWord);
//返回结果
Map<String,Object> result = null;
try {
result = ebuyService.verifyLogin(parameter);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
}

View File

@ -0,0 +1,14 @@
package com.phy.ebuy.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Map;
@Mapper
public interface EbuyMapper {
/**
* 验证登录
*/
Map<String,Object> verifyLogin(Map<String,Object> map);
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phy.ebuy.dao.EbuyMapper">
<!--验证登录-->
<select id="verifyLogin" parameterType="map" resultType="map" >
select * from ebuy_user where (user_name = #{userName} and pass_word = #{passWord})
or (mobile = #{userName} and pass_word = #{passWord})
</select>
</mapper>

View File

@ -0,0 +1,11 @@
package com.phy.ebuy.service;
import java.util.HashMap;
import java.util.Map;
public interface EbuyService{
/**
* 验证登录
*/
Map<String,Object> verifyLogin(Map<String,Object> parameter);
}

View File

@ -0,0 +1,22 @@
package com.phy.ebuy.service.impl;
import com.phy.ebuy.dao.EbuyMapper;
import com.phy.ebuy.service.EbuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class EbuyServiceImpl implements EbuyService {
/**
* 验证登录
*/
@Autowired
private EbuyMapper ebuyMapper;
public Map<String,Object> verifyLogin(Map<String,Object> parameter) {
//返回结果
Map<String, Object> result = ebuyMapper.verifyLogin(parameter);
return result;
}
}

View File

@ -41,9 +41,9 @@ spring:
############################## mybatis-plus配置 开始 ##############################
mybatis-plus:
mapper-locations: classpath*:com/**/mapping/*.xml
typeAliasesPackage: com.jxdinfo.hussar.**.model,com.xxxx.**.model
typeEnumsPackage: com.jxdinfo.hussar.common.constant.enums
mapper-locations: classpath*:com/phy/ebuy/dao/mapping/*.xml
typeAliasesPackage: com.phy.ebuy.model
global-config:
id-type: 3 # 0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
db-column-underline: false

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>E-BUY - 买你想买</title>
</head>
<body>
</body>
</html>

View File

@ -4,11 +4,18 @@
<meta charset="UTF-8">
<title>登录页面</title>
<link rel="stylesheet" href="../../static/css/login.css">
<link rel="shortcut icon" type="image/x-icon" href="../../static/img/favicon.ico" rel="external nofollow" />
<link rel="stylesheet" href="../../static/layui/css/layui.css">
<script src="../../static/layui/layui.all.js"></script>
</head>
<body>
<div class="head">
<div class="log">
<div class="log"></div>
<div class="login-msg error">
<p class="error">
为确保您账户的安全及正常使用依《网络安全法》相关要求6月1日起会员账户需绑定手机。如您还未绑定请尽快完成感谢您的理解及支持
</p>
</div>
</div>
<div class="middle">
@ -16,23 +23,30 @@
<div class="login-title">
账户登录
</div>
<form action="" method="post">
<div class="form">
<div class="userName">
<img class="ico1">
<input class="input1" type="text" placeholder="用户名">
<div class="ico1"></div>
<input id="userName" class="input1" type="text" name="userName" placeholder="用户名/手机号">
</div>
<div class="passWord">
<img class="ico2">
<input class="input1" type="password" placeholder="密码">
<div class="ico2"></div>
<input id="passWord" class="input1" type="password" name="passWord" placeholder="密码">
</div>
<button class="login-btu" type="submit">
登 录
</button>
</form>
</div>
<div class="function">
<div class="forget-password">忘记密码</div>
<div class="register">免费注册</div>
</div>
</div>
</div>
<div class="bottom">
</div>
</body>
<script src="../../static/js/jquery-1.12.2.js"></script>
<script src="../../static/js/login.js"></script>
<script src="../../static/layui/layui.js"></script>
</html>

View File

@ -14,6 +14,36 @@ body{
}
.head{
flex: 1;
display: flex;
}
.head .log{
background: url("../img/E-Buy2.png");
background-repeat: no-repeat;
background-size: 80% 50%;
-moz-background-size: 80% 80%;
background-position: center;
height: 100%;
width: 10%;
margin-left: 8%;
}
.head .login-msg{
text-align: center;
width: 880px;
background-color: #fef2f2;
color: #6C6C6C;
line-height: 16px;
padding: 6px 10px;
overflow: hidden;
background: #fef2f2;
border: 1px solid #ffb4a8;
font-size: 0.8em;
height: 1em;
margin: auto;
margin-left: 40px;
}
.head .login-msg error .error{
float: none;
width: auto;
}
.middle{
flex: 8;
@ -27,7 +57,7 @@ body{
margin-left: 65%;
width: 20%;
height: 42%;
background: #E9E9F2;
background: #FFF3E6;
padding: 1em;
}
.middle .login-box .login-title{
@ -39,52 +69,80 @@ body{
padding-bottom: 8px;
font-weight: 700;
}
.middle .login-box form .userName{
.middle .login-box .form .userName{
height: 2.5em;
width: 90%;
background: white;
margin: 0 auto;
margin-top: 1em;
}
.middle .login-box form .userName .ico1{
.middle .login-box .form .userName .ico1{
background-color: #ddd;
width: 40px;
float: left;
height: 100%;
background-size: 100% 100%;
background: url("../img/person.png");
background-image:url("../img/person.png");
background-repeat:no-repeat;
background-size:80% 80%;
-moz-background-size:80% 80%;
background-position: center;
}
.middle .login-box form .passWord .ico2{
.middle .login-box .form .passWord .ico2{
background-color: #ddd;
width: 40px;
float: left;
height: 100%;
background-size: 100% 100%;
background: url("../img/password.png");
background-image:url("../img/password.png");
background-repeat:no-repeat;
background-size:80% 80%;
-moz-background-size:80% 80%;
background-position: center;
}
.middle .login-box form .input1{
padding: 10px 10px 10px 10px;
.middle .login-box .form .input1{
padding: 9px 10px 9px 10px;
height: 50%;
width: calc(100% - 60px);
width: calc(100% - 62px);
background: white;
border: none;
border: 1px solid #ddd;
}
.middle .login-box form .passWord{
.middle .login-box .form .passWord{
height: 2.5em;
width: 90%;
background: white;
margin: 0 auto;
margin-top: 1em;
}
.middle .login-box form .login-btu{
display: block;
.middle .login-box .form .login-btu{
height: 3em;
width: 90%;
background: #FBBE6E;
margin: 0 auto;
margin-top: 1em;
font-weight:bold;
color: #5E5E5E;
border-radius: 10%;
letter-spacing: 15px;
border: 0;
display: block;
overflow: hidden;
vertical-align: middle;
line-height: 42px;
font-weight: 700;
color: #fff;
background: #f40;
border-radius: 3px;
cursor: pointer;
zoom: 1;
}
.middle .login-box .function{
color: #6C6C6C;
margin-top: 1em;
display: flex;
font-size: 0.8em;
width: 60%;
float: right;
}
.middle .login-box .function .forget-password{
flex: 1;
}
.middle .login-box .function .register{
flex: 1;
}
.bottom{
flex: 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -0,0 +1,23 @@
layui.use(['layer',"jquery"], function() {
const layer = layui.layer
,$ = layui.jquery;
$(".login-btu").on("click", function () {
//登录验证
$.ajax({
url: "/ebuy/verifyLogin",
type: "post",
data: {
userName: $("#userName").val(),
passWord: $("#passWord").val()
},
dataType: "json",
success: function (data) {
console.log(data);
},
error: function () {
layer.msg("你输入的密码和账户名不匹配!")
}
})
})
})