登录页面上传

product
bawei 2 years ago
parent 21d2a029e1
commit 2c2d740dc3

@ -0,0 +1,552 @@
package jnpf.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.NoDataSourceBind;
import jnpf.base.UserInfo;
import jnpf.base.entity.DictionaryDataEntity;
import jnpf.base.service.DictionaryDataService;
import jnpf.base.util.OptimizeUtil;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.ListVO;
import jnpf.config.ConfigValueUtil;
import jnpf.constant.MsgCode;
import jnpf.exception.DataException;
import jnpf.model.*;
import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.StorageType;
import jnpf.util.file.UploadUtil;
import jnpf.util.minio.MinioUploadUtil;
import jnpf.utils.YozoUtils;
import lombok.Cleanup;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author: WangChuang
* @Date: 1/3/2023 3:03
* @Description //注释:
* @Version 1.0
*/
@Api(tags = "公共", value = "file")
@RestController
@RequestMapping("/dev/api/file")
class DevUtilsController {
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired
private RedisUtil redisUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private DictionaryDataService dictionaryDataService;
@Autowired
private YozoUtils yozoUtils;
@Autowired
private MinioUploadUtil minioUploadUtil;
/**
*
*
* @return
*/
@ApiOperation("语言列表")
@GetMapping("/Language")
public ActionResult<ListVO<LanguageVO>> getList() {
String dictionaryTypeId = "dc6b2542d94b407cac61ec1d59592901";
List<DictionaryDataEntity> list = dictionaryDataService.getList(dictionaryTypeId);
List<LanguageVO> language = JsonUtil.getJsonToList(list, LanguageVO.class);
ListVO vo = new ListVO();
vo.setList(language);
return ActionResult.success(vo);
}
/**
*
*
* @return
*/
@NoDataSourceBind()
@ApiOperation("图形验证码")
@GetMapping("/ImageCode/{timestamp}")
public void imageCode(@PathVariable("timestamp") String timestamp) {
DownUtil.downCode(null);
redisUtil.insert(timestamp, ServletUtil.getSession().getAttribute(CodeUtil.RANDOMCODEKEY), 120);
}
/**
* /
*
* @return
*/
@NoDataSourceBind()
@ApiOperation("上传文件/图片")
@PostMapping(value = "/Uploader/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ActionResult uploader(@RequestPart("file") MultipartFile file, @PathVariable("type") String type) throws IOException {
String fileType = UpUtil.getFileType(file);
//验证类型
if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) {
return ActionResult.fail(MsgCode.FA017.get());
}
UploaderVO vo = uploaderVO(file, type);
return ActionResult.success(vo);
}
/**
*
*
* @return
*/
@NoDataSourceBind()
@ApiOperation("获取下载文件链接")
@GetMapping("/Download/{type}/{fileName}")
public ActionResult<DownloadVO> downloadUrl(@PathVariable("type") String type, @PathVariable("fileName") String fileName) {
type = XSSEscape.escape(type);
fileName = XSSEscape.escape(fileName);
UserInfo userInfo = userProvider.get();
if (!configValueUtil.getFileType().equals(StorageType.STORAGE)) {
DownloadVO vo = DownloadVO.builder().name(fileName).url(UploaderUtil.uploaderFile(userInfo.getId() + "#" + fileName + "#" + type)).build();
return ActionResult.success(vo);
}
String filePath = FilePathUtil.getFilePath(type) + fileName;
if (FileUtil.fileIsFile(filePath)) {
DownloadVO vo = DownloadVO.builder().name(fileName).url(UploaderUtil.uploaderFile(userInfo.getId() + "#" + fileName + "#" + type)).build();
return ActionResult.success(vo);
}
return ActionResult.fail(MsgCode.FA018.get());
}
/**
*
*
* @return
*/
@NoDataSourceBind()
@ApiOperation("下载文件链接")
@GetMapping("/Download")
public void downloadFile() throws DataException {
HttpServletRequest request = ServletUtil.getRequest();
String reqJson = request.getParameter("encryption");
String name = request.getParameter("name");
String fileNameAll = DesUtil.aesDecode(reqJson);
if (!StringUtil.isEmpty(fileNameAll)) {
String[] data = fileNameAll.split("#");
String token = data.length > 0 ? data[0] : "";
//验证token
if (redisUtil.exists(token)) {
String fileName = data.length > 1 ? data[1] : "";
String type = data.length > 2 ? data[2] : "";
String filePath = FilePathUtil.getFilePath(type.toLowerCase());
//下载文件
UploadUtil.downFile(configValueUtil.getFileType(), fileName, type, filePath, name);
} else {
throw new DataException("token验证失败");
}
}
}
/**
*
*
* @return
*/
@NoDataSourceBind()
@ApiOperation("下载模板文件链接")
@GetMapping("/DownloadModel")
public void downloadModel() throws DataException {
HttpServletRequest request = ServletUtil.getRequest();
String reqJson = request.getParameter("encryption");
String fileNameAll = DesUtil.aesDecode(reqJson);
if (!StringUtil.isEmpty(fileNameAll)) {
String token = fileNameAll.split("#")[0];
if (redisUtil.exists(token)) {
String fileName = fileNameAll.split("#")[1];
String filePath = configValueUtil.getTemplateFilePath();
//下载文件
UploadUtil.downFile(configValueUtil.getFileType(), fileName, FileTypeEnum.TEMPLATEFILE, filePath, null);
}
}
}
/**
*
*
* @param fileName
* @param type
* @return
*/
@NoDataSourceBind()
@ApiOperation("获取图片")
@GetMapping("/Image/{type}/{fileName}")
public void downLoadImg(@PathVariable("type") String type, @PathVariable("fileName") String fileName) {
String filePath = FilePathUtil.getFilePath(type.toLowerCase());
if (FileTypeEnum.IM.equalsIgnoreCase(type)) {
type = "imfile";
} else if (FileTypeEnum.ANNEX.equalsIgnoreCase(type)) {
type = FileTypeEnum.ANNEXPIC;
}
//下载文件
UploadUtil.writeImage(configValueUtil.getFileType(), fileName, type.toLowerCase(), filePath);
}
/**
* IM
* .@
*
* @param fileName
* @return
*/
@NoDataSourceBind()
@ApiOperation("获取IM聊天图片")
@GetMapping("/IMImage/{fileName}")
public void imImage(@PathVariable("fileName") String fileName) {
//下载文件
UploadUtil.downFile(configValueUtil.getFileType(), fileName, "imfile", FilePathUtil.getFilePath(FileTypeEnum.IM) + fileName, null);
}
/**
*
*
* @param type
* @param fileName
* @return
*/
@NoDataSourceBind()
@ApiOperation("查看图片")
@GetMapping("/{type}/{fileName}")
public void img(@PathVariable("type") String type, @PathVariable("fileName") String fileName) {
String filePath = configValueUtil.getBiVisualPath() + type + File.separator;
if (StorageType.MINIO.equals(configValueUtil.getFileType())) {
fileName = "/" + type + "/" + fileName;
filePath = configValueUtil.getBiVisualPath().substring(0, configValueUtil.getBiVisualPath().length() - 1);
}
//下载文件
UploadUtil.downFile(configValueUtil.getFileType(), fileName, FileTypeEnum.BIVISUALPATH, filePath, null);
}
/**
* IM
* .@
*
* @param fileName
* @return
*/
@NoDataSourceBind()
@ApiOperation("获取IM聊天语音")
@GetMapping("/IMVoice/{fileName}")
public void imVoice(@PathVariable("fileName") String fileName) {
String paths = FilePathUtil.getFilePath(FileTypeEnum.IM) + fileName.replaceAll("@", ".");
UploadUtil.downFile(configValueUtil.getFileType(), fileName, "imfile", paths, null);
}
/**
* app
*
* @param appName
* @return
*/
@NoDataSourceBind()
@ApiOperation("app启动获取信息")
@GetMapping("/AppStartInfo/{appName}")
public ActionResult getAppStartInfo(@PathVariable("appName") String appName) {
appName = XSSEscape.escape(appName);
JSONObject object = new JSONObject();
object.put("AppVersion", configValueUtil.getAppVersion());
object.put("AppUpdateContent", configValueUtil.getAppUpdateContent());
return ActionResult.success(object);
}
//----------大屏图片下载---------
@NoDataSourceBind()
@ApiOperation("获取图片")
@GetMapping("/VisusalImg/{type}/{fileName}")
public void downVisusalImg(@PathVariable("type") String type, @PathVariable("fileName") String fileName) {
type = XSSEscape.escape(type);
fileName = XSSEscape.escape(fileName);
String filePath = FilePathUtil.getFilePath(FileTypeEnum.BIVISUALPATH) + type + File.separator;
if (StorageType.MINIO.equals(configValueUtil.getFileType())) {
fileName = "/" + type + "/" + fileName;
}
UploadUtil.downFile(configValueUtil.getFileType(), fileName, FileTypeEnum.BIVISUALPATH, filePath, null);
}
//----------------------
// @NoDataSourceBind()
// @ApiOperation("预览文件")
// @GetMapping("/Uploader/Preview")
// public ActionResult Preview(PreviewParams previewParams) {
// //读取允许文件预览类型
// String allowPreviewType = configValueUtil.getAllowPreviewFileType();
// String[] fileType = allowPreviewType.split(",");
//
// String fileName = XSSEscape.escape(previewParams.getFileName());
//
// //文件预览类型检验
// String docType = fileName.substring(fileName.lastIndexOf(".") + 1);
// String s = Arrays.asList(fileType).stream().filter(type -> type.equals(docType)).findFirst().orElse(null);
//
// if (StringUtil.isEmpty(s)) {
// return ActionResult.fail("预览失败,请检查文件类型是否规范");
// }
//
// //解析文件url 获取类型
// String type = FileTypeEnum.ANNEX;
//
// String fileNameAll = previewParams.getFileDownloadUrl();
// if (!StringUtil.isEmpty(fileNameAll)) {
// String[] data = fileNameAll.split("/");
// type = data.length > 4 ? data[4] : "";
// }
//
// String url;
// //文件预览策略
// if ("yozo".equals(configValueUtil.getPreviewType())) {
// if (StringUtil.isEmpty(previewParams.getFileVersionId())) {
// return ActionResult.fail("预览失败,请重新上传文件");
// }
//
// String fileVersionId = XSSEscape.escape(previewParams.getFileVersionId());
//
// //获取签名
// Map<String, String[]> parameter = new HashMap<String, String[]>();
// parameter.put("appId", new String[]{YozoParams.APP_ID});
// parameter.put("fileVersionId", new String[]{fileVersionId});
// String sign = yozoUtils.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, parameter).getData();
// url = "http://eic.yozocloud.cn/api/view/file?fileVersionId="
// + fileVersionId
// + "&appId="
// + YozoParams.APP_ID
// + "&sign="
// + sign;
// } else {
// if ("local".equals(configValueUtil.getFileType())) {
// url = YozoParams.JNPF_DOMAINS + "/api/file/filedownload/" + type + "/" + previewParams.getFileName();
// } else {
// url = minioUploadUtil.getFile(fileName, type);
// }
// //encode编码
// String fileUrl = Base64.encodeBase64String(url.getBytes());
// url = configValueUtil.getKkFileUrl() + "onlinePreview?url=" + fileUrl;
// }
// return ActionResult.success(MsgCode.SU000.get(), url);
// }
@NoDataSourceBind()
@ApiOperation("kk本地文件预览")
@GetMapping("/filedownload/{type}/{fileName}")
public void filedownload(@PathVariable("type") String type, @PathVariable("fileName") String fileName, HttpServletResponse response) {
String filePath = FilePathUtil.getFilePath(type) + fileName;
OutputStream os = null;
if ("local".equals(configValueUtil.getFileType())) {
//本地取对应文件
File file = new File(filePath);
try {
os = response.getOutputStream();
String contentType = Files.probeContentType(Paths.get(file.getAbsolutePath()));
response.setHeader("Content-Type", contentType);
response.setHeader("Content-Dispostion", "attachment;filename=" + new String(file.getName().getBytes("utf-8"), "ISO8859-1"));
FileInputStream fileInputStream = new FileInputStream(file);
WritableByteChannel writableByteChannel = Channels.newChannel(os);
FileChannel channel = fileInputStream.getChannel();
channel.transferTo(0, channel.size(), writableByteChannel);
channel.close();
os.flush();
writableByteChannel.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (os != null) {
os.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@NoDataSourceBind()
@ApiOperation("分片上传获取")
@GetMapping("/chunk")
public ActionResult checkChunk(Chunk chunk) {
String type = chunk.getExtension();
if(!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(),type)){
return ActionResult.fail(MsgCode.FA017.get());
}
String identifier = chunk.getIdentifier();
String path = FilePathUtil.getFilePath(FileTypeEnum.TEMPORARY);
String filePath = XSSEscape.escapePath(path + identifier);
List<File> chunkFiles = FileUtil.getFile(new File(filePath));
List<Integer> existsChunk = chunkFiles.stream().filter(f->{
if(f.getName().endsWith(".tmp")){
FileUtils.deleteQuietly(f);
return false;
}else{
return true;
}
}).map(f->Integer.parseInt(f.getName().replace(chunk.getIdentifier().concat("-"), ""))).collect(Collectors.toList());
ChunkRes chunkRes = ChunkRes.builder().merge(false).chunkNumbers(existsChunk).build();
return ActionResult.success(chunkRes);
}
@NoDataSourceBind()
@ApiOperation("分片上传附件")
@PostMapping("/chunk")
public ActionResult upload(Chunk chunk, @RequestParam("file") MultipartFile file) {
String type = chunk.getExtension();
if(!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(),type)){
return ActionResult.fail(MsgCode.FA017.get());
}
ChunkRes chunkRes = ChunkRes.builder().build();
chunkRes.setMerge(false);
File chunkFile = null;
File chunkTmpFile = null;
try {
String filePath = FilePathUtil.getFilePath(FileTypeEnum.TEMPORARY);
Integer chunkNumber = chunk.getChunkNumber();
String identifier = chunk.getIdentifier();
String chunkTempPath = filePath + identifier;
File path = new File(chunkTempPath);
if (!path.exists()) {
path.mkdirs();
}
String chunkName = identifier.concat("-") + chunkNumber;
String chunkTmpName = chunkName.concat(".tmp");
chunkFile = new File(chunkTempPath, chunkName);
chunkTmpFile = new File(chunkTempPath, chunkTmpName);
if (chunkFile.exists() && chunkFile.length() == chunk.getCurrentChunkSize()) {
System.out.println("该分块已经上传:" + chunkFile.getName());
} else {
@Cleanup InputStream inputStream = file.getInputStream();
FileUtils.copyInputStreamToFile(inputStream, chunkTmpFile);
chunkTmpFile.renameTo(chunkFile);
}
chunkRes.setMerge(chunk.getChunkNumber().equals(chunk.getTotalChunks()));
} catch (Exception e) {
try{
FileUtils.deleteQuietly(chunkTmpFile);
FileUtils.deleteQuietly(chunkFile);
}catch (Exception ee){
e.printStackTrace();
}
System.out.println("上传异常:" + e);
return ActionResult.fail("上传异常");
}
return ActionResult.success(chunkRes);
}
@NoDataSourceBind()
@ApiOperation("分片组装")
@PostMapping("/merge")
public ActionResult merge(MergeChunkDto mergeChunkDto) {
String identifier = mergeChunkDto.getIdentifier();
String path = FilePathUtil.getFilePath(FileTypeEnum.TEMPORARY);
String filePath = XSSEscape.escapePath(path + identifier);
String uuid = RandomUtil.uuId();
String partFile = XSSEscape.escapePath(path + uuid + "." + mergeChunkDto.getExtension());
UploaderVO vo = UploaderVO.builder().build();
try {
List<File> mergeFileList = FileUtil.getFile(new File(filePath));
@Cleanup FileOutputStream destTempfos = new FileOutputStream(partFile, true);
for (int i = 0; i < mergeFileList.size(); i++) {
String chunkName = identifier.concat("-") + (i + 1);
File files = new File(filePath, chunkName);
if (files.exists()) {
FileUtils.copyFile(files, destTempfos);
}
}
File partFiles = new File(partFile);
if (partFiles.exists()) {
MultipartFile multipartFile = FileUtil.createFileItem(partFiles);
String type = mergeChunkDto.getType();
vo = uploaderVO(multipartFile, type);
FileUtil.deleteTmp(multipartFile);
}
} catch (Exception e) {
System.out.println("合并分片失败:" + e);
}finally {
FileUtils.deleteQuietly(new File(filePath));
FileUtils.deleteQuietly(new File(partFile));
}
return ActionResult.success(vo);
}
/**
*
*
* @param file
* @param type
* @return
* @throws IOException
*/
private UploaderVO uploaderVO(MultipartFile file, String type) throws IOException {
String orgFileName = file.getOriginalFilename();
String fileType = UpUtil.getFileType(file);
// if (OptimizeUtil.fileSize(file.getSize(), 1024000)) {
// return ActionResult.fail("上传失败文件大小超过1M");
// }
String fileName = DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + "." + fileType;
if (type.equals(FileTypeEnum.MAIL)) {
type = FileTypeEnum.TEMPORARY;
}
String filePath = FilePathUtil.getFilePath(type.toLowerCase());
UploaderVO vo = UploaderVO.builder().name(fileName).build();
//上传文件
UploadUtil.uploadFile(configValueUtil.getFileType(), type, fileName, file, filePath);
if (type.equalsIgnoreCase(FileTypeEnum.USERAVATAR)) {
vo.setUrl(UploaderUtil.uploaderImg(fileName));
} else if (type.equalsIgnoreCase(FileTypeEnum.ANNEX)) {
// UserInfo userInfo = userProvider.get();
// vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + fileName + "#" + type));
vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annex/", fileName));
} else if (type.equalsIgnoreCase(FileTypeEnum.ANNEXPIC)) {
vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annex/", fileName));
}else {
vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/"+type.toLowerCase()+"/", fileName));
}
//上传到永中
if ("yozo".equals(configValueUtil.getAllowPreviewFileType())) {
try {
@Cleanup InputStream inputStream = file.getInputStream();
String s = yozoUtils.uploadFileInPreview(inputStream, orgFileName);
Map<String, Object> map = JsonUtil.stringToMap(s);
if ("操作成功".equals(map.get("message"))) {
Map<String, Object> dataMap = JsonUtil.stringToMap(String.valueOf(map.get("data")));
String verId = String.valueOf(dataMap.get("fileVersionId"));
vo.setFileVersionId(verId);
}
} catch (Exception e) {
System.out.println("上传到永中失败");
e.printStackTrace();
}
}
return vo;
}
}

@ -113,10 +113,9 @@ public class CollectionEntity {
@TableField("CUSTOMER_ID")
private String customerId;
<<<<<<< HEAD
@TableField("CONTRACT_ID")
private String contractId;
=======
>>>>>>> 6b66ea0276198dd5eb24cd6f115f6e164cbd7df3
}

@ -77,7 +77,7 @@ public class CollectionCrForm {
/** 子表数据 **/
@JsonProperty("collection_item0List")
private List<Collection_item0Model> collection_item0List;
/** 客户id **/
@JsonProperty("customerId")
private String customerId;
// /** 客户id **/
// @JsonProperty("customerId")
// private String customerId;
}

@ -79,7 +79,7 @@ public class CollectionInfoVO{
/** 子表数据 **/
@JsonProperty("collection_item0List")
private List<Collection_item0Model> collection_item0List;
/** 客户id **/
@JsonProperty("customerId")
private String customerId;
// /** 客户id **/
// @JsonProperty("customerId")
// private String customerId;
}

@ -86,8 +86,8 @@ public class CollectionListVO{
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 客户id **/
@JsonProperty("customerId")
private String customerId;
// /** 客户id **/
// @JsonProperty("customerId")
// private String customerId;
}

@ -90,8 +90,8 @@ public class CollectionUpForm{
/** 子表数据 **/
@JsonProperty("collection_item0List")
private List<Collection_item0Model> collection_item0List;
/** 客户id **/
@JsonProperty("customerId")
private String customerId;
// /** 客户id **/
// @JsonProperty("customerId")
// private String customerId;
}

@ -99,10 +99,9 @@ public class ReceiptoutEntity {
@TableField("SALES_ID")
private String salesId;
<<<<<<< HEAD
@TableField("CUSTOMER_ID")
private String customerId;
=======
>>>>>>> 6b66ea0276198dd5eb24cd6f115f6e164cbd7df3
}

@ -116,13 +116,12 @@ public class Receiptout_item0Entity {
@TableField("VEHICLE_ID")
private String vehicleId;
<<<<<<< HEAD
@TableField("POUND_TYPE")
private String poundType;
@TableField("MATERIAL_ID")
private String materialId;
=======
>>>>>>> 6b66ea0276198dd5eb24cd6f115f6e164cbd7df3
}

@ -81,7 +81,7 @@ public class ReceiptoutCrForm {
@JsonProperty("receiptout_item0List")
private List<Receiptout_item0Model> receiptout_item0List;
/** 销售id **/
@TableField("salesId")
private String salesId;
// /** 销售id **/
// @TableField("salesId")
// private String salesId;/
}

@ -87,7 +87,7 @@ public class ReceiptoutInfoVO{
@JsonProperty("receiptout_item0List")
private List<Receiptout_item0Model> receiptout_item0List;
/** 来源单号销售id **/
@TableField("salesId")
private String salesId;
// /** 来源单号销售id **/
// @TableField("salesId")
// private String salesId;
}

@ -98,9 +98,9 @@ public class ReceiptoutListVO{
private String lastModifyUserName;
/** 来源单号销售id **/
@TableField("salesId")
private String salesId;
// /** 来源单号销售id **/
// @TableField("salesId")
// private String salesId;
}

@ -98,8 +98,8 @@ public class ReceiptoutUpForm{
@JsonProperty("receiptout_item0List")
private List<Receiptout_item0Model> receiptout_item0List;
/** 来源单号销售id **/
@TableField("salesId")
private String salesId;
// /** 来源单号销售id **/
// @TableField("salesId")
// private String salesId;
}

@ -66,8 +66,8 @@ public class Receiptout_item0Model {
@JsonProperty("poundType")
private String poundType;
/** 磅单类型 **/
@JsonProperty("vehicleId")
private String vehicleId;
// /** 磅单类型 **/
// @JsonProperty("vehicleId")
// private String vehicleId;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -10,17 +10,22 @@
</el-image>
<img src="@/assets/images/jnpf.png" class="sidebar-logo" v-else />
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<el-image class="sidebar-logo" :src="define.comUrl+sysConfig.navigationIcon"
v-if="sysConfig && sysConfig.navigationIcon">
<template slot="error">
<img class="sidebar-logo" src="@/assets/images/jnpf1.png" alt="">
<img class="sidebar-logo" src="@/assets/images/登录进去页面的.png" alt="">
</template>
</el-image>
<img src="@/assets/images/jnpf1.png" class="sidebar-logo" v-else />
<img src="@/assets/images/登录进去页面的.png" class="sidebar-logo" v-else />
</router-link>
</transition>
</div>
</template>
<script>
@ -63,8 +68,9 @@ export default {
width: 100%;
.sidebar-logo {
height: 100%;
width: 100%;
height: 50%;
width: 80%;
margin-top: 15px;
}
}
}

@ -7,6 +7,17 @@
justify-content: center;
align-items: center;
.login-logo-img{
flex: 1;
height: 100%;
background: #4393FA;
position: relative;
display: flex;
align-items: center;
justify-content: center;
z-index: -1;
}
.login-version {
position: fixed;
right: 0px;
@ -16,30 +27,32 @@
background: url('../../assets/images/login_version.png') no-repeat center;
background-size: 100%;
.login-version-text {
width: 82px;
height: 82px;
line-height: 50px;
text-align: center;
color: #fff;
font-size: 16px;
transform: rotate(45deg);
}
//.login-version-text {
// width: 82px;
// height: 82px;
// line-height: 50px;
// text-align: center;
// color: #fff;
// font-size: 16px;
// transform: rotate(45deg);
//}
}
.login-left {
flex: 1;
height: 100%;
background: #4393FA;
//background: #4393FA;
position: relative;
display: flex;
align-items: center;
justify-content: center;
background: url('../../assets/images/image_bj.jpg') no-repeat center;
background-size: 100%;
.login-company-logo {
position: absolute;
left: 0;
top: 93px;
top: 32px;
display: block;
height: 76px;
padding-top: 18px;
@ -50,17 +63,21 @@
background: linear-gradient(270deg, rgba(67, 147, 250, 0.5) 0%, rgba(133, 182, 252, 0.5) 100%);
.login-company-logo-img {
height: 40px;
height: 60px;
position: fixed;
left: 40px;
top: 111px;
left: 220px;
top: 40px;
}
}
.login-banner {
display: block;
width: 682px;
height: 464px;
width: 505px;
height: 384px;
position:relative;
z-index: 99999;
margin-right: 530px;
}
.login-left-txt {
@ -86,7 +103,6 @@
color: #BCD7FA;
margin: 12px 0 30px;
}
.link {
margin: 30px auto 0;
display: block;
@ -103,28 +119,48 @@
}
.login-content {
width: 700px;
height: 100%;
flex-shrink: 0;
display: flex;
justify-content: center;
align-items: center;
position: relative;
.login-cap {
font-size: 26px;
line-height: 38px;
margin-bottom: 26px;
color: #666666;
}
text-align: center;
background-color: #fff;
border-radius: 20px;
width: 1050px;
height: 500px;
margin: auto;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
//width: 1000px;
//height: 200px;
//flex-shrink: 0;
//display: flex;
//justify-content: center;
//align-items: center;
//position: relative;
//
//.login-cap {
// font-size: 26px;
// line-height: 38px;
// margin-bottom: 26px;
// color: #666666;
//}
}
.title3 {
text-align: center;
font-size: 25px;
font-weight: 400;
line-height: 20px;
color: #1d0b0b;
margin: 12px 0 30px;
}
.login-form {
height: 530px;
//height: 530px;
height: 500px;
width: 400px;
padding: 50px 0;
border-radius: 6px;
margin-left: 550px;
.sms-input {
width: 260px;
}
@ -152,6 +188,16 @@
height: 36px;
margin-bottom: 35px;
}
.login-logo001 {
width: 80%;
height: 66px;
margin-bottom: 2px;
}
.login-logo1 {
width: 100%;
height: 50px;
margin-bottom: 50px;
}
.login-tab {
height: 58px;
@ -240,6 +286,24 @@
cursor: pointer;
}
}
.loading-primary{
margin-top: 40px;
bottom: 0;
width: 100%;
line-height: var(--footer-height);
color: #fff;
}
.loading-size{
margin-top: 25px;
font-size: 13px;
color: #4f4b4b;
}
.loading-size1{
margin-top: 25px;
font-size: 8px;
color: #9f9999;
}
}
.login-form-QRCode {
@ -256,7 +320,7 @@
.qrcode-tip {
color: #334d65;
line-height: 22px;
font-size: 16px;
font-size: 18px;
text-align: center;
}
}

