61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
|
/*
|
||
|
* @Author: ckycjwds 1240973496@qq.com
|
||
|
* @Date: 2023-02-16 10:54:13
|
||
|
* @LastEditors: ckycjwds 1240973496@qq.com
|
||
|
* @LastEditTime: 2023-02-16 11:30:12
|
||
|
* @FilePath: \aiguo_erp_vue\src\utils\oss.js
|
||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||
|
*/
|
||
|
import { get_oss_sign_aliyun } from '@/api/user';
|
||
|
const base={
|
||
|
// oss上传地址
|
||
|
ossDv: "http://XXXXXXXX",
|
||
|
ossPr: "http://xXXXXXXX"
|
||
|
}
|
||
|
const isDev = process.env.NODE_ENV === 'development'
|
||
|
|
||
|
const OSSConfig = {
|
||
|
uploadHost: isDev ? base.ossDv : base.ossPr, //OSS上传地址
|
||
|
type: "scs",
|
||
|
ossParams: {
|
||
|
region: "oss-cn-beijing",
|
||
|
success_action_status: "200", // 默认200
|
||
|
bucket: "ddzb-wx"
|
||
|
},
|
||
|
// 获取临时stsToken
|
||
|
_initData() {
|
||
|
get_oss_sign_aliyun().then(res=>{
|
||
|
const { accessKeyId, accessKeySecret, securityToken } = res.datas;
|
||
|
|
||
|
this.ossParams.accessKeyId = res.datas.accessid;
|
||
|
this.ossParams.accessKeySecret = res.datas.secret;
|
||
|
this.ossParams.securityToken = securityToken;
|
||
|
})
|
||
|
.catch(err => {
|
||
|
console.log(err)
|
||
|
});
|
||
|
// http
|
||
|
// .get(api.getOssToken)
|
||
|
// .then(res => {
|
||
|
|
||
|
// const { accessKeyId, accessKeySecret, securityToken } = res;
|
||
|
|
||
|
// this.ossParams.accessKeyId = accessKeyId;
|
||
|
// this.ossParams.accessKeySecret = accessKeySecret;
|
||
|
// this.ossParams.securityToken = securityToken;
|
||
|
// })
|
||
|
// .catch(err => {
|
||
|
// console.log(err)
|
||
|
// });
|
||
|
}
|
||
|
};
|
||
|
|
||
|
OSSConfig._initData();
|
||
|
|
||
|
export { OSSConfig };
|
||
|
|
||
|
// oss地址
|
||
|
// export const ossUrl = 'http://aiguovip2020.oss-cn-shenzhen.aliyuncs.com'
|
||
|
export const ossUrl = 'http://erp-temporary-file.oss-cn-hangzhou.aliyuncs.com/'
|
||
|
|