feat: 新增聊天机器人
This commit is contained in:
parent
0f380ec86e
commit
a647255179
21
src/App.vue
21
src/App.vue
|
@ -6,10 +6,27 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
mounted() {
|
||||
// console.log('已执行聊天机器人')
|
||||
// 在这里插入你的聊天机器人配置代码
|
||||
window.difyChatbotConfig = {
|
||||
token: 'pEaqgEzss5GXwtBk',
|
||||
baseUrl: 'http://9552chyh1609.vicp.fun'
|
||||
};
|
||||
|
||||
// 动态创建脚本元素并插入到文档中
|
||||
const script = document.createElement('script');
|
||||
script.src = 'http://9552chyh1609.vicp.fun/embed.min.js';
|
||||
script.id = 'pEaqgEzss5GXwtBk';
|
||||
script.defer = true;
|
||||
document.head.appendChild(script);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
#dify-chatbot-bubble-button {
|
||||
background-color: #1C64F2 !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
>
|
||||
<el-select v-model="user.deptId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(dep, index) in departmentList"
|
||||
v-for="dep in departmentList"
|
||||
:key="dep.id"
|
||||
:label="dep.deptName"
|
||||
:value="dep.id"
|
||||
|
@ -232,7 +232,7 @@ export default {
|
|||
queryInfo.name = this.name
|
||||
}
|
||||
const resOfFetchUserList = await this.$API.user.reqGetUserList(queryInfo)
|
||||
if (resOfFetchUserList.code == 0) {
|
||||
if (resOfFetchUserList.code === 0) {
|
||||
this.total = resOfFetchUserList.data.total
|
||||
this.users = resOfFetchUserList.data.list
|
||||
this.loadingOfGetUserList = false
|
||||
|
@ -265,7 +265,7 @@ export default {
|
|||
const resOfAddOrUpdateUser = await this.$API.user[
|
||||
this.user.id ? 'reqUpdateUser' : 'reqAddUser'
|
||||
](this.user)
|
||||
if (resOfAddOrUpdateUser.code == 0) {
|
||||
if (resOfAddOrUpdateUser.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: `${this.user.id ? '修改' : '添加'}用户成功!`
|
||||
|
@ -301,7 +301,7 @@ export default {
|
|||
.then(async() => {
|
||||
const ids = [row.id]
|
||||
const resOfDeleteUser = await this.$API.user.reqDeleteUser(ids)
|
||||
if (resOfDeleteUser.code == 0) {
|
||||
if (resOfDeleteUser.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
|
@ -331,7 +331,7 @@ export default {
|
|||
ids
|
||||
)
|
||||
// console.log(resOfRemoveRolesInBatches);
|
||||
if (resOfRemoveUsersInBatches.code == 0) {
|
||||
if (resOfRemoveUsersInBatches.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '批量删除成功!'
|
||||
|
@ -351,8 +351,9 @@ export default {
|
|||
handleSelectionChange(selection) {
|
||||
this.selectedUsers = selection
|
||||
},
|
||||
// 根据角色id获取角色名称
|
||||
roleName(id) {
|
||||
const theRole = this.roles.find((role) => role.id == id)
|
||||
const theRole = this.roles.find((role) => role.id === id)
|
||||
if (theRole) {
|
||||
return theRole.name
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue