n20-common-lib 1.2.24 → 1.2.25

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,135 @@
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
+ <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,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>