Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fhrons-mobile

Package Overview
Dependencies
Maintainers
0
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fhrons-mobile - npm Package Compare versions

Comparing version 1.1.2-5.0 to 1.1.2-5.2

2

assets/vantLang/index.js

@@ -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,

2

fhcommon/package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc