mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 21:12:33 +08:00
fix: 上传字体文件的时候,读取字体名作为默认值。
This commit is contained in:
@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -181,9 +182,10 @@ public class FontManage {
|
||||
unit = "KB";
|
||||
size = Double.valueOf(String.format("%.2f", (double) length / 1024));
|
||||
}
|
||||
Font font = Font.createFont(Font.TRUETYPE_FONT, new File(filePath));
|
||||
fontDto.setSize(size);
|
||||
fontDto.setSizeType(unit);
|
||||
|
||||
fontDto.setName(font.getFontName());
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ const uploadExcel = () => {
|
||||
loading.value = true
|
||||
return uploadFontFile(formData)
|
||||
.then(res => {
|
||||
ruleForm.name = res.data.name
|
||||
ruleForm.size = res.data.size
|
||||
ruleForm.sizeType = res.data.sizeType
|
||||
ruleForm.fileTransName = res.data.fileTransName
|
||||
|
||||
Reference in New Issue
Block a user