feat: 初始化

This commit is contained in:
2024-04-09 11:34:46 +08:00
commit 39f3acc15f
3209 changed files with 253442 additions and 0 deletions
@@ -0,0 +1,3 @@
required=\u4E0D\u80FD\u4E3A\u7A7A
noMoreThan=\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7{max}\u4e2a\u5b57\u7b26
invalidNumber=\u4e0d\u662f\u6709\u6548\u7684\u6570\u503c
@@ -0,0 +1,8 @@
|------------------------------|
| ____ ____ ___ __ |
| | |_ | |_ | |_) ( (` |
| |_| |_|__ |_|_) _)_) |
| |
| ${spring.application.name} |
| Spring-Boot: ${spring-boot.version} |
|------------------------------|
@@ -0,0 +1,34 @@
spring:
profiles:
active: "@env-name@"
application:
name: Edu-Auth
cloud:
nacos:
config:
server-addr: ${nacos.url}
group: DEFAULT_GROUP
prefix: edu-auth
file-extension: yaml
discovery:
server-addr: ${nacos.url}
thymeleaf:
cache: false
logging:
level:
org:
springframework:
boot:
actuate:
endpoint:
EndpointId: error
com:
alibaba:
cloud:
nacos:
client:
NacosPropertySourceBuilder: error
nacos:
client:
naming: warn
@@ -0,0 +1,9 @@
febs.auth.enableJwt=false
febs.auth.jwtAccessKey=febs
febs.auth.socialLoginClientId=app
febs.auth.code.time=120
febs.auth.code.type=png
febs.auth.code.width=115
febs.auth.code.height=42
febs.auth.code.length=4
febs.auth.code.charType=2
@@ -0,0 +1,16 @@
<?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.yida.data.auth.mapper.MenuMapper">
<select id="findUserPermissions" resultType="java.lang.String">
select distinct m.perms
from t_role r
left join t_user_role ur on (r.role_id = ur.role_id)
left join t_user u on (u.user_id = ur.user_id)
left join t_role_menu rm on (rm.role_id = r.role_id)
left join t_menu m on (m.menu_id = rm.menu_id)
where u.username = #{userName}
and m.perms is not null
and m.perms &lt;&gt; ''
</select>
</mapper>
@@ -0,0 +1,72 @@
<?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.yida.data.auth.mapper.UserMapper">
<select id="findByName" parameterType="string"
resultType="com.yida.data.common.core.entity.system.SystemUser">
SELECT u.user_id userId,
u.username,
u.nickname,
u.email,
u.mobile,
u.password,
u.status,
u.create_time createTime,
u.ssex sex,
u.dept_id deptId,
u.last_login_time lastLoginTime,
u.modify_time modifyTime,
u.description,
u.avatar,
d.dept_type deptType,
d.school_nature schoolNature,
d.dept_name deptName,
u.agent_id agentId,
GROUP_CONCAT(r.role_id) roleId,
GROUP_CONCAT(r.ROLE_NAME) roleName,
GROUP_CONCAT( r.ROLE_PERMS ) rolePerms,
u.create_id,
u.create_dept_id,
u.main_dept_id,
u.open_id
FROM t_user u
LEFT JOIN t_dept d ON (u.dept_id = d.dept_id)
LEFT JOIN t_user_role ur ON (u.user_id = ur.user_id)
LEFT JOIN t_role r ON r.role_id = ur.role_id
WHERE u.username = #{username}
group by u.username, u.user_id, u.email, u.mobile, u.password, u.status, u.create_time, u.ssex,
u.dept_id
, u.last_login_time, u.modify_time, u.description, u.avatar
</select>
<select id="findUserDataPermissions" parameterType="long"
resultType="com.yida.data.common.core.entity.system.UserDataPermission">
select user_id userId, dept_id deptId
from t_user_data_permission
where user_id = #{userId}
</select>
<select id="listUserByPerms" resultType="com.yida.data.common.core.entity.system.SystemUser">
select a.*
from t_user a left join t_user_role b on a.USER_ID=b.USER_ID
left join t_role c on b.ROLE_ID=c.ROLE_ID
where c.ROLE_PERMS=#{perms}
<if test="deptId != null">
and a.DEPT_ID=#{deptId}
</if>
order by a.USER_ID
</select>
<!-- 查询主角色code字符串 -->
<select id="findMainRole"
resultType="java.lang.String">
SELECT
distinct
r.ROLE_PERMS
FROM
t_user u
INNER JOIN t_user_role ur ON u.USER_ID = ur.USER_ID
INNER JOIN t_role r ON ur.ROLE_ID = r.ROLE_ID
WHERE
u.DEPT_ID = #{mainDeptId}
</select>
</mapper>
@@ -0,0 +1,14 @@
<?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.yida.data.auth.mapper.UserMenuMapper">
<select id="findUserPermissions" resultType="com.yida.data.common.core.entity.system.SystemUserMenu">
select um.*, m.perms
from t_user_menu um
left join t_user u on (u.user_id = um.user_id)
left join t_menu m on (m.menu_id = um.menu_id)
where u.username = #{userName}
and m.perms is not null
and m.perms <![CDATA[!=]]> ''
</select>
</mapper>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
*{box-sizing:border-box;margin:0;padding:0;font-weight:600;}body{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Hiragino Sans GB','WenQuanYi Micro Hei',sans-serif;color:white;font-weight:600;}body::-webkit-input-placeholder{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Hiragino Sans GB','WenQuanYi Micro Hei',sans-serif;color:white;font-weight:600;}body:-moz-placeholder{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Hiragino Sans GB','WenQuanYi Micro Hei',sans-serif;color:white;opacity:1;font-weight:600;}body::-moz-placeholder{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Hiragino Sans GB','WenQuanYi Micro Hei',sans-serif;color:white;opacity:1;font-weight:600;}body:-ms-input-placeholder{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,'PingFang SC','Source Han Sans CN','Source Han Sans','Hiragino Sans GB','WenQuanYi Micro Hei',sans-serif;color:white;font-weight:600;}.wrapper{background-image:linear-gradient(120deg,#e0c3fc 0%,#8ec5fc 100%);position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.wrapper.form-success .container h1{-webkit-transform:translateY(85px);transform:translateY(85px);}.container{max-width:600px;margin:0 auto;padding:200px 0;height:400px;text-align:center;}.container h1{font-size:30px;-webkit-transition-duration:1s;transition-duration:1s;-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;font-weight:500;}form{padding:20px 0;position:relative;z-index:2;}form input{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;border:1px solid rgba(255,255,255,0.4);background-color:rgba(255,255,255,0.2);width:300px;border-radius:3px;padding:10px 15px;margin:0 auto 15px auto;display:block;text-align:center;font-size:18px;color:white;-webkit-transition-duration:0.25s;transition-duration:0.25s;font-weight:600;}form input:hover{background-color:rgba(255,255,255,0.4);}form input:focus{background-color:white;width:350px;color:#a6b1e1;}form button{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;background-color:white;border:0;padding:10px 15px;color:#a6b1e1;border-radius:3px;width:300px;cursor:pointer;font-size:18px;-webkit-transition-duration:0.25s;transition-duration:0.25s;}form button:hover{background-color:#f5f7f9;}.bg-bubbles{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;}.bg-bubbles li{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:rgba(255,255,255,0.15);bottom:-160px;-webkit-animation:square 25s infinite;animation:square 25s infinite;-webkit-transition-timing-function:linear;transition-timing-function:linear;}.bg-bubbles li:nth-child(1){left:10%;}.bg-bubbles li:nth-child(2){left:20%;width:80px;height:80px;-webkit-animation-delay:2s;animation-delay:2s;-webkit-animation-duration:17s;animation-duration:17s;}.bg-bubbles li:nth-child(3){left:25%;-webkit-animation-delay:4s;animation-delay:4s;}.bg-bubbles li:nth-child(4){left:40%;width:60px;height:60px;-webkit-animation-duration:22s;animation-duration:22s;background-color:rgba(255,255,255,0.25);}.bg-bubbles li:nth-child(5){left:70%;}.bg-bubbles li:nth-child(6){left:80%;width:120px;height:120px;-webkit-animation-delay:3s;animation-delay:3s;background-color:rgba(255,255,255,0.2);}.bg-bubbles li:nth-child(7){left:32%;width:160px;height:160px;-webkit-animation-delay:7s;animation-delay:7s;}.bg-bubbles li:nth-child(8){left:55%;width:20px;height:20px;-webkit-animation-delay:15s;animation-delay:15s;-webkit-animation-duration:40s;animation-duration:40s;}.bg-bubbles li:nth-child(9){left:25%;width:10px;height:10px;-webkit-animation-delay:2s;animation-delay:2s;-webkit-animation-duration:40s;animation-duration:40s;background-color:rgba(255,255,255,0.3);}.bg-bubbles li:nth-child(10){left:90%;width:160px;height:160px;-webkit-animation-delay:11s;animation-delay:11s;}@-webkit-keyframes square{0%{-webkit-transform:translateY(0);transform:translateY(0);}100%{-webkit-transform:translateY(-700px) rotate(600deg);transform:translateY(-700px) rotate(600deg);}}@keyframes square{0%{-webkit-transform:translateY(0);transform:translateY(0);}100%{-webkit-transform:translateY(-700px) rotate(600deg);transform:translateY(-700px) rotate(600deg);}}
@@ -0,0 +1 @@
$(function(){var a=$("#username"),b=$("#password");$("#login").on("click",function(c){var d,e;return c.preventDefault(),d=a.val().trim(),e=b.val().trim(),""===d?(alert("用户名不能为空"),void 0):""===e?(alert("密码不能为空"),void 0):($.post(ctx+"login",{username:d,password:e},function(a){window.location.href=a.data}).error(function(a){console.error(a),alert(a.responseJSON.message)}),void 0)})});
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="ch" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
name="viewport">
<meta content="ie=edge" http-equiv="X-UA-Compatible">
<link rel="icon" th:href="@{resource/favicon.ico}" type="image/x-icon"/>
<title>第三方登录失败</title>
</head>
<style>
span{font-size:.9rem;font-weight:bold;color:#42b983}
</style>
<body>
<span>[[${error}]]</span>
</body>
</html>
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="ch" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
name="viewport">
<meta name="description" content="FEBS Cloud授权码模式登录页面">
<meta name="author" content="MrBird">
<link rel="stylesheet" th:href="@{resource/login.min.css}" media="all">
<script th:src="@{resource/jQuery-2.1.4.min.js}"></script>
<link rel="icon" th:href="@{resource/favicon.ico}" type="image/x-icon"/>
<title>FEBS系统登录</title>
</head>
<body>
<div class="wrapper">
<div class="container"><h1>FEBS 系统登录</h1>
<form class="form"><input type="text" placeholder="用户名" id="username"><input type="password" placeholder="密码"
id="password">
<button type="submit" id="login">登录</button>
</form>
</div>
<ul class="bg-bubbles">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
<script th:inline="javascript">
var ctx = [[@{/}]];
</script>
<script th:src="@{resource/login.min.js}"></script>
</html>
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="ch" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
name="viewport">
<meta content="ie=edge" http-equiv="X-UA-Compatible">
<link rel="icon" th:href="@{resource/favicon.ico}" type="image/x-icon"/>
<title>登录跳转中</title>
</head>
<body>
登录中..
<script th:inline="javascript">
var response = [[${response}]];
var frontUrl = [[${frontUrl}]];
window.onload = function () {
window.opener.postMessage(response, frontUrl);
window.close();
}
</script>
</body>
</html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<a
href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwbbc43a5b210ddb23&redirect_uri=http%3A%2F%2Fzbz.yd-data.com%3A8301%2Fauth%2Ftest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect">test</a>
</body>
</html>