splash.vue
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
<template>
<view class="container">
<view class="container-box">
<image :src="mpOwnConfig.logo"></image>
<text class="splash-text-muted">连接世界 创造价值</text>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
import api from '@/api/index.js'
export default {
data() {
return {
staticLogo: '../../static/logo.png',
mpOwnConfig: {}
};
},
onLoad() {
uni.setStorageSync('getConfiguration', {
isConfiguration: false
});
this.getPlateForm();
},
created() {
if (!this.userInfo.isToken) {
setTimeout(() => {
uni.reLaunch({
url: '/publicLoginSubPage/public/login'
});
}, 1500);
} else {
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
});
}, 1500);
}
},
computed: {
...mapState(['userInfo']),
},
methods: {
async getPlateForm() {
const res = await api.loginApi.getPlateCustomApi()
this.mpOwnConfig = {
bg: res.background,
logo: res.logo ? res.logo : this.staticLogo,
name: res.name
};
}
}
};
</script>
<style lang="scss">
.container {
width: 100%;
height: 100%;
margin-top: 300rpx;
.container-box {
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
image {
width: 100rpx;
height: 100rpx;
}
}
}
</style>