fhrons-mobile
Advanced tools
Comparing version 1.1.2-5.0 to 1.1.2-5.2
@@ -0,1 +1,2 @@ | ||
import VueI18n from 'vue-i18n' | ||
import { loadJavaScript } from '../js/func' | ||
@@ -58,2 +59,3 @@ import vantEnLocale from './lib/en-US'; | ||
const locale = window.localStorage.getItem(commonKeyName + 'language') ? (JSON.parse(window.localStorage.getItem(commonKeyName + 'language')).content || 'zh_CN') : 'zh_CN'; | ||
const i18n = new VueI18n({ | ||
@@ -60,0 +62,0 @@ silentTranslationWarn: true, |
{ | ||
"name": "fhcommon", | ||
"version": "1.1.8", | ||
"version": "1.2.0", | ||
"description": "泛华前端的上传方法", | ||
@@ -5,0 +5,0 @@ "main": "dist/fhcommon.min.js", |
@@ -8,7 +8,7 @@ | ||
} | ||
if (!window.AWS) { | ||
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js', () => { | ||
console.log('aws-sdk 加载成功'); | ||
}); | ||
} | ||
// if (!window.AWS) { | ||
// loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/aws-sdk-2.1562.0.min.js', () => { | ||
// console.log('aws-sdk 加载成功'); | ||
// }); | ||
// } | ||
if (!window.COS) { | ||
@@ -24,2 +24,8 @@ loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/cos-js-sdk-v5.min.js', () => { | ||
} | ||
if (!window.FHENCYPT) { | ||
loadJavaScript('https://dop-pro-1251973116.file.myqcloud.com/upload/jsfile/funzg/fhEncypt.js', () => { | ||
console.log('FHENCYPT加载成功'); | ||
}); | ||
} | ||
// const Minio = require('./utils/minio/internal/client.js') | ||
@@ -73,2 +79,3 @@ import * as Minio from 'minio' | ||
return axios.get(`/funapi/config/oss/sign/${target}/${project}`).then(res => { | ||
if (target !== '2' && (typeof res.data === 'string' || typeof res === 'string')) res = JSON.parse(FHENCYPT.decrypt(res.data || res)) | ||
const { tmpSecretId, tmpSecretKey, token, sessionToken, startTime, expiredTime, requestId, type, bucketName, region, cdnUrl } = res.data || res; | ||
@@ -85,41 +92,42 @@ /** | ||
*/ | ||
if (type === '1') { // 亚马逊 | ||
AWS.config.update({ | ||
accessKeyId: tmpSecretId, | ||
secretAccessKey: tmpSecretKey, | ||
region: region, | ||
sessionToken: token | ||
}); | ||
const s3 = new AWS.S3(); | ||
const params = { | ||
Bucket: bucketName, | ||
Key: newKey, | ||
ContentType: type, | ||
Body: file, | ||
'Access-Control-Allow-Credentials': '*' | ||
}; | ||
const upload = s3.upload(params); | ||
upload.on('httpUploadProgress', (progress) => { | ||
const { loaded, total } = progress; | ||
/* 非必须 */ | ||
const percent = Math.round(parseInt(loaded / total) * 100); | ||
if (typeof onProgress === 'function') onProgress(percent); | ||
}); | ||
const uploadPromise = upload.promise(); | ||
return uploadPromise.then(res => { | ||
const { key, Key } = res; | ||
console.log(res); | ||
// const tempUrl = (key.startsWith('/') ? '' : '/'); | ||
const fileUrl = `${cdnUrl}${cdnUrl.endsWith('/') ? '' : '/'}${key || Key}` | ||
if (needWholeRes) { | ||
return { | ||
...res, | ||
fileUrl | ||
}; | ||
} return fileUrl; | ||
}).catch(err => { | ||
console.log(err); | ||
}).finally(_ => { | ||
}); | ||
} else if (type === '2') { // 如果type=2 则使用minIO上传 | ||
// if (type === '1') { // 亚马逊 | ||
// AWS.config.update({ | ||
// accessKeyId: tmpSecretId, | ||
// secretAccessKey: tmpSecretKey, | ||
// region: region, | ||
// sessionToken: token | ||
// }); | ||
// const s3 = new AWS.S3(); | ||
// const params = { | ||
// Bucket: bucketName, | ||
// Key: newKey, | ||
// ContentType: type, | ||
// Body: file, | ||
// 'Access-Control-Allow-Credentials': '*' | ||
// }; | ||
// const upload = s3.upload(params); | ||
// upload.on('httpUploadProgress', (progress) => { | ||
// const { loaded, total } = progress; | ||
// /* 非必须 */ | ||
// const percent = Math.round(parseInt(loaded / total) * 100); | ||
// if (typeof onProgress === 'function') onProgress(percent); | ||
// }); | ||
// const uploadPromise = upload.promise(); | ||
// return uploadPromise.then(res => { | ||
// const { key, Key } = res; | ||
// console.log(res); | ||
// // const tempUrl = (key.startsWith('/') ? '' : '/'); | ||
// const fileUrl = `${cdnUrl}${cdnUrl.endsWith('/') ? '' : '/'}${key || Key}` | ||
// if (needWholeRes) { | ||
// return { | ||
// ...res, | ||
// fileUrl | ||
// }; | ||
// } return fileUrl; | ||
// }).catch(err => { | ||
// console.log(err); | ||
// }).finally(_ => { | ||
// }); | ||
// } else | ||
if (type === '2') { // 如果type=2 则使用minIO上传 | ||
console.log(Minio) | ||
@@ -126,0 +134,0 @@ const minioClient = new Minio.Client({ |
{ | ||
"name": "fhrons-mobile", | ||
"version": "1.1.25.0", | ||
"version": "1.1.25.2", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"serve": "vue-cli-service serve --mode dev", | ||
"serve.poc":"vue-cli-service serve --mode poc", | ||
"serve.poc": "vue-cli-service serve --mode poc", | ||
"serve.doc": "vuepress dev docs --temp .temp", | ||
@@ -19,6 +19,8 @@ "build": "vue-cli-service build --mode dev", | ||
"dependencies": { | ||
"@antv/f6": "0.0.19", | ||
"dayjs": "^1.10.4", | ||
"less": "^3.0.4", | ||
"less-loader": "^5.0.0", | ||
"moment": "^2.30.1" | ||
"moment": "^2.30.1", | ||
"vue-i18n": "8.28.2" | ||
}, | ||
@@ -55,2 +57,2 @@ "devDependencies": { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1948484
6441
6
+ Added@antv/f6@0.0.19
+ Addedvue-i18n@8.28.2
+ Added@ant-design/colors@5.1.1(transitive)
+ Added@antv/algorithm@0.1.26(transitive)
+ Added@antv/dom-util@2.0.4(transitive)
+ Added@antv/event-emitter@0.1.3(transitive)
+ Added@antv/f6@0.0.19(transitive)
+ Added@antv/f6-core@0.0.2(transitive)
+ Added@antv/f6-element@0.0.1(transitive)
+ Added@antv/f6-hammerjs@0.0.1(transitive)
+ Added@antv/g-base@0.5.16(transitive)
+ Added@antv/g-math@0.1.9(transitive)
+ Added@antv/g-mobile@0.0.13(transitive)
+ Added@antv/g-webgpu@0.5.5(transitive)
+ Added@antv/g-webgpu-core@0.5.6(transitive)
+ Added@antv/g-webgpu-engine@0.5.6(transitive)
+ Added@antv/hierarchy@0.6.14(transitive)
+ Added@antv/layout@0.1.14(transitive)
+ Added@antv/matrix-util@3.0.43.1.0-beta.3(transitive)
+ Added@antv/path-util@2.0.15(transitive)
+ Added@antv/scale@0.3.18(transitive)
+ Added@antv/util@2.0.17(transitive)
+ Added@babel/runtime@7.26.0(transitive)
+ Added@ctrl/tinycolor@3.6.1(transitive)
+ Added@probe.gl/env@3.6.0(transitive)
+ Added@probe.gl/log@3.6.0(transitive)
+ Added@probe.gl/stats@3.6.0(transitive)
+ Added@types/d3-timer@2.0.3(transitive)
+ Added@webgpu/glslang@0.0.15(transitive)
+ Added@webgpu/types@0.0.31(transitive)
+ Addedansi-styles@5.2.0(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedd3-color@3.1.0(transitive)
+ Addedd3-dispatch@2.0.0(transitive)
+ Addedd3-ease@1.0.7(transitive)
+ Addedd3-force@2.1.1(transitive)
+ Addedd3-interpolate@3.0.1(transitive)
+ Addedd3-quadtree@2.0.0(transitive)
+ Addedd3-timer@1.0.10(transitive)
+ Addeddagre@0.8.5(transitive)
+ Addeddetect-browser@5.3.0(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedfecha@4.2.3(transitive)
+ Addedgl-matrix@3.4.3(transitive)
+ Addedgl-vec2@1.3.0(transitive)
+ Addedgraphlib@2.1.8(transitive)
+ Addedhammerjs@2.0.8(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedinversify@5.1.1(transitive)
+ Addedinversify-inject-decorators@3.1.0(transitive)
+ Addedis-any-array@2.0.1(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedml-array-max@1.2.4(transitive)
+ Addedml-array-min@1.2.3(transitive)
+ Addedml-array-rescale@1.3.7(transitive)
+ Addedml-matrix@6.12.0(transitive)
+ Addedpolyline-miter-util@1.0.1(transitive)
+ Addedpolyline-normals@2.0.2(transitive)
+ Addedprobe.gl@3.6.0(transitive)
+ Addedreflect-metadata@0.1.14(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedregl@1.7.0(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedsupports-color@8.1.1(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedvue-i18n@8.28.2(transitive)