Commit 8450d3df4e43b2620b634ac284c2b2a12915eb9a
1 parent
f9da001a
Jeecg-Boot 2.1.4 版本发布 (新版问题修复)
Showing
6 changed files
with
35 additions
and
18 deletions
ant-design-vue-jeecg/src/assets/checkcode.png
0 → 100644
2.19 KB
ant-design-vue-jeecg/src/views/user/Login.vue
@@ -9,16 +9,16 @@ | @@ -9,16 +9,16 @@ | ||
9 | <a-form-item> | 9 | <a-form-item> |
10 | <a-input | 10 | <a-input |
11 | size="large" | 11 | size="large" |
12 | - v-decorator="['username',{initialValue:'admin', rules: validatorRules.username.rules}]" | 12 | + v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]" |
13 | type="text" | 13 | type="text" |
14 | - placeholder="请输入帐户名 / jeecg"> | 14 | + placeholder="请输入帐户名 / admin"> |
15 | <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/> | 15 | <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/> |
16 | </a-input> | 16 | </a-input> |
17 | </a-form-item> | 17 | </a-form-item> |
18 | 18 | ||
19 | <a-form-item> | 19 | <a-form-item> |
20 | <a-input | 20 | <a-input |
21 | - v-decorator="['password',{initialValue:'123456', rules: validatorRules.password.rules}]" | 21 | + v-decorator="['password',validatorRules.password]" |
22 | size="large" | 22 | size="large" |
23 | type="password" | 23 | type="password" |
24 | autocomplete="false" | 24 | autocomplete="false" |
@@ -41,7 +41,8 @@ | @@ -41,7 +41,8 @@ | ||
41 | </a-form-item> | 41 | </a-form-item> |
42 | </a-col> | 42 | </a-col> |
43 | <a-col :span="8" style="text-align: right"> | 43 | <a-col :span="8" style="text-align: right"> |
44 | - <img style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/> | 44 | + <img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/> |
45 | + <img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/> | ||
45 | <!--<j-graphic-code @success="generateCode" ref="jgraphicCodeRef" style="float: right" remote></j-graphic-code>--> | 46 | <!--<j-graphic-code @success="generateCode" ref="jgraphicCodeRef" style="float: right" remote></j-graphic-code>--> |
46 | </a-col> | 47 | </a-col> |
47 | </a-row> | 48 | </a-row> |
@@ -217,7 +218,8 @@ | @@ -217,7 +218,8 @@ | ||
217 | currentUsername:"", | 218 | currentUsername:"", |
218 | validate_status:"", | 219 | validate_status:"", |
219 | currdatetime:'', | 220 | currdatetime:'', |
220 | - randCodeImage:'' | 221 | + randCodeImage:'', |
222 | + requestCodeSuccess:false | ||
221 | } | 223 | } |
222 | }, | 224 | }, |
223 | created () { | 225 | created () { |
@@ -346,9 +348,13 @@ | @@ -346,9 +348,13 @@ | ||
346 | getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{ | 348 | getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{ |
347 | if(res.success){ | 349 | if(res.success){ |
348 | this.randCodeImage = res.result | 350 | this.randCodeImage = res.result |
351 | + this.requestCodeSuccess=true | ||
349 | }else{ | 352 | }else{ |
350 | this.$message.error(res.message) | 353 | this.$message.error(res.message) |
354 | + this.requestCodeSuccess=false | ||
351 | } | 355 | } |
356 | + }).catch(()=>{ | ||
357 | + this.requestCodeSuccess=false | ||
352 | }) | 358 | }) |
353 | }, | 359 | }, |
354 | loginSuccess () { | 360 | loginSuccess () { |
ant-design-vue-jeecg/vue.config.js
@@ -30,6 +30,14 @@ module.exports = { | @@ -30,6 +30,14 @@ module.exports = { | ||
30 | .set('@comp', resolve('src/components')) | 30 | .set('@comp', resolve('src/components')) |
31 | .set('@views', resolve('src/views')) | 31 | .set('@views', resolve('src/views')) |
32 | .set('@layout', resolve('src/layout')) | 32 | .set('@layout', resolve('src/layout')) |
33 | + | ||
34 | + // 配置 webpack 识别 markdown 为普通的文件 | ||
35 | + config.module | ||
36 | + .rule('markdown') | ||
37 | + .test(/\.md$/) | ||
38 | + .use() | ||
39 | + .loader('file-loader') | ||
40 | + .end() | ||
33 | }, | 41 | }, |
34 | 42 | ||
35 | css: { | 43 | css: { |
jeecg-boot/db/2jeecgboot_mysql5.7.sql
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysPermissionMapper.xml
@@ -44,15 +44,18 @@ | @@ -44,15 +44,18 @@ | ||
44 | SELECT * FROM ( | 44 | SELECT * FROM ( |
45 | SELECT p.* | 45 | SELECT p.* |
46 | FROM sys_permission p | 46 | FROM sys_permission p |
47 | - WHERE exists( | ||
48 | - select a.id from sys_role_permission a | ||
49 | - join sys_role b on a.role_id = b.id | ||
50 | - join sys_user_role c on c.role_id = b.id | ||
51 | - join sys_user d on d.id = c.user_id | ||
52 | - where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR} | ||
53 | - ) | 47 | + WHERE (exists( |
48 | + select a.id from sys_role_permission a | ||
49 | + join sys_role b on a.role_id = b.id | ||
50 | + join sys_user_role c on c.role_id = b.id | ||
51 | + join sys_user d on d.id = c.user_id | ||
52 | + where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR} | ||
53 | + ) | ||
54 | + <!--update begin Author:taoyan Date:20200225 for:默认授权online的auto动态隐藏路由 --> | ||
55 | + or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1) ) | ||
56 | + <!--update end Author:taoyan Date:20200213 for:默认授权online的auto动态隐藏路由 --> | ||
54 | and p.del_flag = 0 | 57 | and p.del_flag = 0 |
55 | - <!--update begin Author:lvdandan Date:20200213 for:加入部门权限 --> | 58 | + <!--update begin Author:lvdandan Date:20200225 for:加入部门权限 --> |
56 | UNION | 59 | UNION |
57 | SELECT p.* | 60 | SELECT p.* |
58 | FROM sys_permission p | 61 | FROM sys_permission p |
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/RandImageUtil.java
1 | package org.jeecg.modules.system.util; | 1 | package org.jeecg.modules.system.util; |
2 | 2 | ||
3 | -import sun.misc.BASE64Encoder; | ||
4 | - | ||
5 | import javax.imageio.ImageIO; | 3 | import javax.imageio.ImageIO; |
6 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
7 | import java.awt.*; | 5 | import java.awt.*; |
8 | import java.awt.image.BufferedImage; | 6 | import java.awt.image.BufferedImage; |
9 | import java.io.ByteArrayOutputStream; | 7 | import java.io.ByteArrayOutputStream; |
10 | import java.io.IOException; | 8 | import java.io.IOException; |
9 | +import java.util.Base64; | ||
11 | import java.util.Random; | 10 | import java.util.Random; |
12 | 11 | ||
12 | +/** | ||
13 | + * 登录验证码工具类 | ||
14 | + */ | ||
13 | public class RandImageUtil { | 15 | public class RandImageUtil { |
14 | 16 | ||
15 | public static final String key = "JEECG_LOGIN_KEY"; | 17 | public static final String key = "JEECG_LOGIN_KEY"; |
@@ -69,9 +71,8 @@ public class RandImageUtil { | @@ -69,9 +71,8 @@ public class RandImageUtil { | ||
69 | ImageIO.write(image, IMG_FORMAT, byteStream); | 71 | ImageIO.write(image, IMG_FORMAT, byteStream); |
70 | //转换成字节 | 72 | //转换成字节 |
71 | byte[] bytes = byteStream.toByteArray(); | 73 | byte[] bytes = byteStream.toByteArray(); |
72 | - BASE64Encoder encoder = new BASE64Encoder(); | ||
73 | //转换成base64串 | 74 | //转换成base64串 |
74 | - String base64 = encoder.encodeBuffer(bytes).trim(); | 75 | + String base64 = Base64.getEncoder().encodeToString(bytes).trim(); |
75 | base64 = base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n | 76 | base64 = base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n |
76 | 77 | ||
77 | //写到指定位置 | 78 | //写到指定位置 |