App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div id="app">
  3. <el-dialog title="温馨提示" top="30vh" :visible.sync="tipShow" width="30%" center>
  4. <span>为保护个人隐私信息,系统自动对敏感数据进行脱敏。如需编辑、查看完整信息,可通过“用户隐私二次认证”功能进行验证,验证通过之后,24小时内可查看完整信息。</span>
  5. <span slot="footer" class="dialog-footer">
  6. <el-button @click="tipShow = false">关闭</el-button>
  7. </span>
  8. </el-dialog>
  9. <router-view />
  10. </div>
  11. </template>
  12. <script>
  13. import { getPrivacySwitch } from '@/api/privacy'
  14. export default {
  15. name: 'App',
  16. data() {
  17. return {
  18. tipShow: false
  19. }
  20. },
  21. created() {
  22. if (this.$store.state.user.token) {
  23. this.getPrivacySwitch()
  24. }
  25. },
  26. methods: {
  27. getPrivacySwitch() {
  28. getPrivacySwitch().then((res) => {
  29. var IsTipshow = localStorage.getItem('IsTipshow')
  30. localStorage.setItem('privacyTime', res.data)
  31. if (this.$store.state.user.token && !IsTipshow && res.data === 0) {
  32. this.tipShow = true
  33. localStorage.setItem('IsTipshow', true)
  34. }
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. .el-dialog__header {
  42. background-color: #3A68F2;
  43. text-align: left;
  44. }
  45. .el-dialog__title {
  46. color: #FFFFFF;
  47. }
  48. </style>