修复currentUserid类型为String会报错的bug
This commit is contained in:
@@ -1219,6 +1219,21 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
return uid.isEmpty() ? 0L : Long.parseLong(uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户ID的String值<br>
|
||||
*
|
||||
* @return 用户ID
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public String currentStringUserid() {
|
||||
if (currentUserid == CURRUSERID_NIL || currentUserid == null) {
|
||||
return null;
|
||||
}
|
||||
return this.currentUserid.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户ID<br>
|
||||
*
|
||||
|
||||
@@ -2521,7 +2521,7 @@ public final class Rest {
|
||||
} else if (ptype == long.class) {
|
||||
mv.visitFieldInsn(GETSTATIC, "java/lang/Long", "TYPE", "Ljava/lang/Class;");
|
||||
} else {
|
||||
mv.visitLdcInsn(Type.getType(Type.getInternalName(ptype)));
|
||||
mv.visitLdcInsn(Type.getType(Type.getDescriptor(ptype)));
|
||||
}
|
||||
mv.visitMethodInsn(INVOKEVIRTUAL, reqInternalName, "currentUserid", "(Ljava/lang/Class;)Ljava/io/Serializable;", false);
|
||||
if (ptype == int.class) {
|
||||
|
||||
Reference in New Issue
Block a user