File tree Expand file tree Collapse file tree 3 files changed +90
-6
lines changed Expand file tree Collapse file tree 3 files changed +90
-6
lines changed Original file line number Diff line number Diff line change 12
12
background-color : # E9ECEF ;
13
13
height : 8rem ;
14
14
line-height : 4rem ;
15
+ border-bottom-right-radius : 20rem ;
16
+ border-top-left-radius : 20rem ;
15
17
}
16
18
17
19
.header-title .name {
Original file line number Diff line number Diff line change @@ -122,16 +122,16 @@ <h2 class="header-title">
122
122
< i class ="now-ui-icons ui-1_send "> </ i >
123
123
</ div >
124
124
</ div >
125
- < input type ="text " disabled class ="form-control " required name ="code " placeholder ="验证码 ">
125
+ < input type ="text " class ="form-control " required name ="code " placeholder ="验证码 ">
126
126
</ div >
127
127
</ div >
128
128
< div class ="form-group col-7 ">
129
- < button type ="button " class ="btn btn-outline-primary "> 获取验证码(180)</ button >
129
+ < button type ="button " class ="btn btn-outline-primary "> 获取验证码(180)</ button >
130
130
</ div >
131
131
</ div >
132
132
< div class ="form-row ">
133
133
< div class ="form-group col ">
134
- < button type ="submit " class ="btn btn-primary btn-block "> 登 录 </ button >
134
+ < button type ="submit " disabled class ="btn btn-primary btn-block "> 登 录 </ button >
135
135
</ div >
136
136
</ div >
137
137
</ form >
Original file line number Diff line number Diff line change 1
1
import org .springframework .boot .autoconfigure .cache .CacheProperties ;
2
2
import org .springframework .boot .autoconfigure .data .redis .RedisProperties ;
3
+ import org .springframework .security .core .parameters .P ;
3
4
import org .springframework .util .AntPathMatcher ;
4
5
6
+ import java .io .*;
7
+ import java .util .LinkedList ;
8
+ import java .util .Queue ;
9
+
5
10
/**
6
11
* @author yuit
7
12
* @create 2018/10/22 17:38
10
15
*/
11
16
public class Main {
12
17
13
- public static void main (String [] args ){
14
18
15
19
20
+ public static void main (String [] args ) throws InterruptedException {
21
+ Queue <Integer > res = new LinkedList <>();
22
+ Producer p = new Producer (res );
23
+ Consumer c = new Consumer (res );
24
+
25
+ Thread pth = new Thread (p );
26
+ Thread cth = new Thread (c );
27
+
28
+ pth .start ();
29
+ cth .start ();
30
+
31
+ pth .join ();
32
+ cth .join ();
16
33
17
34
}
18
35
36
+
19
37
}
20
38
21
- /**
39
+ class Producer implements Runnable {
40
+
41
+ private Queue <Integer > res ;
42
+
43
+ public Producer (Queue <Integer > res ) {
44
+ this .res = res ;
45
+ }
46
+
47
+ @ Override
48
+ public void run () {
49
+
50
+ synchronized (res ){
51
+ if (res .size ()>=5 ) {
52
+ res .notify ();
53
+ try {
54
+ res .wait ();
55
+ } catch (InterruptedException e ) {
56
+ e .printStackTrace ();
57
+ }
58
+ }
22
59
60
+ res .add (1 );
61
+ res .notify ();
62
+ try {
63
+ Thread .sleep (1 *1000 );
64
+ } catch (InterruptedException e ) {
65
+ e .printStackTrace ();
66
+ }
23
67
68
+ System .out .println ("Producer: " + res );
24
69
70
+ run ();
71
+ }
25
72
26
- */
73
+ }
74
+ }
75
+
76
+
77
+ class Consumer implements Runnable {
78
+ private Queue <Integer > res ;
79
+
80
+ public Consumer (Queue <Integer > res ) {
81
+ this .res = res ;
82
+ }
83
+
84
+ @ Override
85
+ public void run () {
86
+ synchronized (res ){
87
+ if (res .size ()==0 ) {
88
+ res .notify ();
89
+ try {
90
+ res .wait ();
91
+ } catch (InterruptedException e ) {
92
+ e .printStackTrace ();
93
+ }
94
+ }
95
+ res .poll ();
96
+ res .notify ();
97
+ try {
98
+ Thread .sleep (1 *1000 );
99
+ } catch (InterruptedException e ) {
100
+ e .printStackTrace ();
101
+ }
102
+
103
+ System .out .println ("Consumer: " + res );
104
+
105
+ run ();
106
+ }
107
+ }
108
+ }
You can’t perform that action at this time.
0 commit comments