Commit be44fd95 authored by ml's avatar ml

资产管理后台-oss 修改

parent dd6b8c01
......@@ -298,8 +298,8 @@ async function updateImageUrl(dbRealNameInfo: any) {
let identityFrondSide = dbRealNameInfo.identity_frond_side;
if (identityFrondSide) {
if (!identityFrondSide.includes("http")) {
dbRealNameInfo.identity_frond_side_small = await ossUtils.resizeWithWaterMark(identityFrondSide, "Madex", 300);
dbRealNameInfo.identity_frond_side = await ossUtils.withWaterMark(identityFrondSide, "Madex");
dbRealNameInfo.identity_frond_side_small = await ossUtils.resizeWithWaterMark(identityFrondSide, "KTX", 300);
dbRealNameInfo.identity_frond_side = await ossUtils.withWaterMark(identityFrondSide, "KTX");
}
else {
dbRealNameInfo.identity_frond_side_small = identityFrondSide
......@@ -313,8 +313,8 @@ async function updateImageUrl(dbRealNameInfo: any) {
let identityOtherSide = dbRealNameInfo.identity_other_side;
if (identityOtherSide) {
if (!identityOtherSide.includes("http")) {
dbRealNameInfo.identity_other_side_small = await ossUtils.resizeWithWaterMark(identityOtherSide, "Madex", 300);
dbRealNameInfo.identity_other_side = await ossUtils.withWaterMark(identityOtherSide, "Madex");
dbRealNameInfo.identity_other_side_small = await ossUtils.resizeWithWaterMark(identityOtherSide, "KTX", 300);
dbRealNameInfo.identity_other_side = await ossUtils.withWaterMark(identityOtherSide, "KTX");
}
else {
dbRealNameInfo.identity_other_side_small = identityOtherSide
......@@ -329,8 +329,8 @@ async function updateImageUrl(dbRealNameInfo: any) {
let identityInHand = dbRealNameInfo.identity_in_hand;
if (identityInHand) {
if (!identityInHand.includes("http")) {
dbRealNameInfo.identity_in_hand_small = await ossUtils.resizeWithWaterMark(identityInHand, "Madex", 300);
dbRealNameInfo.identity_in_hand = await ossUtils.withWaterMark(identityInHand, "Madex");
dbRealNameInfo.identity_in_hand_small = await ossUtils.resizeWithWaterMark(identityInHand, "KTX", 300);
dbRealNameInfo.identity_in_hand = await ossUtils.withWaterMark(identityInHand, "KTX");
}
else {
dbRealNameInfo.identity_in_hand_small = identityInHand
......@@ -345,8 +345,8 @@ async function updateImageUrl(dbRealNameInfo: any) {
let latestPhoto = dbRealNameInfo.latest_photo;
if (latestPhoto) {
if (!latestPhoto.includes("http")) {
dbRealNameInfo.latest_photo_small = await ossUtils.resizeWithWaterMark(latestPhoto, "Madex", 300);
dbRealNameInfo.latest_photo = await ossUtils.withWaterMark(latestPhoto, "Madex");
dbRealNameInfo.latest_photo_small = await ossUtils.resizeWithWaterMark(latestPhoto, "KTX", 300);
dbRealNameInfo.latest_photo = await ossUtils.withWaterMark(latestPhoto, "KTX");
}
else {
dbRealNameInfo.latest_photo_small = latestPhoto
......
......@@ -56,7 +56,7 @@ export const withWaterMark = async function (url: string, text: string) {
if (imageWidth <= 0) {
imageWidth = 1000;
}
let fontSize = (imageWidth / 5);
let fontSize = Math.round((imageWidth / 5));
if (fontSize > 999) {
fontSize = 999;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment