|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cnd3b.common.restful;
|
|
|
|
|
|
+import com.cnd3b.restcontroller.publicmethod.users.Users;
|
|
|
import com.cnd3b.utility.Encryption;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -60,7 +61,7 @@ public class WebClientRest {
|
|
|
String[] mustkeys = {"classname", "method", "content"};
|
|
|
for (String mustkey : mustkeys) {
|
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
|
- return new D3BReturnObject_Err().setErrMsg("json缺少KEY"+mustkey).toString();
|
|
|
+ return new D3BReturnObject_Err().setErrMsg("json缺少KEY" + mustkey).toString();
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
@@ -257,14 +258,13 @@ public class WebClientRest {
|
|
|
if (requestcontent.containsKey("client")) {
|
|
|
client = requestcontent.getString("client");
|
|
|
}
|
|
|
-
|
|
|
- DBConnect dbConnect = new DBConnect();
|
|
|
- if (dbConnect.runSqlQuery("select *from tenterprise_users where fphonenumber='" + phonenumber + "'").isEmpty()) {
|
|
|
- JSONObject object = new JSONObject();
|
|
|
- object.put("code", 0);
|
|
|
- object.put("msg", "当前手机号未注册!");
|
|
|
- return object.toString();
|
|
|
- }
|
|
|
+// DBConnect dbConnect = new DBConnect();
|
|
|
+// if (dbConnect.runSqlQuery("select * from tenterprise_users where fphonenumber='" + phonenumber + "'").isEmpty()) {
|
|
|
+// JSONObject object = new JSONObject();
|
|
|
+// object.put("code", 0);
|
|
|
+// object.put("msg", "当前手机号未注册!");
|
|
|
+// return object.toString();
|
|
|
+// }
|
|
|
|
|
|
String password = createPassWord();
|
|
|
parameter.phonenumber_password.put(phonenumber, password);
|
|
|
@@ -347,6 +347,12 @@ public class WebClientRest {
|
|
|
}
|
|
|
|
|
|
if (resultcode == 0 || Arrays.asList(nocheckphonenumber).contains(phonenumber)) {
|
|
|
+ //登陆时,如果验证码验证成功,但是手机号未注册过,则自动进行注册!
|
|
|
+ if (connect.runSqlQuery("select * from tenterprise_users where fphonenumber='" + phonenumber + "'").isEmpty()) {
|
|
|
+ Users users = new Users(requestcontent);
|
|
|
+ users.register_usersByLogin(phonenumber);
|
|
|
+ }
|
|
|
+
|
|
|
SQLFactory factory = new SQLFactory(this, "手机账号列表查询");
|
|
|
factory.addParameter("fphonenumber", phonenumber);
|
|
|
Rows rows = connect.runSqlQuery(factory.getSQL());
|