bot 操作前端测试内容

This commit is contained in:
flykhan 2023-02-22 22:40:06 +08:00
parent 72c64062a9
commit bf098bf0d4
1 changed files with 83 additions and 1 deletions

View File

@ -1,14 +1,96 @@
<template>
<ContentBase>我的Bot</ContentBase>
<ContentBase>我的Bot
<div class="row">添加 Bot 测试{{ error_message }}</div>
<div class="row">删除 Bot 测试{{ remove_message }}</div>
<div class="row">更新 Bot 测试{{ update_message }}</div>
<div class="row">获取 Bot 列表测试{{ getlist_message }}</div>
</ContentBase>
</template>
<script>
import ContentBase from "../../../components/ContentBase.vue";
// import $ from "jquery";
import { useStore } from "vuex";
import { ref } from "vue";
export default {
components: {
ContentBase,
},
setup: () => {
const store = useStore();
let error_message = ref('');
let remove_message = ref('');
let update_message = ref('');
let getlist_message = ref('');
/* store.dispatch("add", {
title: "Bot 的标题",
description: "Bot 的描述",
content: "标题的代码",
success(resp) {
console.log(resp);
error_message.value = resp.error_message;
},
error(resp) {
console.log(resp);
error_message.value = resp.error_message;
}
})
store.dispatch("remove", {
bot_id: 18,
success(resp) {
if (resp.error_message === "success") {
console.log(resp);
remove_message.value = resp.error_message;
} else {
console.log("botremove" + resp.error_message);
remove_message.value = resp.error_message;
}
},
error(resp) {
console.log("botremove" + resp);
remove_message.value = resp.error_message;
}
}) */
store.dispatch("update", {
bot_id: 24,
title: "Bot 的标题新24",
description: "Bot 的描述24",
content: "标题的代码24",
success(resp) {
if (resp.error_message === "success") {
console.log("更新成功" + resp.error_message);
update_message.value = resp.error_message;
} else {
console.log("更新失败" + resp.error_message);
update_message.value = resp.error_message;
}
}
})
/* store.dispatch("getList", {
success(resp) {
console.log(resp);
getlist_message.value = resp;
},
error(resp) {
console.log(resp);
getlist_message.value = resp;
}
}) */
return {
error_message,
remove_message,
update_message,
getlist_message,
}
}
};
</script>