Search in sources :

Example 66 with UserModel

use of io.jpom.model.data.UserModel in project Jpom by dromara.

the class ServerConfigBean method getUserTempPath.

/**
 * 获取当前登录用户的临时文件存储路径,如果没有登录则抛出异常
 *
 * @return file
 */
public File getUserTempPath() {
    File file = ConfigBean.getInstance().getTempPath();
    UserModel userModel = BaseServerController.getUserModel();
    if (userModel == null) {
        throw new JpomRuntimeException("没有登录");
    }
    file = FileUtil.file(file, userModel.getId());
    FileUtil.mkdir(file);
    return file;
}
Also used : UserModel(io.jpom.model.data.UserModel) File(java.io.File)

Aggregations

UserModel (io.jpom.model.data.UserModel)66 JSONObject (com.alibaba.fastjson.JSONObject)17 MethodFeature (io.jpom.permission.MethodFeature)15 ClassFeature (io.jpom.permission.ClassFeature)14 Feature (io.jpom.permission.Feature)14 NodeModel (io.jpom.model.data.NodeModel)10 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 NotLogin (io.jpom.common.interceptor.NotLogin)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 UserService (io.jpom.service.user.UserService)5 GetMapping (org.springframework.web.bind.annotation.GetMapping)5 StrUtil (cn.hutool.core.util.StrUtil)4 Entity (cn.hutool.db.Entity)4 JSONArray (com.alibaba.fastjson.JSONArray)4 BuildInfoModel (io.jpom.model.data.BuildInfoModel)4 List (java.util.List)4 JsonMessage (cn.jiangzeyin.common.JsonMessage)3 BaseServerController (io.jpom.common.BaseServerController)3 WorkspaceModel (io.jpom.model.data.WorkspaceModel)3 UserLoginDto (io.jpom.model.dto.UserLoginDto)3