<template>
  <div class="box"></div>
</template>

<script>
import { gameRequestApi } from "@/api/common.js";
const { getGameInfo } = gameRequestApi;

export default {
  components: {},
  data() {
    return {};
  },
  created() {
    document.title = "";
    this.loadData();
  },
  methods: {
    loadData() {
      let query = this.$route.query;
      getGameInfo({
        gameId: query.gameId,
        enterpriseId: query.enterpriseId,
      }).then((res) => {
        document.title = res.gameName;
        let gameTypeName = "";
        switch (+res.templateType) {
          case 1:
            gameTypeName = "cmh";
            break;
          case 2:
            break;
          default:
            break;
        }
        query.backMusicUrl = encodeURIComponent(res.gameExt.backMusicUrl);
        this.$router.replace({
          path: `/${gameTypeName}/${res.templateId}${
            query.shareMemberId ? "/support" : ""
          }`,
          query: query,
        });
      });
    },
  },
};
</script>

<style scoped></style>
