'完善了禁言天数的修改'

main
jwq666 2024-07-25 10:58:41 +08:00
parent fb47bece7d
commit 03a2798acc
2 changed files with 45 additions and 4 deletions

View File

@ -35,3 +35,21 @@ export function stateMute(data) {
data:data
})
}
// 获取禁言天数
export function getMuteInfo(userId) {
return request({
url: '/FriendMute/FriendMute/getMuteInfo',
method: 'get',
params: {
userId: userId
}
})
}
// 修改
export function updateMuteEdit(data) {
return request({
url: '/FriendMute/FriendMute/updateAppAdmin',
method: 'put',
data:data
})
}

View File

@ -83,7 +83,7 @@
</template>
<script setup>
import { getADUser, addFriendMute, stateMute } from "@/api/message/adUser.js";
import { getADUser, addFriendMute, stateMute, getMuteInfo, updateMuteEdit } from "@/api/message/adUser.js";
import { getADUserInfo } from "@/api/system/userinfo.js";
import fileUpload from './../common/file/fileUpload/index.vue';
import cropping from './../common/file/fileUpload/Cropping.vue';
@ -110,6 +110,7 @@ const reason = ref();
const muteDay = ref();
const newUserId = ref();
const sendercont = ref([]);
const hasMuteData = ref(false);
const leftClick = () => {
@ -134,7 +135,20 @@ const getInfo = () => {
const avatarIcon = (e) => {
return QNDomain + e;
};
const toProhibition = () => {
const toProhibition = async () => {
const response = await getMuteInfo(newUserId.value);
console.log(response);
if (response.data) {
//
muteDay.value = response.data.muteDay;
reason.value = response.data.reason;
hasMuteData.value = true;
}else {
// muteDay reason
muteDay.value = '';
reason.value = '';
hasMuteData.value = false;
}
show2.value = true;
};
const muteInfo = () => {
@ -152,11 +166,20 @@ const muteInfo = () => {
reason: reason.value,
status: 1,
};
addFriendMute(form).then(e => {
if (hasMuteData.value) {
//
updateMuteEdit(form).then(e => {
console.log(e);
proxy.$modal.msgSuccess("禁言修改成功!");
show2.value = false;
});
} else {
addFriendMute(form).then(e => {
console.log(e);
proxy.$modal.msgSuccess("禁言成功!");
show2.value = false;
});
}
};
function gotoAddr(id, name, youavatar) {