|
|
@@ -160,11 +160,14 @@ public class UserController extends MyController {
|
|
|
}
|
|
|
|
|
|
if (ret.isOk()) {
|
|
|
- // 更新用户时间
|
|
|
+ String token = createToken("dl-token");
|
|
|
+ // 更新用户登录时间
|
|
|
service.updateUserLoginTime(mobileNumber);
|
|
|
+ // 更新用户token
|
|
|
+ service.updateToken(mobileNumber, token);
|
|
|
|
|
|
// 将token传回前端
|
|
|
- ret.set("token", createToken("dl-token"));
|
|
|
+ ret.set("token", token);
|
|
|
|
|
|
// 其它参数的封装
|
|
|
setSessionAttr("user_id", ((User)ret.get("data")).getStr("id"));
|
|
|
@@ -174,6 +177,40 @@ public class UserController extends MyController {
|
|
|
|
|
|
renderJson(ret);
|
|
|
}
|
|
|
+
|
|
|
+ // 慧用工免登请求地址,用来换取手机号
|
|
|
+ public void tokenToMobileNumber() {
|
|
|
+ // --- 从 JSON 请求体中获取参数 ---
|
|
|
+ JSONObject requestBodyJson = MyController.getJsonModelByRequestAndType(getRequest(), JSONObject.class);
|
|
|
+
|
|
|
+ System.out.println(requestBodyJson.toJSONString());
|
|
|
+
|
|
|
+ String token = requestBodyJson.getString("token");
|
|
|
+
|
|
|
+ if (StrKit.notBlank(token)) {
|
|
|
+ renderText(service.findMobileNumberByToken(token));
|
|
|
+ } else {
|
|
|
+ renderText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 慧用工签约回调地址
|
|
|
+ public void hygSign() {
|
|
|
+ // --- 从 JSON 请求体中获取参数 ---
|
|
|
+ JSONObject requestBodyJson = MyController.getJsonModelByRequestAndType(getRequest(), JSONObject.class);
|
|
|
+
|
|
|
+ System.out.println(requestBodyJson.toJSONString());
|
|
|
+
|
|
|
+ String workerid = requestBodyJson.getString("workerid");
|
|
|
+
|
|
|
+ if (StrKit.notBlank(workerid)) {
|
|
|
+ System.out.println(workerid);
|
|
|
+// renderText(service.update(hygSign));
|
|
|
+ renderText("");
|
|
|
+ } else {
|
|
|
+ renderText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Before(LoginInterceptor.class)
|
|
|
public void getUserInfo() {
|