Explorar el Código

处理微信小程序无法审核通过的问题

xie.bx hace 2 años
padre
commit
af5359cc98

+ 5 - 0
im-platform/src/main/java/com/bx/implatform/entity/User.java

@@ -62,6 +62,11 @@ public class User extends Model<User> {
     @TableField("head_image_thumb")
     private String headImageThumb;
 
+    /**
+     * 用户类型  1:普通用户 2:审核专用账户
+     */
+    @TableField("type")
+    private Integer type;
 
     /**
      * 个性签名

+ 1 - 0
im-platform/src/main/java/com/bx/implatform/vo/LoginVO.java

@@ -19,4 +19,5 @@ public class LoginVO {
 
     @ApiModelProperty(value = "refreshToken过期时间(秒)")
     private Integer refreshTokenExpiresIn;
+
 }

+ 3 - 1
im-platform/src/main/java/com/bx/implatform/vo/UserVO.java

@@ -30,6 +30,9 @@ public class UserVO {
     @ApiModelProperty(value = "性别")
     private Integer sex;
 
+    @ApiModelProperty(value = "用户类型 1:普通用户 2:审核账户")
+    private Integer type;
+
     @Length(max = 1024,message = "个性签名不能大于1024个字符")
     @ApiModelProperty(value = "个性签名")
     private String signature;
@@ -40,7 +43,6 @@ public class UserVO {
     @ApiModelProperty(value = "头像缩略图")
     private String headImageThumb;
 
-
     @ApiModelProperty(value = "是否在线")
     private Boolean online;
 

+ 2 - 1
im-platform/src/main/resources/db/db.sql

@@ -6,7 +6,8 @@ create table `im_user`(
     `head_image` varchar(255) default '' comment '用户头像',
     `head_image_thumb` varchar(255) default '' comment '用户头像缩略图',
     `password` varchar(255) not null comment '密码(明文)',
-    `sex`  tinyint(1) default 0 comment '性别 0:男 1::女',
+    `sex`  tinyint(1) default 0 comment '性别 0:男 1:女',
+    `type`  smallint default 1 comment '用户类型 1:普通用户 2:审核账户',
     `signature` varchar(1024) default '' comment '个性签名',
     `last_login_time`  datetime DEFAULT null comment '最后登录时间',
     `created_time` datetime DEFAULT CURRENT_TIMESTAMP comment '创建时间',

+ 19 - 0
im-uniapp/App.vue

@@ -14,6 +14,8 @@
 			init() {
 				// 加载数据
 				store.dispatch("load").then(() => {
+					// 审核
+					this.initAudit();
 					// 初始化websocket
 					this.initWebSocket();
 				}).catch((e) => {
@@ -140,9 +142,26 @@
 				// this.audioTip = uni.createInnerAudioContext();
 				// this.audioTip.src =  "/static/audio/tip.wav";
 				// this.audioTip.play();
+			},
+			initAudit() {
+				console.log("initAudit")
+				if(store.state.userStore.userInfo.type == 1){
+					// 显示群组功能
+					uni.setTabBarItem({
+						index: 2,
+						text: "群聊"
+					})	
+				}else{
+					// 隐藏群组功能
+					uni.setTabBarItem({
+						index: 2,
+						text: "资讯"
+					})	
+				}
 			}
 		},
 		onLaunch() {
+
 			// 登录状态校验
 			if (uni.getStorageSync("loginInfo")) {
 				// 初始化

+ 1 - 2
im-uniapp/pages.json

@@ -18,7 +18,6 @@
 	}, {
 		"path": "pages/group/group",
 		"style": {
-			"navigationBarTitleText": "群聊列表",
 			"enablePullDownRefresh": false
 		}
 
@@ -75,7 +74,7 @@
 				"pagePath": "pages/group/group",
 				"iconPath": "static/tarbar/group.png",
 				"selectedIconPath": "static/tarbar/group_active.png",
-				"text": "群聊"
+				"text": "资讯"
 			},
 			{
 				"pagePath": "pages/mine/mine",

+ 1 - 1
im-uniapp/pages/group/group-edit.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page group-edit">
+	<view v-if="$store.state.userStore.userInfo.type == 1" class="page group-edit">
 		<uni-forms ref="form" :modelValue="group" :rules="rules" validate-trigger="bind" label-position="top"
 			label-width="100%">
 			<uni-forms-item label="群聊头像:" name="headImage">

+ 1 - 1
im-uniapp/pages/group/group-info.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page group-info">
+	<view v-if="$store.state.userStore.userInfo.type == 1" class="page group-info">
 		<view class="group-members">
 			<view class="member-items">
 				<view v-for="(member,idx) in  groupMembers" :key="idx">

+ 1 - 1
im-uniapp/pages/group/group-invite.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page group-invite">
+	<view v-if="$store.state.userStore.userInfo.type == 1" class="page group-invite">
 		<view class="search-bar">
 			<uni-search-bar v-model="searchText" cancelButton="none" placeholder="输入好友昵称搜索"></uni-search-bar>
 		</view>

+ 1 - 1
im-uniapp/pages/group/group-member.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="page group-member">
+	<view v-if="$store.state.userStore.userInfo.type == 1" class="page group-member">
 		<view class="search-bar">
 			<uni-search-bar v-model="searchText" cancelButton="none" placeholder="输入成员昵称搜索"></uni-search-bar>
 		</view>

+ 1 - 1
im-uniapp/pages/group/group.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="tab-page group">
+	<view v-if="$store.state.userStore.userInfo.type == 1" class="tab-page group">
 		<view class="nav-bar">
 			<view class="nav-search">
 				<uni-search-bar @focus="onFocusSearch" cancelButton="none" placeholder="点击搜索群聊"></uni-search-bar>

+ 1 - 1
im-uniapp/store/chatStore.js

@@ -203,7 +203,7 @@ export default {
 					},
 					fail(e) {
 						// 不存在聊天记录,清空聊天列表
-						context.commit("setChats",[]);
+						context.commit("initChats",[]);
 						resolve()
 					}
 				});