user表role改为role_id;后台管理用户增删改查封装成component
This commit is contained in:
		@@ -32,7 +32,7 @@ Page({
 | 
			
		||||
      return
 | 
			
		||||
    } else {
 | 
			
		||||
      // 用户已登录
 | 
			
		||||
      let userGroup = getUserGroupByRole(userInfo.role)
 | 
			
		||||
      let userGroup = getUserGroupByRole(userInfo.roleId)
 | 
			
		||||
      this.setData({
 | 
			
		||||
        debugText: JSON.stringify(options, null, 4),
 | 
			
		||||
        userInfo: userInfo,
 | 
			
		||||
 
 | 
			
		||||
@@ -114,13 +114,13 @@ Page({
 | 
			
		||||
          let result = d.data;
 | 
			
		||||
          if (result.success) {
 | 
			
		||||
            // 登录成功
 | 
			
		||||
            if ([3, 4, 5, 6].includes(result.data.userInfo.role)) {
 | 
			
		||||
            if (![3, 4, 5, 6].includes(result.data.userInfo.roleId)) {
 | 
			
		||||
              wx.showModal({
 | 
			
		||||
                title: '你不是社区居民',
 | 
			
		||||
                content: '管理员请前往网页版登录',
 | 
			
		||||
                showCancel: false,
 | 
			
		||||
                complete: (res) => {
 | 
			
		||||
                  // 
 | 
			
		||||
                  //
 | 
			
		||||
                }
 | 
			
		||||
              })
 | 
			
		||||
              return
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user