<template>
  <div class="tos-container">
    <el-card>
      <div v-html="tosContent"></div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import DOMPurify from 'dompurify';
import { getPrivacyPolicyListMax } from '@/api/system/business/policy';

const tosContent = ref('');
const language = ref('zh-CN');

onMounted(() => {
  fetchTos();
});

const fetchTos = async () => {
  try {
    const res = await getPrivacyPolicyListMax();
    tosContent.value = DOMPurify.sanitize(res.data.content);
  } catch (error) {
    console.error('获取服务条款失败', error);
  }
};
</script>

<style scoped>
.tos-container {
  padding: 20px;
}
</style>
