n20-common-lib 1.2.24 → 1.2.27

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.
@@ -1,135 +1,146 @@
1
- <template>
2
- <div
3
- class="login-wrap"
4
- :style="{ backgroundImage: loginBg && `url(${loginBg})` }"
5
- >
6
- <div class="login-logo-box flex-box flex-v">
7
- <img
8
- v-if="loginLogo"
9
- :src="loginLogo"
10
- :style="{ width: loginLogoWidth, height: loginLogoHeight }"
11
- />
12
- <span
13
- v-if="loginLogo && loginLogoText"
14
- class="login-logo-hr m-l-s m-r-s"
15
- ></span>
16
- <h3 class="login-logo-text">
17
- {{ loginLogoText }}
18
- </h3>
19
- </div>
20
- <loginForm
21
- v-if="type"
22
- @changType="getChangetype"
23
- :login-types="loginTypes"
24
- :login-then="loginThen"
25
- class="login-form"
26
- >
27
- <div slot="header" class="login-form-header m-b text-c">欢 迎 登 录</div>
28
- <div slot="footer" class="login-form-footer m-t text-r">
29
- <slot name="footer">
30
- 为达到更好的体验效果,请<a
31
- class="el-icon-bottom"
32
- href="https://down.360safe.com/se/360se13.1.5101.0.exe"
33
- download="启程浏览器.exe"
34
- style="text-decoration: none; color: var(--color-primary)"
35
- >下载</a
36
- >启程浏览器
37
- </slot>
38
- </div>
39
- </loginForm>
40
- <retrievePw
41
- @changType="getChangetype"
42
- class="login-form"
43
- v-else
44
- ></retrievePw>
45
- </div>
46
- </template>
47
-
48
- <script>
49
- import getJsonc from '../../assets/getJsonc'
50
- import realUrl from '../../assets/realUrl'
51
-
52
- import loginForm from './form.vue'
53
- import retrievePw from './retrievePw.vue'
54
- export default {
55
- name: 'Login',
56
- components: {
57
- loginForm,
58
- retrievePw
59
- },
60
- props: {
61
- loginThen: {
62
- type: Function,
63
- default: undefined
64
- }
65
- },
66
- data() {
67
- return {
68
- loginTypes: ['account'],
69
- loginBg: undefined,
70
- loginLogo: undefined,
71
- loginLogoWidth: '60px',
72
- loginLogoHeight: 'auto',
73
- loginLogoText: '',
74
- type: true
75
- }
76
- },
77
- created() {
78
- this.removeStorage()
79
- this.setConfig()
80
- },
81
- methods: {
82
- setConfig() {
83
- getJsonc('/server-config.jsonc').then(({ _layoutData = {} }) => {
84
- _layoutData.loginTypes && (this.loginTypes = _layoutData.loginTypes)
85
- this.loginBg = realUrl(_layoutData.loginBg)
86
- this.loginLogo = realUrl(_layoutData.loginLogo)
87
- this.loginLogoWidth = _layoutData.loginLogoWidth
88
- this.loginLogoHeight = _layoutData.loginLogoHeight
89
- this.loginLogoText = _layoutData.loginLogoText
90
- })
91
- },
92
- removeStorage() {
93
- for (let k in window.sessionStorage) {
94
- !['subEntry'].includes(k) && window.sessionStorage.removeItem(k)
95
- }
96
- },
97
- getChangetype(val) {
98
- this.type = val
99
- }
100
- }
101
- }
102
- </script>
103
- <style scoped>
104
- .login-logo-box {
105
- position: absolute;
106
- top: 26px;
107
- left: 26px;
108
- color: #ffffff;
109
- }
110
- .login-logo-hr {
111
- height: 24px;
112
- border-left: 2px solid;
113
- }
114
- .login-logo-text {
115
- margin: 0;
116
- font-size: 28px;
117
- }
118
- .login-form {
119
- position: absolute;
120
- top: 20%;
121
- right: 10%;
122
- width: 324px;
123
- min-height: 360px;
124
- background: #f7f6f6;
125
- padding: 30px !important;
126
- }
127
- .login-form-header {
128
- font-size: 16px;
129
- color: #3d4a57;
130
- }
131
- .login-form-footer {
132
- font-size: 12px;
133
- color: #3d4a57;
134
- }
135
- </style>
1
+ <template>
2
+ <div
3
+ class="login-wrap"
4
+ :style="{ backgroundImage: loginBg && `url(${loginBg})` }"
5
+ >
6
+ <div class="login-logo-box flex-box flex-v">
7
+ <img
8
+ v-if="loginLogo"
9
+ :src="loginLogo"
10
+ :style="{ width: loginLogoWidth, height: loginLogoHeight }"
11
+ />
12
+ <span
13
+ v-if="loginLogo && loginLogoText"
14
+ class="login-logo-hr m-l-s m-r-s"
15
+ ></span>
16
+ <h3 class="login-logo-text">
17
+ {{ loginLogoText }}
18
+ </h3>
19
+ </div>
20
+ <div class="title-nav">{{title}}</div>
21
+ <loginForm
22
+ v-if="type"
23
+ @changType="getChangetype"
24
+ :login-types="loginTypes"
25
+ :login-then="loginThen"
26
+ class="login-form"
27
+ >
28
+ <div slot="header" class="login-form-header m-b text-c">欢 迎 登 录</div>
29
+ <div slot="footer" class="login-form-footer m-t text-r">
30
+ <slot name="footer">
31
+ 为达到更好的体验效果,请<a
32
+ class="el-icon-bottom"
33
+ href="https://down.360safe.com/se/360se13.1.5101.0.exe"
34
+ download="启程浏览器.exe"
35
+ style="text-decoration: none; color: var(--color-primary)"
36
+ >下载</a
37
+ >启程浏览器
38
+ </slot>
39
+ </div>
40
+ </loginForm>
41
+ <retrievePw
42
+ @changType="getChangetype"
43
+ class="login-form"
44
+ v-else
45
+ ></retrievePw>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ import getJsonc from '../../assets/getJsonc'
51
+ import realUrl from '../../assets/realUrl'
52
+
53
+ import loginForm from './form.vue'
54
+ import retrievePw from './retrievePw.vue'
55
+ export default {
56
+ name: 'Login',
57
+ components: {
58
+ loginForm,
59
+ retrievePw
60
+ },
61
+ props: {
62
+ loginThen: {
63
+ type: Function,
64
+ default: undefined
65
+ }
66
+ },
67
+ data() {
68
+ return {
69
+ title:'',
70
+ loginTypes: ['account'],
71
+ loginBg: undefined,
72
+ loginLogo: undefined,
73
+ loginLogoWidth: '60px',
74
+ loginLogoHeight: 'auto',
75
+ loginLogoText: '',
76
+ type: true
77
+ }
78
+ },
79
+ created() {
80
+ this.removeStorage()
81
+ this.setConfig()
82
+ },
83
+ methods: {
84
+ setConfig() {
85
+ getJsonc('/server-config.jsonc').then(({ _layoutData = {} }) => {
86
+ _layoutData.loginTypes && (this.loginTypes = _layoutData.loginTypes)
87
+ this.loginBg = realUrl(_layoutData.loginBg)
88
+ this.loginLogo = realUrl(_layoutData.loginLogo)
89
+ this.loginLogoWidth = _layoutData.loginLogoWidth
90
+ this.loginLogoHeight = _layoutData.loginLogoHeight
91
+ this.loginLogoText = _layoutData.loginLogoText
92
+ this.title = _layoutData.loginLogoText
93
+ })
94
+ },
95
+ removeStorage() {
96
+ for (let k in window.sessionStorage) {
97
+ !['subEntry'].includes(k) && window.sessionStorage.removeItem(k)
98
+ }
99
+ },
100
+ getChangetype(val) {
101
+ this.type = val
102
+ }
103
+ }
104
+ }
105
+ </script>
106
+ <style scoped>
107
+ .login-logo-box {
108
+ position: absolute;
109
+ top: 26px;
110
+ left: 26px;
111
+ color: #ffffff;
112
+ }
113
+ .login-logo-hr {
114
+ height: 24px;
115
+ border-left: 2px solid;
116
+ }
117
+ .login-logo-text {
118
+ margin: 0;
119
+ font-size: 28px;
120
+ }
121
+ .login-form {
122
+ position: absolute;
123
+ top: 20%;
124
+ right: 10%;
125
+ width: 324px;
126
+ min-height: 360px;
127
+ background: #f7f6f6;
128
+ padding: 30px !important;
129
+ }
130
+ .login-form-header {
131
+ font-size: 16px;
132
+ color: #3d4a57;
133
+ }
134
+ .login-form-footer {
135
+ font-size: 12px;
136
+ color: #3d4a57;
137
+ }
138
+ .title-nav {
139
+ position: absolute;
140
+ top: 40%;
141
+ left: 10%;
142
+ font-size: 68px;
143
+ font-weight: 600;
144
+ color: #e6ad85;
145
+ }
146
+ </style>
@@ -1,90 +1,90 @@
1
- <template>
2
- <div v-loading="loadingV">
3
- <canvas
4
- ref="qr-canvas"
5
- style="display: block; width: 212px; height: 212px; margin: 0 auto"
6
- ></canvas>
7
- <div
8
- class="text-r"
9
- style="font-size: 12px; color: #3d4a57; margin-bottom: -8px"
10
- >
11
- 请使用网银移动端扫码免Ukey登录<el-button
12
- class="m-l-s"
13
- type="text"
14
- @click="refreshQrCode"
15
- >
16
- <i class="el-icon-refresh"></i>
17
- 刷新</el-button
18
- >
19
- </div>
20
- </div>
21
- </template>
22
- <script>
23
- import QRCode from 'qrcode'
24
- import axios from '../../utils/axios'
25
-
26
- export default {
27
- data() {
28
- this.timeA = undefined
29
- return {
30
- loadingV: false,
31
- qrCode: ''
32
- }
33
- },
34
- created() {
35
- this.getQrcode()
36
- },
37
- beforeDestroy() {
38
- clearTimeout(this.timeA)
39
- },
40
- methods: {
41
- getQrcode() {
42
- this.loadingV = true
43
- let loading = () => {
44
- setTimeout(() => {
45
- this.loadingV = false
46
- }, 500)
47
- }
48
-
49
- axios
50
- .get('/bems/prod_1.0/uas/api/qrCode', null, { loading })
51
- .then(({ data }) => {
52
- this.qrCode = data.qrCode
53
-
54
- let qrCanvas = this.$refs['qr-canvas']
55
- let width = qrCanvas.clientWidth
56
-
57
- QRCode.toCanvas(this.$refs['qr-canvas'], this.qrCode, {
58
- width: width,
59
- height: width,
60
- margin: 1
61
- })
62
-
63
- this.getQrCodePwd()
64
- })
65
- },
66
- refreshQrCode() {
67
- this.getQrcode()
68
- },
69
- getQrCodePwd() {
70
- axios
71
- .get(`/bems/prod_1.0/uas/api/qrCode/${this.qrCode}`, null, {
72
- loading: false
73
- })
74
- .then(({ data }) => {
75
- clearTimeout(this.timeA)
76
- if (data.status === 3) {
77
- this.QrcodeLogin(data)
78
- } else {
79
- this.timeA = setTimeout(() => {
80
- this.getQrCodePwd()
81
- }, 2000)
82
- }
83
- })
84
- },
85
- QrcodeLogin({ userNo, qrcode }) {
86
- this.$emit('qrcode-login', { userNo, qrcode })
87
- }
88
- }
89
- }
90
- </script>
1
+ <template>
2
+ <div v-loading="loadingV">
3
+ <canvas
4
+ ref="qr-canvas"
5
+ style="display: block; width: 212px; height: 212px; margin: 0 auto"
6
+ ></canvas>
7
+ <div
8
+ class="text-r"
9
+ style="font-size: 12px; color: #3d4a57; margin-bottom: -8px"
10
+ >
11
+ 请使用网银移动端扫码免Ukey登录<el-button
12
+ class="m-l-s"
13
+ type="text"
14
+ @click="refreshQrCode"
15
+ >
16
+ <i class="el-icon-refresh"></i>
17
+ 刷新</el-button
18
+ >
19
+ </div>
20
+ </div>
21
+ </template>
22
+ <script>
23
+ import QRCode from 'qrcode'
24
+ import axios from '../../utils/axios'
25
+
26
+ export default {
27
+ data() {
28
+ this.timeA = undefined
29
+ return {
30
+ loadingV: false,
31
+ qrCode: ''
32
+ }
33
+ },
34
+ created() {
35
+ this.getQrcode()
36
+ },
37
+ beforeDestroy() {
38
+ clearTimeout(this.timeA)
39
+ },
40
+ methods: {
41
+ getQrcode() {
42
+ this.loadingV = true
43
+ let loading = () => {
44
+ setTimeout(() => {
45
+ this.loadingV = false
46
+ }, 500)
47
+ }
48
+
49
+ axios
50
+ .get('/bems/prod_1.0/uas/api/qrCode', null, { loading })
51
+ .then(({ data }) => {
52
+ this.qrCode = data.qrCode
53
+
54
+ let qrCanvas = this.$refs['qr-canvas']
55
+ let width = qrCanvas.clientWidth
56
+
57
+ QRCode.toCanvas(this.$refs['qr-canvas'], this.qrCode, {
58
+ width: width,
59
+ height: width,
60
+ margin: 1
61
+ })
62
+
63
+ this.getQrCodePwd()
64
+ })
65
+ },
66
+ refreshQrCode() {
67
+ this.getQrcode()
68
+ },
69
+ getQrCodePwd() {
70
+ axios
71
+ .get(`/bems/prod_1.0/uas/api/qrCode/${this.qrCode}`, null, {
72
+ loading: false
73
+ })
74
+ .then(({ data }) => {
75
+ clearTimeout(this.timeA)
76
+ if (data.status === 3) {
77
+ this.QrcodeLogin(data)
78
+ } else {
79
+ this.timeA = setTimeout(() => {
80
+ this.getQrCodePwd()
81
+ }, 2000)
82
+ }
83
+ })
84
+ },
85
+ QrcodeLogin({ userNo, qrcode }) {
86
+ this.$emit('qrcode-login', { userNo, qrcode })
87
+ }
88
+ }
89
+ }
90
+ </script>