举报拉黑

This commit is contained in:
abu 2025-05-14 04:25:36 +08:00
parent 0fb5844b6a
commit 770ac45b0e
18 changed files with 992 additions and 413 deletions

View File

@ -16,7 +16,7 @@ export function checkText({
Content, Content,
}) { }) {
return http.request({ return http.request({
url: 'https://console.tim.qq.com/v4/im_msg_audit/content_moderation' url: 'https://console.tim.qq.com/v4/im_msg_audit/content_moderation',
method: Method.POST, method: Method.POST,
params: { params: {
sdkappid: '1600080789', sdkappid: '1600080789',
@ -26,7 +26,7 @@ export function checkText({
contenttype: 'json' contenttype: 'json'
}, },
data: { data: {
AuditName: '1600080789_1745821176_amtwGf' AuditName: '1600080789_1745821176_amtwGf',
ContentType: 'Text', ContentType: 'Text',
Content, Content,
ExtSender ExtSender

View File

@ -1,4 +1,6 @@
import { http } from "@/utils/request.js"; import {
http
} from "@/utils/request.js";
import api from "@/config/api.js"; import api from "@/config/api.js";
@ -74,3 +76,12 @@ export function logout () {
needToken: true, needToken: true,
}) })
} }
// 注销用户
export function logoffConfirm() {
return http.request({
url: '/passport/member/cancellation',
method: "PUT",
needToken: true,
})
}

View File

@ -255,7 +255,7 @@ export function vlogMyLikedList(page, pageSize, userId) {
/** /**
* 查询我喜欢的视频 * 查询我喜欢的视频
*/ */
export function vlogMeTag(path, page, pageSize, userId) { export function vlogMeTag(path, page, pageSize, userId, myId = '') {
return http.request({ return http.request({
url: api.vlog + "/vlog/" + path, url: api.vlog + "/vlog/" + path,
method: Method.GET, method: Method.GET,
@ -263,7 +263,8 @@ export function vlogMeTag(path, page, pageSize, userId) {
params: { params: {
page, page,
pageSize, pageSize,
userId userId,
myId
}, },
}); });
} }
@ -493,3 +494,75 @@ export function vlogQueryDoIFollowVloger({
} }
}); });
} }
/**
* 举报
*/
export function reportVideo({
myId,
vlogId,
reason,
description
}) {
return http.request({
url: api.vlog + "/fans/blockVideo",
method: Method.POST,
params: {
myId,
vlogId,
reason,
description
}
});
}
/**
* 拉黑
*/
export function blockUser({
myId,
vlogerId
}) {
return http.request({
url: api.vlog + "/fans/block",
method: Method.POST,
params: {
myId,
vlogerId
}
});
}
/**
* 查询用户是否拉黑博主
*/
export function queryBlockVloger({
myId,
vlogerId
}) {
return http.request({
url: api.vlog + "/fans/queryBlockVloger",
method: Method.GET,
params: {
myId,
vlogerId
}
});
}
/**
* 取消拉黑
*/
export function cancelBlock({
myId,
vlogerId
}) {
return http.request({
url: api.vlog + "/fans/cancelBlock",
method: Method.POST,
params: {
myId,
vlogerId
}
});
}

View File

