mirror of https://gitee.com/y_project/RuoYi.git
上传文件windows去除盘符
parent
304da21e6d
commit
2b20edeff8
|
@ -53,7 +53,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label"><span style="color: red; ">*</span>登录账号:</label>
|
<label class="col-sm-4 control-label"><span style="color: red; ">*</span>登录账号:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="loginName" placeholder="请输入登录账号" class="form-control required" type="text" maxlength="30" required>
|
<input name="loginName" placeholder="请输入登录账号" class="form-control" type="text" maxlength="30" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -113,7 +113,12 @@ public class FileUploadUtils
|
||||||
|
|
||||||
File desc = getAbsoluteFile(baseDir, fileName);
|
File desc = getAbsoluteFile(baseDir, fileName);
|
||||||
file.transferTo(desc);
|
file.transferTo(desc);
|
||||||
String pathFileName = StringUtils.substringAfterLast(baseDir, ":") + fileName;
|
String pathFileName = baseDir + fileName;
|
||||||
|
if (StringUtils.contains(baseDir, ":"))
|
||||||
|
{
|
||||||
|
// windows 去除盘符
|
||||||
|
pathFileName = StringUtils.substringAfterLast(baseDir, ":") + fileName;
|
||||||
|
}
|
||||||
return pathFileName;
|
return pathFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue