wxc 2 years ago
parent
commit
801d42e39e
  1. 4
      src/api/work/index.ts
  2. 27
      src/views/work/SendMsg.vue

4
src/api/work/index.ts

@ -22,4 +22,8 @@ export function getDissatisfied(query) {
// 获取信件详情
export function getMailDetail(query) {
return request.get({ url: '/work/mail/detail', query })
}
export function getSendMsg(query){
return request.get({url:'/work/send',query})
}

27
src/views/work/SendMsg.vue

@ -0,0 +1,27 @@
<template>
<div style="display: flex;justify-content: center;align-items: center;margin-top: 100px; width: 50vh; margin-left: 20vh;">
<el-input v-model="msg" placeholder="请输入消息内容"></el-input>
<el-button type="primary" @click="handleClick">发送消息</el-button>
</div>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { ElMessage } from "element-plus";
import { getSendMsg } from "@/api/work";
const msg = ref("");
const handleClick = () => {
const formData = new FormData();
formData.append("msg", msg.value);
getSendMsg(formData).then((res) => {
console.log(res);
ElMessage.success("发送成功");
}).catch((err) => {
console.log(err);
ElMessage.error("发送失败");
});
}
</script>
Loading…
Cancel
Save