Prechádzať zdrojové kódy

禁用用户功能新增

李万涛 2 rokov pred
rodič
commit
e8e32864a4

+ 1 - 1
components/beian/index.vue

xqd
@@ -1,6 +1,6 @@
 <template>
 	<view class="beian" @click="handleClick">
-		蜀ICP备2023016577号-1
+		蜀ICP备2023016577号-2
 	</view>
 </template>
 

+ 18 - 0
pages/chat/chat.vue

xqd xqd
@@ -164,12 +164,23 @@
 
 
 			if (uni.getStorageSync('token')) {
+				// if (!uni.getStorageSync('hasForbidden').status) {
+				// 	return uni.showToast({
+				// 		title: uni.getStorageSync('hasForbidden').msg,
+				// 		icon: 'none'
+				// 	});
+				// }
+
+
 				this.freeCount = 99999
 
 				let res = await userInfo()
 				console.log('gpt页用户个人信息返回值', res);
 				if (res.code == 0) {
+					uni.removeStorageSync('hasForbidden')
 					this.userInfo = res.data
+				} else {
+					// console.log('您的账号已被禁用,请练习管理员', res);
 				}
 			}
 
@@ -212,6 +223,13 @@
 
 			// 发送信息
 			async send(e) {
+				if (uni.getStorageSync('hasForbidden').status == 0) {
+					return uni.showToast({
+						title: '抱歉,您的账号已被禁用,请联系管理员解封后使用!',
+						icon: 'none'
+					});
+				}
+
 				if (this.freeCount <= 0) {
 					uni.showToast({
 						title: `抱歉,您的免费次数(${this.freeCountSum}次)已用完!`,

+ 22 - 1
pages/user/signin.scss

xqd xqd xqd
@@ -1,5 +1,19 @@
+page{
+	overflow-x: hidden;
+}
+::v-deep ._img{
+	// margin-left: 50%!important;
+	
+	// transform: translateX(-50%)!important;
+}
 
+::v-deep ._span{
+	display: flex;
+	justify-content: center;
+}
 .topTxtAndImg{
+	overflow-x: hidden;
+
 	margin-bottom: 100rpx;
 	display: flex;
 	align-items: center;
@@ -12,7 +26,7 @@
 		font-size: 32rpx;
 		text-align: justify;
 		line-height: 50rpx;
-		text-indent: 2em;
+		// text-indent: 2em;
 		margin-top: 30rpx;
 	}
 }
@@ -312,4 +326,11 @@
 	.deftoregister{
 		margin-top: 50rpx;
 		padding-left: 60rpx;
+	}
+	
+	.outerCon{
+		overflow-x: hidden;
+		.mobile{
+			overflow-x: hidden;
+		}
 	}

+ 2 - 3
pages/user/signin.vue

xqd
@@ -3,15 +3,14 @@
 		<view class="mobile">
 			<view style="padding: 30rpx; padding-top: 24rpx;padding-bottom: 200rpx;">
 				<view class="topTxtAndImg">
-					<view class="swiper">
+					<!-- 	<view class="swiper">
 						<swiper class="banner" circular :autoplay="true"
 							:style="{width:isPc?'50vw':'680rpx',height:isPc?'auto':'450rpx'}">
-							<!-- <swiper class="banner" circular :autoplay="false"> -->
 							<swiper-item v-for="i in bannerList">
 								<image :src="i.picture" mode="" @click="handleBannerJump(i.url)"></image>
 							</swiper-item>
 						</swiper>
-					</view>
+					</view> -->
 					<view class="txt">
 						<u-parse :content="companyDes"></u-parse>
 					</view>

+ 11 - 0
utils/request/responseInterceptors.js

xqd xqd
@@ -25,6 +25,7 @@ module.exports = (vm) => {
 		// 	}
 		// }
 		return data || {}
+
 	}, (response) => {
 		/*  对响应错误做点什么 (statusCode !== 200)*/
 		let statusCode = response.statusCode
@@ -32,6 +33,16 @@ module.exports = (vm) => {
 			uni.redirectTo({
 				url: '/pages/user/signin'
 			})
+		} else if (statusCode == 403 && response.data.code == 403 && response.data.msg == '您的账号已被拉黑!') {
+			uni.setStorageSync('hasForbidden', {
+				status: 0,
+				msg: response.data.msg
+			})
+			return uni.showToast({
+				title: response.data.msg,
+				icon: 'none'
+			});
+
 		} else if (statusCode == 500) {
 			uni.$u.toast('接口报错')
 		}