system-clients 1.6.72-foric → 1.6.73-foric

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "system-clients",
3
- "version": "1.6.72-foric",
3
+ "version": "1.6.73-foric",
4
4
  "description": "系统基础框架",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,625 +1,626 @@
1
- <template>
2
- <div class="ssoLoadingMain" v-if="!showlogin && isSso">
3
- <img class="ssoLoadingImg" src="../../../static/login-do.gif">
4
- </div>
5
- <div class="loginbg" v-if="showlogin">
6
- <span class="logotitle"></span>
7
- <!-- <img src="../../../static/huangtengbiaozhi.png" alt="图片加载未完成" class="img-responsive logotitle" /> -->
8
- <div class="notice-board" style="height:40%;">
9
- <h1 text-align="center">变更公告:</h1>
10
- <div style="overflow:hidden;width:500px;margin:10px ">
11
- <div style="overflow-y:auto;width:520px;">
12
- <!--<change-declare ></change-declare>-->
13
- </div>
14
- </div>
15
- <p>版本号:v1.0.0</p>
16
- </div>
17
- <!--输入框-->
18
- <div class="htmleaf-container">
19
- <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
20
- <div class="wrapper" :class="{'form-success': login}">
21
- <div class="container">
22
- <h3 style="color:white;">欢迎使用</h3>
23
- <!-- <h4 style="color:white;">Welcome to OA System</h4> -->
24
- <form class="form">
25
- <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">
26
- <input type="password" placeholder="密码" v-model="model.password" class="psicon"
27
- @keyup.enter="confirm('key')">
28
- <input v-if="$login.Verification" style="width: 40%; display: inline" type="text" placeholder="请输入验证码"
29
- v-model="picLyanzhengma" @keyup.enter="confirm('key')">
30
- <input v-if="$login.Verification" style="width: 30%; display: inline;background-color: darkgray;"
31
- type="button" @click="createCode" v-model="checkCode"/><br>
32
- <button type="button" id="login-button" @click.prevent="confirm('click')"><strong>登录</strong></button>
33
- <!-- <button type="button" id="login-button" @click.prevent="confirm()"><strong>注册</strong></button> -->
34
- <!-- <span @click="register()">还没有注册,现在注册>>></span> -->
35
- </form>
36
- </div>
37
- </div>
38
- </div>
39
- <!--输入框结束-->
40
- <!-- 注册模态框开始 -->
41
- <!-- <modal v-ref:modal :show.sync="registerShow" :backdrop="false" class="auto">
42
- <header slot="modal-header" class="modal-header">
43
- <button type="button" class="close" @click="close"><span>&times;</span></button>
44
- <h4 class="modal-title">注册</h4>
45
- </header>
46
- <article slot="modal-body" class="modal-body modifystyle">
47
- <validator name="v">
48
-
49
- <div class="has-feedback"
50
- :class="{'has-warning':$v.ename.required,'has-success': !$v.ename.required}">
51
- <label for="user" class="control-label">登录用户:&nbsp;&nbsp;</label>
52
- <input type="text" v-model="deliver.ename" class="form-control" id="user" v-validate:ename="{ required: true}">
53
- <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.ename.required"></span>
54
- <span v-if="$v.ename.required">不能为空</span>
55
- </div>
56
-
57
- <div class="has-feedback"
58
- :class="{'has-warning':$v.password.required, 'has-success': !$v.password.required}">
59
- <label for="newpassword" class="control-label">登录密码:&nbsp;&nbsp;</label>
60
- <input type="password" v-model="deliver.password" class="form-control" id="newpassword" v-validate:password='{ required: true }'>
61
- <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.password.required"></span>
62
- <span v-if="$v.password.required">不能为空</span>
63
- </div>
64
-
65
- <div class="has-feedback"
66
- :class="{'has-warning':$v.affirmpassword.required,'has-error':$v.affirmpassword.equalValid && !($v.affirmpassword.required),
67
- 'has-success': !$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}">
68
- <label for="affirmpassword" class="control-label">确认密码:&nbsp;&nbsp;</label>
69
- <input type="password" v-model="deliver.affirmpassword" class="form-control" id="affirmpassword" v-validate:affirmpassword="{ required: true, equalValid: deliver.password }">
70
- <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))"></span>
71
- <span v-if="$v.affirmpassword.required">不能为空</span>
72
- <span v-if="$v.affirmpassword.equalValid && !($v.affirmpassword.required)">两次密码不一致 !!</span>
73
- </div>
74
-
75
- </validator>
76
- </article>
77
- <footer slot="modal-footer" class="footerbtn">
78
- <button type="button" class="btn btn-success" @click='registed()' :disabled="!$v.valid">提交注册</button>
79
- </footer>
80
- <modal> -->
81
- <!-- 注册模态框结束 -->
82
- <!--<load-data @ready="onReady"></load-data>-->
83
- </div>
84
- </template>
85
-
86
- <script>
87
- import co from 'co'
88
- import $ from 'jquery'
89
-
90
- let saveGen = function *(self, goto) {
91
- try {
92
- yield self.$login.login(self.model.ename, self.model.password)
93
- yield self.$appdata.load()
94
-
95
- yield self.$getConfig(self, 'Login')
96
- console.log('登录配置', self.config)
97
- if (self.config.isMac) {
98
- // 获取该登录人分公司下的mac配置
99
- let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_orgid = '${self.$login.f.orgid}'`}}, {
100
- resolveMsg: null,
101
- rejectMsg: null
102
- }).catch(() => {
103
- throw new Error('获取mac配置失败')
104
- })
105
- console.log('MAC地址信息', getMacs)
106
- // 获取本地mac地址
107
- let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
108
- resolveMsg: null,
109
- rejectMsg: null
110
- }).catch(() => {
111
- throw new Error('获取本地mac配置失败')
112
- })
113
- console.log('本地MAC地址信息', getLocalMac)
114
- // 对Mac地址进行匹配
115
- let macValidate = false
116
- for (let i = 0; i < getLocalMac.data.mac.length; i++) {
117
- for (let j = 0; j < getMacs.data.length; j++) {
118
- if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
119
- macValidate = true
120
- }
121
- }
122
- }
123
- if (!macValidate) {
124
- throw new Error('Mac地址验证失败, 请联系管理员!!')
125
- }
126
- }
127
- if (goto) {
128
- self.$goto(goto, {functions: self.$login.f})
129
- return
130
- }
131
- self.showlogin = false
132
- self.$goto('home-page', {functions: self.$login.f})
133
- } catch (ret) {
134
- console.error('登录失败', ret)
135
- let msg
136
- if (ret instanceof Error) {
137
- msg = ret
138
- }
139
- if (ret.status === 0) {
140
- msg = '服务连接错误,请确认服务状态'
141
- } else if (ret.status === 401) {
142
- msg = ret.data
143
- } else if (ret.status === 710) {
144
- msg = ret.data
145
- }
146
- self.createCode()
147
- self.picLyanzhengma = ''
148
- yield self.$showMessage(msg)
149
- self.model.ename = ''
150
- self.model.password = ''
151
- self.login = false
152
- $('form').fadeIn(500)
153
- }
154
- }
155
- export default {
156
- title: '登录',
157
- ready () {
158
- if (window.location.href.includes('ticket')) {
159
- this.isSso = true
160
- this.showlogin = false
161
- let url = window.location.href.split("?")[1]
162
- let obj = {}
163
- for (let params of url.split("&")) {
164
- let kv = params.split("=")
165
- obj[kv[0]] = kv[1]
166
- }
167
- let params = {
168
- st: obj.ticket,
169
- serviceKey: '931c5577c71047b9b58e1a7638b4e999'
170
- }
171
- this.$resetpost('/sso/logic/serviceValidate', params,{resolveMsg: null, rejectMsg: null}).then((re) => {
172
- // this.$showMessage("re----" + JSON.stringify(re))
173
- if (re.data.code === 200) {
174
- this.showlogin = false
175
- let condition = `ename = '${re.data.data.userName}'`
176
- this.$resetpost('rs/sql/singleTable', {data: { items: '*', tablename: 't_user', condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
177
- if (res.data && res.data.length > 0) {
178
- this.model.ename = res.data[0].ename
179
- this.model.password = res.data[0].password
180
- // this.$showMessage("re----" + JSON.stringify(this.model))
181
- let gen = obj.goto ? saveGen(this, obj.goto) : saveGen(this)
182
- return co(gen)
183
- } else {
184
- this.$showMessage('此账户不存在,请重试!!!', ['confirm']).then((res) => {
185
- if(res === 'confirm') {
186
- this.showlogin = true
187
- }
188
- })
189
- }
190
- })
191
- } else {
192
- this.showlogin = true
193
- }
194
- this.isSso = false
195
- })
196
- } else {
197
- if (this.$login && this.$login.getUrlCompileParames('name') && this.$login.getUrlCompileParames('password')) {
198
- this.model.ename = this.$login.getUrlCompileParames('name')
199
- this.model.password = this.$login.getUrlCompileParames('password')
200
- this.confirm()
201
- }
202
- $('#login-button').click(function (event) {
203
- event.preventDefault()
204
- $('form').fadeOut(500)
205
- }),
206
- this.createCode()
207
- }
208
- },
209
- data () {
210
- return {
211
- config: {
212
- isMac: false
213
- },
214
- showlogin: true,
215
- isSso: false,
216
- login: false,
217
- model: {},
218
- show: false,
219
- checkCode: '',
220
- picLyanzhengma: ''
221
- }
222
- },
223
- methods: {
224
- onReady () {
225
- this.$emit('ready')
226
- },
227
- confirm (key) {
228
- if (key == 'key') {
229
- $('form').fadeOut(500)
230
- }
231
- if(this.$login.Verification){
232
- if(this.picLyanzhengma == '') {
233
- this.$showMessage("请输入验证码!").then(()=>{
234
- $('form').fadeIn(500)
235
- this.createCode()
236
- })
237
- }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
238
- //若输入的验证码与产生的验证码不一致时
239
- this.$showMessage("验证码不正确").then(()=>{
240
- $('form').fadeIn(500)
241
- this.createCode();//刷新验证码
242
- this.picLyanzhengma = '';
243
- })
244
- }else {
245
- this.login = true
246
- let gen = saveGen(this)
247
- return co(gen)
248
- }
249
- }else {
250
- this.login = true
251
- let gen = saveGen(this)
252
- return co(gen)
253
- }
254
- },
255
- createCode(){
256
- let code = "";
257
- let codeLength = 4;//验证码的长度
258
- let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
259
- 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
260
- for (let i = 0; i < codeLength; i++) {
261
- //循环操作
262
- let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
263
- code += random[index];//根据索引取得随机数加到code上
264
- }
265
- this.checkCode = code;//把code值赋给验证码
266
- }
267
- }
268
- }
269
- </script>
270
-
271
- <style>
272
- /*输入框样式*/
273
- /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
274
- * {
275
- box-sizing: border-box;
276
- margin: 0;
277
- padding: 0;
278
- font-weight: 300;
279
- }
280
-
281
- body {
282
- font-family: 'Source Sans Pro', sans-serif;
283
- color: white;
284
- font-weight: 300;
285
- }
286
-
287
- body ::-webkit-input-placeholder {
288
- /* WebKit browsers */
289
- font-family: 'Source Sans Pro', sans-serif;
290
- color: white;
291
- font-weight: 300;
292
- }
293
-
294
- body :-moz-placeholder {
295
- /* Mozilla Firefox 4 to 18 */
296
- font-family: 'Source Sans Pro', sans-serif;
297
- color: white;
298
- opacity: 1;
299
- font-weight: 300;
300
- }
301
-
302
- body ::-moz-placeholder {
303
- /* Mozilla Firefox 19+ */
304
- font-family: 'Source Sans Pro', sans-serif;
305
- color: white;
306
- opacity: 1;
307
- font-weight: 300;
308
- }
309
-
310
- body :-ms-input-placeholder {
311
- /* Internet Explorer 10+ */
312
- font-family: 'Source Sans Pro', sans-serif;
313
- color: white;
314
- font-weight: 300;
315
- }
316
-
317
- .wrapper {
318
- /*background: #2D83BA;
319
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
320
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
321
- opacity: 0.8;*/
322
- position: absolute;
323
- top: 50%;
324
- right: -60px;
325
- width: 40%;
326
- height: 400px;
327
- margin-top: -150px;
328
- overflow: hidden;
329
-
330
- }
331
-
332
- .wrapper.form-success .container h3 {
333
- -webkit-transform: translateY(85px);
334
- -ms-transform: translateY(85px);
335
- transform: translateY(85px);
336
- }
337
-
338
- .container {
339
- max-width: 350px;
340
- margin: 0 auto;
341
- padding: 30px 100px 50px 100px;
342
- height: 400px;
343
- text-align: center;
344
- /*以下增加*/
345
- background: #2D83BA;
346
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
347
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
348
- opacity: 0.8;
349
- }
350
-
351
- .container h3 {
352
- font-size: 40px;
353
- -webkit-transition-duration: 1s;
354
- transition-duration: 1s;
355
- -webkit-transition-timing-function: ease-in-put;
356
- transition-timing-function: ease-in-put;
357
- font-weight: 200;
358
- }
359
-
360
- .form {
361
- padding: 20px 0;
362
- position: relative;
363
- z-index: 2;
364
- }
365
-
366
- .form input {
367
- -webkit-appearance: none;
368
- -moz-appearance: none;
369
- appearance: none;
370
- outline: 0;
371
- border: 1px solid #50ABE6;
372
- background-color: #50ABE6;
373
- width: 250px;
374
- border-radius: 3px;
375
- padding: 10px 15px;
376
- margin: 0 auto 10px auto;
377
- display: block;
378
- text-align: center;
379
- font-size: 18px;
380
- color: white;
381
- -webkit-transition-duration: 0.25s;
382
- transition-duration: 0.25s;
383
- font-weight: 300;
384
- }
385
-
386
- .form input:hover {
387
- background-color: rgba(255, 255, 255, 0.4);
388
- }
389
-
390
- .form input:focus {
391
- background-color: white;
392
- width: 300px;
393
- color: #53e3a6;
394
- }
395
-
396
- .usericon {
397
- background-image: url(../../../static/usericon.png);
398
- background-repeat: no-repeat;
399
- background-size: 30px;
400
- background-position-x: 8px;
401
- background-position-y: 8px;
402
- }
403
-
404
- .psicon {
405
- background-image: url(../../../static/psicon.png);
406
- background-repeat: no-repeat;
407
- background-size: 30px;
408
- background-position-x: 8px;
409
- background-position-y: 8px;
410
- }
411
-
412
- .form button {
413
- -webkit-appearance: none;
414
- -moz-appearance: none;
415
- appearance: none;
416
- outline: 0;
417
- background-color: white;
418
- border: 0;
419
- padding: 10px 15px;
420
- color: #253830;
421
- border-radius: 3px;
422
- width: 250px;
423
- cursor: pointer;
424
- font-size: 18px;
425
- -webkit-transition-duration: 0.25s;
426
- transition-duration: 0.25s;
427
- }
428
-
429
- .form button:hover {
430
- background-color: #f5f7f9;
431
- }
432
-
433
- /*注册字体样式*/
434
- .form span {
435
- color: #fff;
436
- display: table-footer-group;
437
- position: absolute;
438
- right: 10px;
439
- margin-top: 10px;
440
- cursor: pointer;
441
- }
442
-
443
- .logotitle {
444
- color: #fff;
445
- position: absolute;
446
- top: 50px;
447
- left: 50px;
448
- font-size: 50px;
449
- }
450
-
451
- /*注册模态框界面样式*/
452
- .modifystyle {
453
- background: #FCFEEE;
454
- }
455
-
456
- .modifystyle div {
457
- height: auto;
458
- margin-bottom: 15px;
459
- /*text-align: center;*/
460
- /*margin-left: 20%;*/
461
- }
462
-
463
- /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
464
- .modifystyle div input + span {
465
- top: 0 !important;
466
- right: 32%;
467
- }
468
-
469
- .modifystyle span {
470
- color: red;
471
- }
472
-
473
- /* 通告区内容 */
474
- .notice-board {
475
- height: auto;
476
- position: absolute;
477
- top: 50%;
478
- margin-top: -150px;
479
- margin-left: 100px;
480
- color: #fff;
481
- }
482
-
483
- /*修改密码底部按钮部分样式*/
484
- .footerbtn {
485
- text-align: center;
486
- padding: 15px;
487
- }
488
-
489
- .footerbtn button {
490
- width: 100px;
491
- margin-left: 20px;
492
- }
493
-
494
- .bg-bubbles {
495
- position: absolute;
496
- top: 0;
497
- left: 0;
498
- width: 100%;
499
- height: 100%;
500
- z-index: 1;
501
- }
502
-
503
- .bg-bubbles li {
504
- position: absolute;
505
- list-style: none;
506
- display: block;
507
- width: 40px;
508
- height: 40px;
509
- background-color: rgba(255, 255, 255, 0.15);
510
- bottom: -160px;
511
- -webkit-animation: square 25s infinite;
512
- animation: square 25s infinite;
513
- -webkit-transition-timing-function: linear;
514
- transition-timing-function: linear;
515
- }
516
-
517
- .bg-bubbles li:nth-child(1) {
518
- left: 10%;
519
- }
520
-
521
- .bg-bubbles li:nth-child(2) {
522
- left: 20%;
523
- width: 80px;
524
- height: 80px;
525
- -webkit-animation-delay: 2s;
526
- animation-delay: 2s;
527
- -webkit-animation-duration: 17s;
528
- animation-duration: 17s;
529
- }
530
-
531
- .bg-bubbles li:nth-child(3) {
532
- left: 25%;
533
- -webkit-animation-delay: 4s;
534
- animation-delay: 4s;
535
- }
536
-
537
- .bg-bubbles li:nth-child(4) {
538
- left: 40%;
539
- width: 60px;
540
- height: 60px;
541
- -webkit-animation-duration: 22s;
542
- animation-duration: 22s;
543
- background-color: rgba(255, 255, 255, 0.25);
544
- }
545
-
546
- .bg-bubbles li:nth-child(5) {
547
- left: 70%;
548
- }
549
-
550
- .bg-bubbles li:nth-child(6) {
551
- left: 80%;
552
- width: 120px;
553
- height: 120px;
554
- -webkit-animation-delay: 3s;
555
- animation-delay: 3s;
556
- background-color: rgba(255, 255, 255, 0.2);
557
- }
558
-
559
- .bg-bubbles li:nth-child(7) {
560
- left: 32%;
561
- width: 160px;
562
- height: 160px;
563
- -webkit-animation-delay: 7s;
564
- animation-delay: 7s;
565
- }
566
-
567
- .bg-bubbles li:nth-child(8) {
568
- left: 55%;
569
- width: 20px;
570
- height: 20px;
571
- -webkit-animation-delay: 15s;
572
- animation-delay: 15s;
573
- -webkit-animation-duration: 40s;
574
- animation-duration: 40s;
575
- }
576
-
577
- .bg-bubbles li:nth-child(9) {
578
- left: 25%;
579
- width: 10px;
580
- height: 10px;
581
- -webkit-animation-delay: 2s;
582
- animation-delay: 2s;
583
- -webkit-animation-duration: 40s;
584
- animation-duration: 40s;
585
- background-color: rgba(255, 255, 255, 0.3);
586
- }
587
-
588
- .bg-bubbles li:nth-child(10) {
589
- left: 90%;
590
- width: 160px;
591
- height: 160px;
592
- -webkit-animation-delay: 11s;
593
- animation-delay: 11s;
594
- }
595
-
596
- @-webkit-keyframes square {
597
- 0% {
598
- -webkit-transform: translateY(0);
599
- transform: translateY(0);
600
- }
601
- 100% {
602
- -webkit-transform: translateY(-700px) rotate(600deg);
603
- transform: translateY(-700px) rotate(600deg);
604
- }
605
- }
606
-
607
- @keyframes square {
608
- 0% {
609
- -webkit-transform: translateY(0);
610
- transform: translateY(0);
611
- }
612
- 100% {
613
- -webkit-transform: translateY(-700px) rotate(600deg);
614
- transform: translateY(-700px) rotate(600deg);
615
- }
616
- }
617
- .ssoLoadingMain .ssoLoadingImg {
618
- position: absolute;
619
- top:0;
620
- left: 0;
621
- bottom: 0;
622
- right: 0;
623
- margin: auto;
624
- }
625
- </style>
1
+ <template>
2
+ <div class="ssoLoadingMain" v-if="!showlogin && isSso">
3
+ <img class="ssoLoadingImg" src="../../../static/login-do.gif">
4
+ </div>
5
+ <div class="loginbg" v-if="showlogin">
6
+ <span class="logotitle"></span>
7
+ <!-- <img src="../../../static/huangtengbiaozhi.png" alt="图片加载未完成" class="img-responsive logotitle" /> -->
8
+ <div class="notice-board" style="height:40%;">
9
+ <h1 text-align="center">变更公告:</h1>
10
+ <div style="overflow:hidden;width:500px;margin:10px ">
11
+ <div style="overflow-y:auto;width:520px;">
12
+ <!--<change-declare ></change-declare>-->
13
+ </div>
14
+ </div>
15
+ <p>版本号:v1.0.0</p>
16
+ </div>
17
+ <!--输入框-->
18
+ <div class="htmleaf-container">
19
+ <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
20
+ <div class="wrapper" :class="{'form-success': login}">
21
+ <div class="container">
22
+ <h3 style="color:white;">欢迎使用</h3>
23
+ <!-- <h4 style="color:white;">Welcome to OA System</h4> -->
24
+ <form class="form">
25
+ <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">
26
+ <input type="password" placeholder="密码" v-model="model.password" class="psicon"
27
+ @keyup.enter="confirm('key')">
28
+ <input v-if="$login.Verification" style="width: 40%; display: inline" type="text" placeholder="请输入验证码"
29
+ v-model="picLyanzhengma" @keyup.enter="confirm('key')">
30
+ <input v-if="$login.Verification" style="width: 30%; display: inline;background-color: darkgray;"
31
+ type="button" @click="createCode" v-model="checkCode"/><br>
32
+ <button type="button" id="login-button" @click.prevent="confirm('click')"><strong>登录</strong></button>
33
+ <!-- <button type="button" id="login-button" @click.prevent="confirm()"><strong>注册</strong></button> -->
34
+ <!-- <span @click="register()">还没有注册,现在注册>>></span> -->
35
+ </form>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <!--输入框结束-->
40
+ <!-- 注册模态框开始 -->
41
+ <!-- <modal v-ref:modal :show.sync="registerShow" :backdrop="false" class="auto">
42
+ <header slot="modal-header" class="modal-header">
43
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
44
+ <h4 class="modal-title">注册</h4>
45
+ </header>
46
+ <article slot="modal-body" class="modal-body modifystyle">
47
+ <validator name="v">
48
+
49
+ <div class="has-feedback"
50
+ :class="{'has-warning':$v.ename.required,'has-success': !$v.ename.required}">
51
+ <label for="user" class="control-label">登录用户:&nbsp;&nbsp;</label>
52
+ <input type="text" v-model="deliver.ename" class="form-control" id="user" v-validate:ename="{ required: true}">
53
+ <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.ename.required"></span>
54
+ <span v-if="$v.ename.required">不能为空</span>
55
+ </div>
56
+
57
+ <div class="has-feedback"
58
+ :class="{'has-warning':$v.password.required, 'has-success': !$v.password.required}">
59
+ <label for="newpassword" class="control-label">登录密码:&nbsp;&nbsp;</label>
60
+ <input type="password" v-model="deliver.password" class="form-control" id="newpassword" v-validate:password='{ required: true }'>
61
+ <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.password.required"></span>
62
+ <span v-if="$v.password.required">不能为空</span>
63
+ </div>
64
+
65
+ <div class="has-feedback"
66
+ :class="{'has-warning':$v.affirmpassword.required,'has-error':$v.affirmpassword.equalValid && !($v.affirmpassword.required),
67
+ 'has-success': !$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}">
68
+ <label for="affirmpassword" class="control-label">确认密码:&nbsp;&nbsp;</label>
69
+ <input type="password" v-model="deliver.affirmpassword" class="form-control" id="affirmpassword" v-validate:affirmpassword="{ required: true, equalValid: deliver.password }">
70
+ <span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))"></span>
71
+ <span v-if="$v.affirmpassword.required">不能为空</span>
72
+ <span v-if="$v.affirmpassword.equalValid && !($v.affirmpassword.required)">两次密码不一致 !!</span>
73
+ </div>
74
+
75
+ </validator>
76
+ </article>
77
+ <footer slot="modal-footer" class="footerbtn">
78
+ <button type="button" class="btn btn-success" @click='registed()' :disabled="!$v.valid">提交注册</button>
79
+ </footer>
80
+ <modal> -->
81
+ <!-- 注册模态框结束 -->
82
+ <!--<load-data @ready="onReady"></load-data>-->
83
+ </div>
84
+ </template>
85
+
86
+ <script>
87
+ import co from 'co'
88
+ import $ from 'jquery'
89
+
90
+ let saveGen = function *(self, goto) {
91
+ try {
92
+ yield self.$login.login(self.model.ename, self.model.password)
93
+ yield self.$appdata.load()
94
+
95
+ yield self.$getConfig(self, 'Login')
96
+ console.log('登录配置', self.config)
97
+ if (self.config.isMac) {
98
+ // 获取该登录人分公司下的mac配置
99
+ let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_orgid = '${self.$login.f.orgid}'`}}, {
100
+ resolveMsg: null,
101
+ rejectMsg: null
102
+ }).catch(() => {
103
+ throw new Error('获取mac配置失败')
104
+ })
105
+ console.log('MAC地址信息', getMacs)
106
+ // 获取本地mac地址
107
+ let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
108
+ resolveMsg: null,
109
+ rejectMsg: null
110
+ }).catch(() => {
111
+ throw new Error('获取本地mac配置失败')
112
+ })
113
+ console.log('本地MAC地址信息', getLocalMac)
114
+ // 对Mac地址进行匹配
115
+ let macValidate = false
116
+ for (let i = 0; i < getLocalMac.data.mac.length; i++) {
117
+ for (let j = 0; j < getMacs.data.length; j++) {
118
+ if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
119
+ macValidate = true
120
+ }
121
+ }
122
+ }
123
+ if (!macValidate) {
124
+ throw new Error('Mac地址验证失败, 请联系管理员!!')
125
+ }
126
+ }
127
+ if (goto) {
128
+ self.$goto(goto, {functions: self.$login.f})
129
+ return
130
+ }
131
+ self.showlogin = false
132
+ self.$goto('home-page', {functions: self.$login.f})
133
+ } catch (ret) {
134
+ console.error('登录失败', ret)
135
+ let msg
136
+ if (ret instanceof Error) {
137
+ msg = ret
138
+ }
139
+ if (ret.status === 0) {
140
+ msg = '服务连接错误,请确认服务状态'
141
+ } else if (ret.status === 401) {
142
+ msg = ret.data
143
+ } else if (ret.status === 710) {
144
+ msg = ret.data
145
+ }
146
+ self.createCode()
147
+ self.picLyanzhengma = ''
148
+ yield self.$showMessage(msg)
149
+ self.model.ename = ''
150
+ self.model.password = ''
151
+ self.login = false
152
+ $('form').fadeIn(500)
153
+ }
154
+ }
155
+ export default {
156
+ title: '登录',
157
+ ready () {
158
+ if (window.location.href.includes('ticket')) {
159
+ this.isSso = true
160
+ this.showlogin = false
161
+ let url = window.location.href.split("?")[1]
162
+ let obj = {}
163
+ for (let params of url.split("&")) {
164
+ let kv = params.split("=")
165
+ obj[kv[0]] = kv[1]
166
+ }
167
+ let params = {
168
+ st: obj.ticket,
169
+ serviceKey: '931c5577c71047b9b58e1a7638b4e999'
170
+ }
171
+ this.$resetpost('/sso/logic/serviceValidate', params,{resolveMsg: null, rejectMsg: null}).then((re) => {
172
+ // this.$showMessage("re----" + JSON.stringify(re))
173
+ if (re.data.code === 200) {
174
+ this.showlogin = false
175
+ let condition = `ename = '${re.data.data.userName}'`
176
+ this.$resetpost('rs/sql/singleTable', {data: { items: '*', tablename: 't_user', condition: condition}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
177
+ if (res.data && res.data.length > 0) {
178
+ this.model.ename = res.data[0].ename
179
+ this.model.password = res.data[0].password
180
+ // this.$showMessage("re----" + JSON.stringify(this.model))
181
+ let gen = obj.goto ? saveGen(this, obj.goto) : saveGen(this)
182
+ return co(gen)
183
+ } else {
184
+ this.$showMessage('此账户不存在,请重试!!!', ['confirm']).then((res) => {
185
+ if(res === 'confirm') {
186
+ this.showlogin = true
187
+ }
188
+ })
189
+ }
190
+ })
191
+ } else {
192
+ this.showlogin = true
193
+ }
194
+ this.createCode()
195
+ this.isSso = false
196
+ })
197
+ } else {
198
+ if (this.$login && this.$login.getUrlCompileParames('name') && this.$login.getUrlCompileParames('password')) {
199
+ this.model.ename = this.$login.getUrlCompileParames('name')
200
+ this.model.password = this.$login.getUrlCompileParames('password')
201
+ this.confirm()
202
+ }
203
+ $('#login-button').click(function (event) {
204
+ event.preventDefault()
205
+ $('form').fadeOut(500)
206
+ }),
207
+ this.createCode()
208
+ }
209
+ },
210
+ data () {
211
+ return {
212
+ config: {
213
+ isMac: false
214
+ },
215
+ showlogin: true,
216
+ isSso: false,
217
+ login: false,
218
+ model: {},
219
+ show: false,
220
+ checkCode: '',
221
+ picLyanzhengma: ''
222
+ }
223
+ },
224
+ methods: {
225
+ onReady () {
226
+ this.$emit('ready')
227
+ },
228
+ confirm (key) {
229
+ if (key == 'key') {
230
+ $('form').fadeOut(500)
231
+ }
232
+ if(this.$login.Verification){
233
+ if(this.picLyanzhengma == '') {
234
+ this.$showMessage("请输入验证码!").then(()=>{
235
+ $('form').fadeIn(500)
236
+ this.createCode()
237
+ })
238
+ }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
239
+ //若输入的验证码与产生的验证码不一致时
240
+ this.$showMessage("验证码不正确").then(()=>{
241
+ $('form').fadeIn(500)
242
+ this.createCode();//刷新验证码
243
+ this.picLyanzhengma = '';
244
+ })
245
+ }else {
246
+ this.login = true
247
+ let gen = saveGen(this)
248
+ return co(gen)
249
+ }
250
+ }else {
251
+ this.login = true
252
+ let gen = saveGen(this)
253
+ return co(gen)
254
+ }
255
+ },
256
+ createCode(){
257
+ let code = "";
258
+ let codeLength = 4;//验证码的长度
259
+ let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
260
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
261
+ for (let i = 0; i < codeLength; i++) {
262
+ //循环操作
263
+ let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
264
+ code += random[index];//根据索引取得随机数加到code上
265
+ }
266
+ this.checkCode = code;//把code值赋给验证码
267
+ }
268
+ }
269
+ }
270
+ </script>
271
+
272
+ <style>
273
+ /*输入框样式*/
274
+ /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
275
+ * {
276
+ box-sizing: border-box;
277
+ margin: 0;
278
+ padding: 0;
279
+ font-weight: 300;
280
+ }
281
+
282
+ body {
283
+ font-family: 'Source Sans Pro', sans-serif;
284
+ color: white;
285
+ font-weight: 300;
286
+ }
287
+
288
+ body ::-webkit-input-placeholder {
289
+ /* WebKit browsers */
290
+ font-family: 'Source Sans Pro', sans-serif;
291
+ color: white;
292
+ font-weight: 300;
293
+ }
294
+
295
+ body :-moz-placeholder {
296
+ /* Mozilla Firefox 4 to 18 */
297
+ font-family: 'Source Sans Pro', sans-serif;
298
+ color: white;
299
+ opacity: 1;
300
+ font-weight: 300;
301
+ }
302
+
303
+ body ::-moz-placeholder {
304
+ /* Mozilla Firefox 19+ */
305
+ font-family: 'Source Sans Pro', sans-serif;
306
+ color: white;
307
+ opacity: 1;
308
+ font-weight: 300;
309
+ }
310
+
311
+ body :-ms-input-placeholder {
312
+ /* Internet Explorer 10+ */
313
+ font-family: 'Source Sans Pro', sans-serif;
314
+ color: white;
315
+ font-weight: 300;
316
+ }
317
+
318
+ .wrapper {
319
+ /*background: #2D83BA;
320
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
321
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
322
+ opacity: 0.8;*/
323
+ position: absolute;
324
+ top: 50%;
325
+ right: -60px;
326
+ width: 40%;
327
+ height: 400px;
328
+ margin-top: -150px;
329
+ overflow: hidden;
330
+
331
+ }
332
+
333
+ .wrapper.form-success .container h3 {
334
+ -webkit-transform: translateY(85px);
335
+ -ms-transform: translateY(85px);
336
+ transform: translateY(85px);
337
+ }
338
+
339
+ .container {
340
+ max-width: 350px;
341
+ margin: 0 auto;
342
+ padding: 30px 100px 50px 100px;
343
+ height: 400px;
344
+ text-align: center;
345
+ /*以下增加*/
346
+ background: #2D83BA;
347
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
348
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
349
+ opacity: 0.8;
350
+ }
351
+
352
+ .container h3 {
353
+ font-size: 40px;
354
+ -webkit-transition-duration: 1s;
355
+ transition-duration: 1s;
356
+ -webkit-transition-timing-function: ease-in-put;
357
+ transition-timing-function: ease-in-put;
358
+ font-weight: 200;
359
+ }
360
+
361
+ .form {
362
+ padding: 20px 0;
363
+ position: relative;
364
+ z-index: 2;
365
+ }
366
+
367
+ .form input {
368
+ -webkit-appearance: none;
369
+ -moz-appearance: none;
370
+ appearance: none;
371
+ outline: 0;
372
+ border: 1px solid #50ABE6;
373
+ background-color: #50ABE6;
374
+ width: 250px;
375
+ border-radius: 3px;
376
+ padding: 10px 15px;
377
+ margin: 0 auto 10px auto;
378
+ display: block;
379
+ text-align: center;
380
+ font-size: 18px;
381
+ color: white;
382
+ -webkit-transition-duration: 0.25s;
383
+ transition-duration: 0.25s;
384
+ font-weight: 300;
385
+ }
386
+
387
+ .form input:hover {
388
+ background-color: rgba(255, 255, 255, 0.4);
389
+ }
390
+
391
+ .form input:focus {
392
+ background-color: white;
393
+ width: 300px;
394
+ color: #53e3a6;
395
+ }
396
+
397
+ .usericon {
398
+ background-image: url(../../../static/usericon.png);
399
+ background-repeat: no-repeat;
400
+ background-size: 30px;
401
+ background-position-x: 8px;
402
+ background-position-y: 8px;
403
+ }
404
+
405
+ .psicon {
406
+ background-image: url(../../../static/psicon.png);
407
+ background-repeat: no-repeat;
408
+ background-size: 30px;
409
+ background-position-x: 8px;
410
+ background-position-y: 8px;
411
+ }
412
+
413
+ .form button {
414
+ -webkit-appearance: none;
415
+ -moz-appearance: none;
416
+ appearance: none;
417
+ outline: 0;
418
+ background-color: white;
419
+ border: 0;
420
+ padding: 10px 15px;
421
+ color: #253830;
422
+ border-radius: 3px;
423
+ width: 250px;
424
+ cursor: pointer;
425
+ font-size: 18px;
426
+ -webkit-transition-duration: 0.25s;
427
+ transition-duration: 0.25s;
428
+ }
429
+
430
+ .form button:hover {
431
+ background-color: #f5f7f9;
432
+ }
433
+
434
+ /*注册字体样式*/
435
+ .form span {
436
+ color: #fff;
437
+ display: table-footer-group;
438
+ position: absolute;
439
+ right: 10px;
440
+ margin-top: 10px;
441
+ cursor: pointer;
442
+ }
443
+
444
+ .logotitle {
445
+ color: #fff;
446
+ position: absolute;
447
+ top: 50px;
448
+ left: 50px;
449
+ font-size: 50px;
450
+ }
451
+
452
+ /*注册模态框界面样式*/
453
+ .modifystyle {
454
+ background: #FCFEEE;
455
+ }
456
+
457
+ .modifystyle div {
458
+ height: auto;
459
+ margin-bottom: 15px;
460
+ /*text-align: center;*/
461
+ /*margin-left: 20%;*/
462
+ }
463
+
464
+ /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
465
+ .modifystyle div input + span {
466
+ top: 0 !important;
467
+ right: 32%;
468
+ }
469
+
470
+ .modifystyle span {
471
+ color: red;
472
+ }
473
+
474
+ /* 通告区内容 */
475
+ .notice-board {
476
+ height: auto;
477
+ position: absolute;
478
+ top: 50%;
479
+ margin-top: -150px;
480
+ margin-left: 100px;
481
+ color: #fff;
482
+ }
483
+
484
+ /*修改密码底部按钮部分样式*/
485
+ .footerbtn {
486
+ text-align: center;
487
+ padding: 15px;
488
+ }
489
+
490
+ .footerbtn button {
491
+ width: 100px;
492
+ margin-left: 20px;
493
+ }
494
+
495
+ .bg-bubbles {
496
+ position: absolute;
497
+ top: 0;
498
+ left: 0;
499
+ width: 100%;
500
+ height: 100%;
501
+ z-index: 1;
502
+ }
503
+
504
+ .bg-bubbles li {
505
+ position: absolute;
506
+ list-style: none;
507
+ display: block;
508
+ width: 40px;
509
+ height: 40px;
510
+ background-color: rgba(255, 255, 255, 0.15);
511
+ bottom: -160px;
512
+ -webkit-animation: square 25s infinite;
513
+ animation: square 25s infinite;
514
+ -webkit-transition-timing-function: linear;
515
+ transition-timing-function: linear;
516
+ }
517
+
518
+ .bg-bubbles li:nth-child(1) {
519
+ left: 10%;
520
+ }
521
+
522
+ .bg-bubbles li:nth-child(2) {
523
+ left: 20%;
524
+ width: 80px;
525
+ height: 80px;
526
+ -webkit-animation-delay: 2s;
527
+ animation-delay: 2s;
528
+ -webkit-animation-duration: 17s;
529
+ animation-duration: 17s;
530
+ }
531
+
532
+ .bg-bubbles li:nth-child(3) {
533
+ left: 25%;
534
+ -webkit-animation-delay: 4s;
535
+ animation-delay: 4s;
536
+ }
537
+
538
+ .bg-bubbles li:nth-child(4) {
539
+ left: 40%;
540
+ width: 60px;
541
+ height: 60px;
542
+ -webkit-animation-duration: 22s;
543
+ animation-duration: 22s;
544
+ background-color: rgba(255, 255, 255, 0.25);
545
+ }
546
+
547
+ .bg-bubbles li:nth-child(5) {
548
+ left: 70%;
549
+ }
550
+
551
+ .bg-bubbles li:nth-child(6) {
552
+ left: 80%;
553
+ width: 120px;
554
+ height: 120px;
555
+ -webkit-animation-delay: 3s;
556
+ animation-delay: 3s;
557
+ background-color: rgba(255, 255, 255, 0.2);
558
+ }
559
+
560
+ .bg-bubbles li:nth-child(7) {
561
+ left: 32%;
562
+ width: 160px;
563
+ height: 160px;
564
+ -webkit-animation-delay: 7s;
565
+ animation-delay: 7s;
566
+ }
567
+
568
+ .bg-bubbles li:nth-child(8) {
569
+ left: 55%;
570
+ width: 20px;
571
+ height: 20px;
572
+ -webkit-animation-delay: 15s;
573
+ animation-delay: 15s;
574
+ -webkit-animation-duration: 40s;
575
+ animation-duration: 40s;
576
+ }
577
+
578
+ .bg-bubbles li:nth-child(9) {
579
+ left: 25%;
580
+ width: 10px;
581
+ height: 10px;
582
+ -webkit-animation-delay: 2s;
583
+ animation-delay: 2s;
584
+ -webkit-animation-duration: 40s;
585
+ animation-duration: 40s;
586
+ background-color: rgba(255, 255, 255, 0.3);
587
+ }
588
+
589
+ .bg-bubbles li:nth-child(10) {
590
+ left: 90%;
591
+ width: 160px;
592
+ height: 160px;
593
+ -webkit-animation-delay: 11s;
594
+ animation-delay: 11s;
595
+ }
596
+
597
+ @-webkit-keyframes square {
598
+ 0% {
599
+ -webkit-transform: translateY(0);
600
+ transform: translateY(0);
601
+ }
602
+ 100% {
603
+ -webkit-transform: translateY(-700px) rotate(600deg);
604
+ transform: translateY(-700px) rotate(600deg);
605
+ }
606
+ }
607
+
608
+ @keyframes square {
609
+ 0% {
610
+ -webkit-transform: translateY(0);
611
+ transform: translateY(0);
612
+ }
613
+ 100% {
614
+ -webkit-transform: translateY(-700px) rotate(600deg);
615
+ transform: translateY(-700px) rotate(600deg);
616
+ }
617
+ }
618
+ .ssoLoadingMain .ssoLoadingImg {
619
+ position: absolute;
620
+ top:0;
621
+ left: 0;
622
+ bottom: 0;
623
+ right: 0;
624
+ margin: auto;
625
+ }
626
+ </style>