|
@@ -4,6 +4,7 @@ import com.baomidou.kisso.SSOHelper
|
|
|
import com.baomidou.kisso.SSOToken
|
|
|
import com.gxzc.zen.api.sys.model.SysUser
|
|
|
import com.gxzc.zen.common.util.HttpUtil
|
|
|
+import javax.servlet.http.HttpServletRequest
|
|
|
|
|
|
/**
|
|
|
* SSO 工具类
|
|
@@ -13,7 +14,11 @@ import com.gxzc.zen.common.util.HttpUtil
|
|
|
*/
|
|
|
object SSOUtil {
|
|
|
fun getCurUserId(): Long? {
|
|
|
- val token = SSOHelper.attrToken<SSOToken>(HttpUtil.getRequest()) ?: SSOHelper.getToken(HttpUtil.getRequest())
|
|
|
+ return getCurUserId(HttpUtil.getRequest())
|
|
|
+ }
|
|
|
+
|
|
|
+ fun getCurUserId(request: HttpServletRequest): Long? {
|
|
|
+ val token = SSOHelper.attrToken<SSOToken>(request) ?: SSOHelper.getToken(request)
|
|
|
return token?.uid?.toLong()
|
|
|
}
|
|
|
|