'完善了禁言天数的修改'
parent
fb47bece7d
commit
03a2798acc
|
@ -34,4 +34,22 @@ export function stateMute(data) {
|
|||
method:'GET',
|
||||
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
|
||||
})
|
||||
}
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue