Browse Source

微信解绑优化

eganwu 1 năm trước cách đây
mục cha
commit
30df627678

+ 6 - 0
src/custom/restcontroller/common/usercenter/usercenter.java

@@ -338,6 +338,9 @@ public class usercenter extends Controller {
                 sqlFactory.addParameter("userinfo", wechatuserinfo);
                 sqllist.add(sqlFactory.getSQL());
             } else {
+                if (dbConnect.runSqlQuery("select 1 from sys_wechatapp_openids where openid='" + openid + "' and userid='" + userid + "' and systemclient='" + systemclient + "'").isEmpty()) {
+                    return getErrReturnObject().setErrMsg("解绑失败,当前微信账号无权限解绑").toString();
+                }
                 sqllist.add("delete from sys_wechatapp_openids where openid='" + openid + "' and userid='" + userid + "' and systemclient='" + systemclient + "'");
             }
         }
@@ -350,6 +353,9 @@ public class usercenter extends Controller {
                 sqlFactory.addParameter("userinfo", wechatuserinfo);
                 sqllist.add(sqlFactory.getSQL());
             } else {
+                if (dbConnect.runSqlQuery("select 1 from sys_wechatapp_unionids where unionid='" + unionid + "' and userid='" + userid + "'").isEmpty()) {
+                    return getErrReturnObject().setErrMsg("解绑失败,当前微信账号无权限解绑").toString();
+                }
                 sqllist.add("delete from sys_wechatapp_unionids where unionid='" + unionid + "' and userid='" + userid + "'");
             }
         }