Blame view

ant-design-vue-jeecg/src/components/layouts/UserLayout.vue 5.4 KB
肖超群 authored
1
2
<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
3
4
    <div v-show="showContainer" class="container">
      <div class="top">
肖超群 authored
5
6
        <div class="header">
          <a href="/">
谭毅彬 authored
7
            <img src="~@/assets/huaheng.png" class="logo" alt="logo" />
肖超群 authored
8
9
          </a>
        </div>
谭毅彬 authored
10
        <div class="desc">华恒仓储管理系统</div>
11
12
      </div>
      <route-view></route-view>
肖超群 authored
13
14
      <div class="footer">
        <div class="copyright">
15
          Copyright &copy; 2023 华恒焊接股份有限公司
肖超群 authored
16
        </div>
17
      </div>
肖超群 authored
18
19
20
21
22
    </div>
  </div>
</template>

<script>
23
import { ACCESS_TOKEN, AZURE_AD_AUTH_REDIRECT } from '@/store/mutation-types'
谭毅彬 authored
24
25
26
27
import RouteView from '@/components/layouts/RouteView'
import { mixinDevice } from '@/utils/mixin.js'
import Vue from 'vue'
import { mapActions } from 'vuex'
肖超群 authored
28
29

export default {
谭毅彬 authored
30
31
  name: 'UserLayout',
  components: { RouteView },
肖超群 authored
32
33
  mixins: [mixinDevice],
  data() {
34
35
36
    return {
      showContainer: true
    }
肖超群 authored
37
  },
谭毅彬 authored
38
39
  created() {
    Vue.ls.remove(ACCESS_TOKEN)
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
45
46
  },
  methods: {
47
    ...mapActions(['AzureADLogin','AzureADAuthRedirect']),
谭毅彬 authored
48
49
50
51
52
53
    handleLogin(rememberMe) {
      let loginParams = {
        warehouseCode: 'CS0001',
        checkKey: this.currdatetime,
        remember_me: rememberMe
      }
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
95
96
    }
  },
肖超群 authored
97
98
99
100
101
  mounted() {
    document.body.classList.add('userLayout')
  },
  beforeDestroy() {
    document.body.classList.remove('userLayout')
谭毅彬 authored
102
  }
肖超群 authored
103
}
肖超群 authored
104
105
106
</script>

<style lang="less" scoped>
肖超群 authored
107
108
#userLayout.user-layout-wrapper {
  height: 100%;
肖超群 authored
109
肖超群 authored
110
  &.mobile {
肖超群 authored
111
    .container {
肖超群 authored
112
113
114
      .main {
        max-width: 368px;
        width: 98%;
肖超群 authored
115
      }
肖超群 authored
116
117
    }
  }
肖超群 authored
118
肖超群 authored
119
120
121
  .container {
    width: 100%;
    min-height: 100%;
谭毅彬 authored
122
    background-color: 255, 255, 255;
肖超群 authored
123
    background-size: 100%;
谭毅彬 authored
124
    // padding: 110px 0 144px;
肖超群 authored
125
    position: relative;
肖超群 authored
126
肖超群 authored
127
128
129
    a {
      text-decoration: none;
    }
肖超群 authored
130
肖超群 authored
131
132
133
134
    .top {
      text-align: center;

      .header {
谭毅彬 authored
135
136
        height: 59px;
        line-height: 59px;
谭毅彬 authored
137
        background-color: #111;
肖超群 authored
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;
        }
肖超群 authored
148
肖超群 authored
149
        .logo {
谭毅彬 authored
150
151
152
          height: 59px;
          line-height: 59px;
          padding: 19px;
肖超群 authored
153
154
          vertical-align: top;
          border-style: none;
肖超群 authored
155
        }
肖超群 authored
156
157
158

        .title {
          font-size: 33px;
谭毅彬 authored
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';
肖超群 authored
163
164
165
          font-weight: 600;
          position: relative;
          top: 2px;
肖超群 authored
166
167
168
        }
      }
肖超群 authored
169
      .desc {
谭毅彬 authored
170
171
        font-size: 24px;
        color: #111;
谭毅彬 authored
172
        margin-top: 10%;
谭毅彬 authored
173
174
        margin-bottom: 70px;
        font-weight: bolder;
肖超群 authored
175
      }
肖超群 authored
176
    }
肖超群 authored
177
肖超群 authored
178
179
180
181
    .main {
      min-width: 260px;
      width: 368px;
      margin: 0 auto;
谭毅彬 authored
182
183
184
      height: auto;
      position: relative;
      min-height: 400px;
肖超群 authored
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 {
肖超群 authored
200
          color: rgba(0, 0, 0, 0.45);
肖超群 authored
201
202
203
204
205
          transition: all 0.3s;

          &:not(:last-child) {
            margin-right: 40px;
          }
肖超群 authored
206
207
        }
      }
肖超群 authored
208
209
210
211
212

      .copyright {
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
      }
肖超群 authored
213
214
    }
  }
肖超群 authored
215
}
肖超群 authored
216
</style>