|
|
@@ -340,6 +340,23 @@ public class UserController extends MyController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Before(LoginInterceptor.class)
|
|
|
+ public void getBalance() {
|
|
|
+ User user = service.findUserByMobileNumber(this.<String>getSessionAttr("mobile_number"));
|
|
|
+
|
|
|
+ if (user == null) {
|
|
|
+ removeSessionAttr("dl-token");
|
|
|
+ removeSessionAttr("role");
|
|
|
+ removeSessionAttr("mobile_number");
|
|
|
+
|
|
|
+ renderJson(MyRet.fail("登录信息失效,请重新登录。").setCode(MyRet.CODE_NO_LOGIN));
|
|
|
+ } else {
|
|
|
+ setSessionAttr("role", user.getRole().toString());
|
|
|
+
|
|
|
+ renderJson(MyRet.ok("获取成功").setData(user.getBalance()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Before(LoginInterceptor.class)
|
|
|
public void getUserInfo() {
|
|
|
User user = service.findUserByMobileNumber(this.<String>getSessionAttr("mobile_number"));
|