NavUpdateLog.vue
1.26 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
<template>
<div class="com-up-log">
<a :href="v.link" target="blank" @click="clickHandler()" :class="{ isNew: v.isNew }">更新日志</a>
</div>
</template>
<script>
import { Version } from 'glsx-common-sdk'
import { mapGetters } from 'vuex'
const version = new Version({
request: {
baseUrl: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config',
isSign: false
}
})
export default {
name: 'NavUpdateLog',
data() {
return {
v: {}
}
},
mounted() {
this.getUpdateLogCofig()
},
computed: {
...mapGetters(['auth'])
},
methods: {
async getUpdateLogCofig() {
const loginpath = this.auth?.session?.loginpath
if (loginpath) {
const product = loginpath === '/login' ? 'md' : loginpath.slice(1)
this.v = await version.get({ moduleUrl: `scrm-${product}`, env: 'update' })
}
},
clickHandler() {
this.v = version.set()
}
}
}
</script>
<style lang="scss" scoped>
.com-up-log {
position: relative;
margin-right: 6px;
.isNew:after {
content: 'New';
position: absolute;
width: 30px;
height: 16px;
line-height: 16px;
background: #eb4e4e;
border-radius: 4px 4px 4px 0;
top: -12px;
right: -22px;
color: #fff;
font-size: 12px;
}
}
</style>