1
2
<template>
<div id="userLayout" :class="['user-layout-wrapper', device]">
谭毅彬
authored
11 months ago
3
4
<div v-show="showContainer" class="container">
<div class="top">
5
6
<div class="header">
<a href="/">
谭毅彬
authored
11 months ago
7
<img src="~@/assets/huaheng.png" class="logo" alt="logo" />
8
9
</a>
</div>
谭毅彬
authored
11 months ago
10
<div class="desc">华恒仓储管理系统</div>
谭毅彬
authored
11 months ago
11
12
</div>
<route-view></route-view>
13
14
<div class="footer">
<div class="copyright">
15
Copyright © 2023 华恒焊接股份有限公司
16
</div>
谭毅彬
authored
11 months ago
17
</div>
18
19
20
21
22
</div>
</div>
</template>
<script>
谭毅彬
authored
11 months ago
23
import { ACCESS_TOKEN, AZURE_AD_AUTH_REDIRECT } from '@/store/mutation-types'
谭毅彬
authored
11 months ago
24
25
26
27
import RouteView from '@/components/layouts/RouteView'
import { mixinDevice } from '@/utils/mixin.js'
import Vue from 'vue'
import { mapActions } from 'vuex'
28
29
export default {
谭毅彬
authored
11 months ago
30
31
name: 'UserLayout',
components: { RouteView },
32
33
mixins: [mixinDevice],
data() {
谭毅彬
authored
11 months ago
34
35
36
return {
showContainer: true
}
37
},
谭毅彬
authored
11 months ago
38
39
created() {
Vue.ls.remove(ACCESS_TOKEN)
谭毅彬
authored
11 months ago
40
41
42
43
44
console.info("process.env.NODE_ENV:" + process.env.NODE_ENV);
if (process.env.NODE_ENV === 'production') {
this.showContainer = false
this.handleLogin(true)
}
谭毅彬
authored
11 months ago
45
46
},
methods: {
谭毅彬
authored
11 months ago
47
...mapActions(['AzureADLogin','AzureADAuthRedirect']),
谭毅彬
authored
11 months ago
48
49
50
51
52
53
handleLogin(rememberMe) {
let loginParams = {
warehouseCode: 'CS0001',
checkKey: this.currdatetime,
remember_me: rememberMe
}
谭毅彬
authored
11 months ago
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
this.AzureADLogin(loginParams).then(res => {
this.$emit('success', res.result)
this.$router.push({ path: '/dashboard/analysis' })
}).catch(err => {
this.$emit('fail', err)
if (err.code == 499) {
this.$router.push({ path: '/user/systemTokenModal' })
}
})
// console.info("AZURE_AD_AUTH_REDIRECT:" + Vue.ls.get(AZURE_AD_AUTH_REDIRECT));
// if (!Vue.ls.get(AZURE_AD_AUTH_REDIRECT)) {
// this.AzureADAuthRedirect().then((res) => {
// Vue.ls.set(AZURE_AD_AUTH_REDIRECT, true, 120 * 1000);
// window.location.href = res.result;
// }).catch((err) => {
// this.$emit('fail', err)
// if (err.code == 499) {
// this.$router.push({path: "/user/systemTokenModal"})
// }
// })
// } else {
// Vue.ls.set(AZURE_AD_AUTH_REDIRECT, false, 120 * 1000)
// var url = window.location.href //获取当前url
// var dz_url = url.split('#')[0];//获取#/之前的字符串
// var cs = dz_url.split('?')[1] //获取?之后的参数字符串
// let loginParams = {
// warehouseCode: 'CS0001',
// checkKey: this.currdatetime,
// remember_me: rememberMe,
// urlParameter : "?" + cs
// }
// this.AzureADLogin(loginParams).then(res => {
// this.$emit('success', res.result)
// this.$router.push({ path: '/dashboard/analysis' })
// }).catch(err => {
// this.$emit('fail', err)
// if (err.code == 499) {
// this.$router.push({ path: '/user/systemTokenModal' })
// }
// })
// }
谭毅彬
authored
11 months ago
95
96
}
},
97
98
99
100
101
mounted() {
document.body.classList.add('userLayout')
},
beforeDestroy() {
document.body.classList.remove('userLayout')
谭毅彬
authored
11 months ago
102
}
103
}
104
105
106
</script>
<style lang="less" scoped>
107
108
#userLayout.user-layout-wrapper {
height: 100%;
109
110
&.mobile {
111
.container {
112
113
114
.main {
max-width: 368px;
width: 98%;
115
}
116
117
}
}
118
119
120
121
.container {
width: 100%;
min-height: 100%;
122
background-color: 255, 255, 255;
123
background-size: 100%;
124
// padding: 110px 0 144px;
125
position: relative;
126
127
128
129
a {
text-decoration: none;
}
130
131
132
133
134
.top {
text-align: center;
.header {
135
136
height: 59px;
line-height: 59px;
137
background-color: #111;
138
139
140
141
142
143
144
145
146
147
.badge {
position: absolute;
display: inline-block;
line-height: 1;
vertical-align: middle;
margin-left: -12px;
margin-top: -10px;
opacity: 0.8;
}
148
149
.logo {
150
151
152
height: 59px;
line-height: 59px;
padding: 19px;
153
154
vertical-align: top;
border-style: none;
155
}
156
157
158
.title {
font-size: 33px;
谭毅彬
authored
11 months ago
159
160
161
162
color: rgba(0, 0, 0, 0.85);
font-family: 'Chinese Quote', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
163
164
165
font-weight: 600;
position: relative;
top: 2px;
166
167
168
}
}
169
.desc {
170
171
font-size: 24px;
color: #111;
172
margin-top: 10%;
173
174
margin-bottom: 70px;
font-weight: bolder;
175
}
176
}
177
178
179
180
181
.main {
min-width: 260px;
width: 368px;
margin: 0 auto;
182
183
184
height: auto;
position: relative;
min-height: 400px;
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
}
.footer {
position: absolute;
width: 100%;
bottom: 0;
padding: 0 16px;
margin: 48px 0 24px;
text-align: center;
.links {
margin-bottom: 8px;
font-size: 14px;
a {
200
color: rgba(0, 0, 0, 0.45);
201
202
203
204
205
transition: all 0.3s;
&:not(:last-child) {
margin-right: 40px;
}
206
207
}
}
208
209
210
211
212
.copyright {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
213
214
}
}
215
}
216
</style>