<!-- 加密测试 -->
<template>
  <div class="app-container">
    <el-form label-width="80px" :model="requestBody">
      <el-form-item label="加密key">
        <el-input v-model="requestBody.key"></el-input>
      </el-form-item>
      <el-form-item label="order明文">
        <el-input type="textarea" v-model="requestBody.order"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">加密</el-button>
      </el-form-item>
      <el-form-item label="返回报文">
        <el-input type="textarea" v-model="requestBody.resp"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {encrypt} from "@/api/sandbox/encrypt"

export default {
  data() {
    return {
      requestBody: {
        key: "",
        order: "",
        resp: ""
      }
    }
  },
  methods: {
    onSubmit() {
      encrypt(this.requestBody).then(res => {
        if (res.code == 200) {
          this.requestBody.resp = res.data
        }
      })
    }
  }
}
</script>