@ -201,7 +201,19 @@
></image> ></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text> <text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text>
</view> </view>
<!-- 5.转轮 --> <!-- 5.举报 -->
<view
v-if="item.isShowProgressBarTime == false"
@click="toJubao(item)"
style="opacity: 0.9; margin-top: 17px"
>
<image
src="@/static/img/jubao.png"
style="width: 40px; height: 40px; position: absolute; right: 5px"
></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">举报</text>
</view>
<!-- 6.转轮 -->
<block v-if="platform == 'ios' && false"> <block v-if="platform == 'ios' && false">
<view <view
v-if="item.isShowProgressBarTime == false" v-if="item.isShowProgressBarTime == false"
@ -594,6 +606,16 @@ export default {
// 刷新点赞数据 // 刷新点赞数据
this.refreshVlogCounts(); this.refreshVlogCounts();
} }
// 初始化视频数据,处理举报
if (data.init == 'guanzhu') {
console.log('触发guanzhu初始化视频数据');
this.get();
}
// 处理拉黑
if (data.lahei == true) {
console.log('触发初始化视频数据');
this.init();
}
} }
}; };
this.platform = uni.getSystemInfoSync().platform; this.platform = uni.getSystemInfoSync().platform;
@ -633,6 +655,20 @@ export default {
}, },
onReady() {}, onReady() {},
methods: { methods: {
toJubao(item) {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
//举报
uni.navigateTo({
url: `/pages/report/index?vlogId=${item.vlogId}&from=guanzhu`
});
},
// 点赞取消点赞,后刷新点赞状态 // 点赞取消点赞,后刷新点赞状态
refreshLike(vlogId, flag) { refreshLike(vlogId, flag) {
var me = this; var me = this;

View File

@ -201,7 +201,19 @@
></image> ></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text> <text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text>
</view> </view>
<!-- 5.转轮 --> <!-- 5.举报 -->
<view
v-if="item.isShowProgressBarTime == false"
@click="toJubao(item)"
style="opacity: 0.9; margin-top: 17px"
>
<image
src="@/static/img/jubao.png"
style="width: 40px; height: 40px; position: absolute; right: 5px"
></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">举报</text>
</view>
<!-- 6.转轮 -->
<block v-if="platform == 'ios' && false"> <block v-if="platform == 'ios' && false">
<view <view
v-if="item.isShowProgressBarTime == false" v-if="item.isShowProgressBarTime == false"
@ -595,6 +607,16 @@ export default {
// 刷新点赞数据 // 刷新点赞数据
this.refreshVlogCounts(); this.refreshVlogCounts();
} }
// 初始化视频数据,处理举报
if (data.init == 'local') {
console.log('触发local初始化视频数据');
this.get();
}
// 处理拉黑
if (data.lahei == true) {
console.log('触发初始化视频数据');
this.init();
}
} }
}; };
this.platform = uni.getSystemInfoSync().platform; this.platform = uni.getSystemInfoSync().platform;
@ -635,6 +657,20 @@ export default {
}, },
onReady() {}, onReady() {},
methods: { methods: {
toJubao(item) {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
//举报
uni.navigateTo({
url: `/pages/report/index?vlogId=${item.vlogId}&from=local`
});
},
// 点赞取消点赞,后刷新点赞状态 // 点赞取消点赞,后刷新点赞状态
refreshLike(vlogId, flag) { refreshLike(vlogId, flag) {
var me = this; var me = this;

View File

@ -194,7 +194,19 @@
></image> ></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text> <text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text>
</view> </view>
<!-- 5.转轮 --> <!-- 5.举报 -->
<view
v-if="item.isShowProgressBarTime == false"
@click="toJubao(item)"
style="opacity: 0.9; margin-top: 17px"
>
<image
src="@/static/img/jubao.png"
style="width: 40px; height: 40px; position: absolute; right: 5px"
></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">举报</text>
</view>
<!-- 6.转轮 -->
<block v-if="platform == 'ios' && false"> <block v-if="platform == 'ios' && false">
<view <view
v-if="item.isShowProgressBarTime == false" v-if="item.isShowProgressBarTime == false"
@ -589,6 +601,16 @@ export default {
// 刷新点赞数据 // 刷新点赞数据
this.refreshVlogCounts(); this.refreshVlogCounts();
} }
// 初始化视频数据,处理举报
if (data.init == 'tuijian') {
console.log('触发初始化视频数据');
this.get();
}
// 处理拉黑
if (data.lahei == true) {
console.log('触发初始化视频数据');
this.init();
}
} }
}; };
this.platform = uni.getSystemInfoSync().platform; this.platform = uni.getSystemInfoSync().platform;
@ -629,6 +651,20 @@ export default {
}, },
onReady() {}, onReady() {},
methods: { methods: {
toJubao(item) {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
//举报
uni.navigateTo({
url: `/pages/report/index?vlogId=${item.vlogId}&from=tuijian`
});
},
async refreshVlogCounts() { async refreshVlogCounts() {
// 查询当前点赞数,重新赋值给当前视频 // 查询当前点赞数,重新赋值给当前视频
var me = this; var me = this;

BIN
icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 360 KiB

View File

@ -3,7 +3,7 @@
"appid": "__UNI__6DB512D", "appid": "__UNI__6DB512D",
"description": "admin", "description": "admin",
"versionName": "4.0.0", "versionName": "4.0.0",
"versionCode" : 402, "versionCode": 403,
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
"android": { "android": {

View File

@ -487,6 +487,14 @@
"titleNView": false // "titleNView": false //
} }
} }
},
{
"path": "pages/report/index",
"style": {
"navigationBarTitleText": "举报",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#181b27"
}
} }
], ],
"subPackages": [ "subPackages": [

View File

@ -204,7 +204,19 @@
></image> ></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text> <text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">分享</text>
</view> </view>
<!-- 5.转轮 --> <!-- 5.举报 -->
<view
v-if="item.isShowProgressBarTime == false"
@click="toJubao(item)"
style="opacity: 0.9; margin-top: 17px"
>
<image
src="@/static/img/jubao.png"
style="width: 40px; height: 40px; position: absolute; right: 5px"
></image>
<text style="color: #ffffff; margin-top: 5px; font-size: 14px; text-align: center; font-weight: bold; margin-top: 40px">举报</text>
</view>
<!-- 6.转轮 -->
<block v-if="platform == 'ios' && false"> <block v-if="platform == 'ios' && false">
<view <view
v-if="item.isShowProgressBarTime == false" v-if="item.isShowProgressBarTime == false"
@ -635,6 +647,20 @@ export default {
}, },
onReady() {}, onReady() {},
methods: { methods: {
toJubao(item) {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
//举报
uni.navigateTo({
url: `/pages/report/index?vlogId=${item.vlogId}&from=detail`
});
},
async refreshVlogCounts() { async refreshVlogCounts() {
// 查询当前点赞数,重新赋值给当前视频 // 查询当前点赞数,重新赋值给当前视频
var me = this; var me = this;

View File

@ -128,10 +128,27 @@
> >
<text class="follow-text">关注我</text> <text class="follow-text">关注我</text>
</view> </view>
<view
v-if="block"
class="follow-btn"
@click="quxiaolahei"
>
<text class="follow-text">解除拉黑</text>
</view>
<view
@click="lahei"
v-if="!block"
class="follow-btn"
>
<text class="follow-text">拉黑</text>
</view>
</view> </view>
</view> </view>
<view class="tab-wrapper"> <view
class="tab-wrapper"
v-if="!block"
>
<view <view
class="tab-item" class="tab-item"
@click="switchTab(0)" @click="switchTab(0)"
@ -170,7 +187,10 @@
</view> </view>
</view> </view>
<view class="vlog-list"> <view
class="vlog-list"
v-if="!block"
>
<view <view
class="vlogBox" class="vlogBox"
v-for="(vlog, index) in vlogList" v-for="(vlog, index) in vlogList"
@ -193,14 +213,14 @@
</view> </view>
<view <view
v-if="vlogList.length == 0" v-if="vlogList.length == 0 && block == false"
class="empty" class="empty"
> >
<text class="empty-text">~ 空空如也 ~</text> <text class="empty-text">~ 空空如也 ~</text>
</view> </view>
<view <view
v-if="vlogList.length > 0" v-if="vlogList.length > 0 && block == false"
class="not-empty" class="not-empty"
> >
<text class="not-empty-text">~ 没有更多了 ~</text> <text class="not-empty-text">~ 没有更多了 ~</text>
@ -214,7 +234,19 @@ let system = uni.getSystemInfoSync();
import { clickFeedBack } from '@/utils/tools.js'; import { clickFeedBack } from '@/utils/tools.js';
import api from '@/config/api.js'; import api from '@/config/api.js';
import storage from '@/utils/storage.js'; //缓存 import storage from '@/utils/storage.js'; //缓存
import { vlogUserInfo, vlogQueryDoIFollowVloger, vlogMyPublicList, vlogMyPrivateList, vlogMyLikedList, vlogMeTag, vlogFansCancel, vlogFansFollow } from '@/api/vlog'; import {
queryBlockVloger,
cancelBlock,
blockUser,
vlogUserInfo,
vlogQueryDoIFollowVloger,
vlogMyPublicList,
vlogMyPrivateList,
vlogMyLikedList,
vlogMeTag,
vlogFansCancel,
vlogFansFollow
} from '@/api/vlog';
import { getAstro, getAnimal, dateFormat, graceNumber, isStrEmpty } from '@/utils/tools.js'; import { getAstro, getAnimal, dateFormat, graceNumber, isStrEmpty } from '@/utils/tools.js';
export default { export default {
@ -253,7 +285,8 @@ export default {
page: 0, page: 0,
totalpage: 0, totalpage: 0,
vlogList: [], vlogList: [],
channelComment: null channelComment: null,
block: false //true=拉黑false=没拉黑
}; };
}, },
destroyed() { destroyed() {
@ -333,9 +366,64 @@ export default {
duration: 3000 duration: 3000
}); });
} }
// 查询我是否拉黑博主
var isblock = await queryBlockVloger({ myId: myUserId, vlogerId: userPageId });
if (isblock.data.status == 200) {
this.block = isblock.data.data;
}
} }
}, },
methods: { methods: {
async quxiaolahei() {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
var res = await cancelBlock({
myId: myUserInfo.id, //我的id
vlogerId: this.userPageId // 博主id
});
if (res.data.status == 200) {
uni.showToast({
icon: 'none',
title: '已解除拉黑'
});
this.channelComment.postMessage({
type: 'comment-counts',
data: { lahei: true }
});
this.block = false;
}
},
async lahei() {
var myUserInfo = storage.getVlogUserInfo();
if (myUserInfo == null) {
uni.navigateTo({
url: '/pages/passport/login',
animationType: 'slide-in-bottom'
});
return;
}
var res = await blockUser({
myId: myUserInfo.id, //我的id
vlogerId: this.userPageId // 博主id
});
if (res.data.status == 200) {
uni.showToast({
icon: 'none',
title: '已拉黑'
});
this.block = true;
this.channelComment.postMessage({
type: 'comment-counts',
data: { lahei: true }
});
}
},
setBasicUserInfo(myUserInfo) { setBasicUserInfo(myUserInfo) {
// 根据生日判断星座 // 根据生日判断星座
let birthday = myUserInfo.birthday; let birthday = myUserInfo.birthday;
@ -376,7 +464,12 @@ export default {
page = page + 1; page = page + 1;
me.page = page; me.page = page;
let userId = me.userPageId; let userId = me.userPageId;
var result = await vlogMeTag(requrl, page, 10, userId); var myUserInfo = storage.getVlogUserInfo();
var myId = '';
if (myUserInfo != null) {
myId = myUserInfo.id;
}
var result = await vlogMeTag(requrl, page, 10, userId, myId);
if (result.data.status == 200) { if (result.data.status == 200) {
let vlogList = result.data.data.rows; let vlogList = result.data.data.rows;
console.log(vlogList); console.log(vlogList);

View File

@ -44,6 +44,11 @@
:title="`关于我们`" :title="`关于我们`"
@click="navigateTo('/pages/mine/set/editionIntro')" @click="navigateTo('/pages/mine/set/editionIntro')"
></u-cell-item> ></u-cell-item>
<u-cell-item
title="用户注销"
v-if="userInfo.id"
@click="logoff"
></u-cell-item>
</u-cell-group> </u-cell-group>
<view <view
class="submit" class="submit"
@ -105,6 +110,13 @@ export default {
this.$options.filters.navigateToLogin('redirectTo'); this.$options.filters.navigateToLogin('redirectTo');
}, },
/**
* 用户注销
*/
logoff() {
this.$options.filters.logoff();
},
/** /**
* 确认退出 * 确认退出
* 清除缓存重新登录 * 清除缓存重新登录

View File

@ -82,6 +82,15 @@
> >
<text class="btn-text">发布视频</text> <text class="btn-text">发布视频</text>
</view> </view>
<view class="pubInfo">
<text style="color: #fff; font-size: 24rpx">欢迎使用本应用。为保障所有用户良好的使用体验,您必须同意以下内容:</text>
<text style="color: #fff; font-size: 24rpx">1. 禁止上传或传播任何违法、淫秽、暴力、骚扰、恐吓、辱骂、仇恨等内容;</text>
<text style="color: #fff; font-size: 24rpx">2. 禁止骚扰、恶意攻击或冒充他人;</text>
<text style="color: #fff; font-size: 24rpx">3. 对于举报内容我们将在24小时内进行审核处理</text>
<text style="color: #fff; font-size: 24rpx">4. 严重违规者,我们将删除其内容并永久封禁账号;</text>
<text style="color: #fff; font-size: 24rpx">5.用户可通过设置页面提交账号注销申请,我们将在合理时间内完成数据清除。</text>
<text style="color: #fff; font-size: 24rpx">继续使用本应用即表示您已阅读并同意本协议。</text>
</view>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
@ -92,6 +101,7 @@ import storage from '@/utils/storage.js'; //缓存
// graceNumber // graceNumber
// } from '@/utils/tools.js' // } from '@/utils/tools.js'
import api from '@/config/api.js'; import api from '@/config/api.js';
import { checkText } from '@/api/checkInfo.js';
export default { export default {
data() { data() {
return { return {
@ -162,7 +172,7 @@ export default {
let event = e; let event = e;
this.title = e.detail.value; this.title = e.detail.value;
}, },
doPublich() { async doPublich() {
if (!this.upFlage) { if (!this.upFlage) {
return; return;
} }
@ -189,7 +199,20 @@ export default {
height: me.height, height: me.height,
cityCode: storage.getCityCode() cityCode: storage.getCityCode()
}; };
// 校验文本内容
var checkData = {
ExtSender: userId,
Content: this.title
};
var checkRes = await checkText(checkData);
console.log(checkRes);
if (checkRes.data.Result == 'Block') {
uni.showToast({
icon: 'none',
title: '标题内容违规'
});
return;
}
// 发布视频 // 发布视频
let serverUrl = api.vlog; let serverUrl = api.vlog;
uni.request({ uni.request({
@ -304,6 +327,12 @@ export default {
</script> </script>
<style scoped> <style scoped>
.pubInfo {
display: flex;
flex-direction: column;
margin-top: 20rpx;
font-size: 24rpx;
}
.prpage { .prpage {
position: absolute; position: absolute;
left: 0; left: 0;

158
pages/report/index.vue Normal file
View File

@ -0,0 +1,158 @@
<template>
<view>
<u-alert-tips
:show-icon="true"
type="info"
:description="description"
></u-alert-tips>
<view style="margin-top: 20rpx; padding: 0 40rpx">
<u-radio-group
:width="'50%'"
size="50"
v-model="jubaoType"
>
<u-radio
style="margin-top: 20rpx"
:label-disabled="false"
v-for="(item, index) in list"
:key="index"
:name="item.content"
>
{{ item.content }}
</u-radio>
</u-radio-group>
<!-- -->
<view style="margin-top: 40rpx">
<view style="margin-bottom: 20rpx">举报描述选填</view>
<u-input
maxlength="32"
v-model="des"
:type="'textarea'"
:border="true"
:height="200"
:auto-height="true"
/>
<view style="text-align: right">{{ des.length }}/32</view>
</view>
</view>
<!-- -->
<u-button
class="custom-style"
:ripple="true"
type="error"
@click="sub"
>
提交
</u-button>
</view>
</template>
<script>
import { reportVideo } from '@/api/vlog';
import storage from '@/utils/storage.js'; //
export default {
data() {
return {
vlogId: '',
channelComment: null,
description: '您的举报我们将尽快受理,核实后我们将第一时间告知受理结果,请尽量提交完整的举报描述',
jubaoType: '',
des: '',
list: [
{
id: 1,
content: '低俗色情'
},
{
id: 2,
content: '违法犯罪'
},
{
id: 3,
content: '涉政信息'
},
{
id: 4,
content: '虚假宣传'
},
{
id: 5,
content: '不良向导'
},
{
id: 6,
content: '侵犯个人隐私'
}
],
flag: true
};
},
destroyed() {
console.log('举报页面销毁');
// BroadcastChannel
if (this.channelComment) {
this.channelComment.close();
}
},
onLoad(e) {
this.channelComment = new BroadcastChannel('comment-counts');
this.vlogId = e.vlogId;
this.init = e.from;
},
methods: {
async sub() {
if (!this.flag) return;
this.flag = false;
console.log(this.jubaoType);
if (this.jubaoType) {
var data = {
myId: storage.getVlogUserInfo().id,
vlogId: this.vlogId,
reason: this.jubaoType,
description: this.des
};
console.log(data);
var res = await reportVideo(data);
console.log(res);
if (res.data.status == 200) {
uni.showToast({
icon: 'none',
title: '举报成功'
});
// videoList
this.channelComment.postMessage({
type: 'comment-counts',
data: { lahei: true }
});
setTimeout(() => {
if (this.init == 'detail') {
uni.switchTab({
url: '/pages/tabbar/vlog/index'
});
} else {
uni.navigateBack();
}
}, 1000);
}
} else {
this.flag = true;
uni.showToast({
icon: 'none',
title: '请选择举报原因'
});
}
}
}
};
</script>
<style scoped>
.custom-style {
width: 680rpx;
margin: 0 auto;
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
}
</style>

View File

@ -236,6 +236,7 @@ export default {
} }
}, },
onShow() { onShow() {
console.log('首页');
var prop = this.pageList[this.curIndex]; var prop = this.pageList[this.curIndex];
if (storage.getRefreshVlogIndex() == '1') { if (storage.getRefreshVlogIndex() == '1') {
// 登录后需要刷新数据 // 登录后需要刷新数据
@ -247,8 +248,15 @@ export default {
} else { } else {
try { try {
console.log('index刷新子组件'); console.log('index刷新子组件');
var lst = this.$refs[prop].dataList;
if (lst.length) {
this.$refs[prop].showVd(); this.$refs[prop].showVd();
} catch {} } else {
this.$refs[prop].get();
}
} catch (e) {
console.log('首页刷新异常');
}
} }
}, },
onHide() { onHide() {

BIN
static/img/jubao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -364,6 +364,7 @@
<script> <script>
import storage from '@/utils/storage.js'; // import storage from '@/utils/storage.js'; //
import { checkText } from '@/api/checkInfo.js';
import { vlogCommentCounts, vlogCommentUnLike, vlogCommentLike, vlogCommentDelete, vlogCommentList, vlogCommentCreate } from '@/api/vlog'; import { vlogCommentCounts, vlogCommentUnLike, vlogCommentLike, vlogCommentDelete, vlogCommentList, vlogCommentCreate } from '@/api/vlog';
import { dateFormat, graceNumber, getDateBeforeNow } from '@/utils/tools.js'; import { dateFormat, graceNumber, getDateBeforeNow } from '@/utils/tools.js';
@ -695,6 +696,21 @@ export default {
content: me.currentComment content: me.currentComment
}; };
//
var checkData = {
ExtSender: userId,
Content: me.currentComment
};
var checkRes = await checkText(checkData);
console.log(checkRes);
if (checkRes.data.Result == 'Block') {
uni.showToast({
icon: 'none',
title: '内容违规'
});
return;
}
var result = await vlogCommentCreate(pendingCommentObject); var result = await vlogCommentCreate(pendingCommentObject);
console.log(result); console.log(result);
if (result.data.status == 200) { if (result.data.status == 200) {

View File

@ -1,5 +1,11 @@
import Foundation from "./Foundation.js"; import Foundation from "./Foundation.js";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import {
logoffConfirm
} from "@/api/login";
import {
clearIm
} from "@/utils/handleim.js";
/** /**
* 金钱单位置换 2999 --> 2,999.00 * 金钱单位置换 2999 --> 2,999.00
* @param val * @param val
@ -91,6 +97,37 @@ export function clearStrComma(str) {
return str; return str;
} }
/**
* 用户注销
*
*/
export function logoff() {
uni.showModal({
title: "提示",
content: "确认注销用户么?注销用户将无法再次登录并失去当前数据。",
confirmColor: Vue.prototype.$mainColor,
async success(res) {
if (res.confirm) {
// 退出im登录
clearIm()
await logoffConfirm();
storage.setHasLogin(false);
storage.setAccessToken("");
storage.setRefreshToken("");
storage.setUuid("");
storage.setUserInfo({});
// 清理vlog信息
storage.setVlogToken("");
storage.setVlogUserInfo(null);
// 清除初始化数据内容
storage.setRefreshVlogIndex("1"); //需要刷新
navigateToLogin("redirectTo");
}
},
});
}
/** /**
* 判断用户是否登录 * 判断用户是否登录
* @param val 如果为auth则判断是否登录 * @param val 如果为auth则判断是否登录