<template>
  <!-- 地图导览页面 -->
  <view class="content">
    <image :src="'data:image/png;base64,' + imgUrl" mode="aspectFit" />
  </view>
</template>

<script>
export default {
  data() {
    return {
      imgUrl: "",
    };
  },
  created() {
    this.getMap();
  },

  methods: {
    getMap() {
      uni.request({
        url: "https://jtishfw.ncjti.edu.cn/yinxin/ncjtSecurityManagement/getSchoolMap",
        data: "",
        header: {
          Accept: "text/plain",
        },
        method: "POST",
        sslVerify: true,
        success: ({ data, statusCode, header }) => {
          if (statusCode == 200) {
            // console.log(data);
            // console.log(data.replace(/[\r\n]/g, ""));
            var url = JSON.parse(data.replace(/[\r\n]/g, "")); //解析base64字符串
            // console.log(url);
            this.imgUrl = url.map;
            // console.log(this.imgUrl);
          }
        },
        fail: (error) => {},
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: 100%;
  height: 100%;
  image {
    width: 750rpx;
    height: 1207rpx;
  }
}
</style>