@ -1,20 +1,24 @@
<template>
<div class="login-container">
<div class="login-version" v-if="sysConfig && sysConfig.sysVersion">
<p class="login-version-text">{{sysConfig.sysVersion}}</p>
</div>
<div class="login-left">
<a class="login-company-logo" target="_blank" href="">
<img class="login-company-logo-img" src="@/assets/images/login-company-logo.png" alt="">
<img class="login-company-logo-img" src="@/assets/images/LOGO.png" alt="">
</a>
<img class="login-banner" src="@/assets/images/login-banner.png" alt="">
<img class="login-banner" src="@/assets/images/image-01.png" alt="">
<div class="login-left-txt" v-if="showTxt">
<p class="title1">在线自动化流程可视化 DevOps开发模式实现业务需求核心功能</p>
<p class="title2">企业宗旨<span>致力于</span>传统制造型企业完成数字化转型升级</p>
<!-- <p class="title1">在线自动化流程可视化 DevOps开发模式实现业务需求核心功能</p>-->
<!-- <p class="title2">企业宗旨<span>致力于</span><></></p>-->
<!-- <a class="link" target="_blank" href="">了解更多</a>-->
</div>
</div>
<div class="login-content">
<div class="login-content" >
<div class="login-form">
<el-image class="login-logo" :src="define.comUrl+sysConfig.loginIcon"
v-if="sysConfig && sysConfig.loginIcon">
@ -22,7 +26,8 @@
<img class="login-logo" src="@/assets/images/login_logo.png" alt="">
</template>
</el-image>
<img class="login-logo" src="@/assets/images/login_logo.png" alt="" v-else>
<!-- <p class="title3"> ERP管理系统用户登录 </p>-->
<img class="login-logo001" src="@/assets/images/标题.png" alt="" v-else>
<div class="login-tab" :class="'active'+active">
<a class="item" :class="{'active': active==1}" @click="active=1">{{$t('login.title')}}</a>
<a class="item" :class="{'active': active==2}"
@ -47,6 +52,7 @@
</el-tooltip>
<el-form-item prop="code" v-if="needCode">
<el-row type="flex" justify="space-between">
<el-col class="sms-input">
<el-input v-model="loginForm.code" :placeholder="$t('login.codeTip')" name="code"
autocomplete="on" prefix-icon="el-icon-key" size="large">
@ -60,8 +66,15 @@
</el-col>
</el-row>
</el-form-item>
<div class="loading-primary">
<el-button :loading="loading" type="primary" class="login-btn" size="large"
@click.native.prevent="handleLogin">{{ $t('login.logIn') }}</el-button>
@click.native.prevent="handleLogin" >{{ $t('login.logIn') }}</el-button>
</div>
<P class="loading-size">
<span class="loading-size1"></span>
版权归上海长江云息数字科技公司所有
<span class="loading-size1"></span>
</P>
</el-form>
<div v-show="active==2" class="login-form-QRCode">
<img class="qrcode-img" src="@/assets/images/login_qr.png">

Loading…
Cancel
Save