修改 oss 地址

This commit is contained in:
GYJ 2024-12-05 13:37:32 +08:00
parent f4e3f25a45
commit 49b95137b6
5 changed files with 22295 additions and 49 deletions

22244
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -70,8 +70,8 @@ export default {
return;
}
this.url = fileRes.replace(
"https://djvideo.oss-cn-shanghai.aliyuncs.com/",
"https://duanju.hnsiyao.cn/"
"https://sy-duanju.oss-cn-nanjing.aliyuncs.com/",
"https://short-video.hnsiyao.cn/"
);
},
onFileSubmit(data) {
@ -89,4 +89,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -3,46 +3,48 @@ import axios from 'axios'
import router from '@/router'
import qs from 'qs'
import merge from 'lodash/merge'
import { clearLoginInfo } from '@/utils'
import {clearLoginInfo} from '@/utils'
export const entryName = '短剧13.2系统';
const $urlMap={
local:'http://192.168.1.15:8100/sqx_fast/',
product:'https://video.hnsiyao.cn/sqx_fast/',
test:'https://video.hnsiyao.cn/sqx_fast/',
}
const $env='product'
// const $urlMap={
// local:'http://192.168.1.15:8100/sqx_fast/',
// product:'https://video.hnsiyao.cn/sqx_fast/',
// test:'https://video.hnsiyao.cn/sqx_fast/',
// }
// const $env='product'
const http = axios.create({
timeout: 1000 * 300,
// withCredentials: true,
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
timeout: 1000 * 300,
// withCredentials: true,
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
})
/**
* 请求拦截
*/
http.interceptors.request.use(config => {
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
config.baseURL = $urlMap[$env]
const arr=config.url.split('sqx_fast/')
config.url= $urlMap[$env]+(arr.length>=2?arr[1]:arr[0])
return config
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
// config.baseURL = $urlMap[$env]
const arr = config.url.split('sqx_fast/')
config.url = "https://video.hnsiyao.cn/sqx_fast/" + (arr.length >= 2 ? arr[1] : arr[0])
// config.url = "https://video.hnsiyao.cn/sqx_fast/"
return config
}, error => {
return Promise.reject(error)
return Promise.reject(error)
})
/**
* 响应拦截
*/
http.interceptors.response.use(response => {
if (response.data && response.data.code === 401) { // 401, token失效
clearLoginInfo()
router.push({ name: 'login' })
}
return response
if (response.data && response.data.code === 401) { // 401, token失效
clearLoginInfo()
router.push({name: 'login'})
}
return response
}, error => {
return Promise.reject(error)
return Promise.reject(error)
})
/**
@ -50,8 +52,8 @@ http.interceptors.response.use(response => {
* @param {*} actionName action方法名称
*/
http.adornUrl = (actionName) => {
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
// return 'http://192.168.0.132:8100/sqx_fast/' + actionName
// return 'https://duanjuadmin.xianmxkj.com/sqx_fast/' + actionName
actionName = actionName.replace(/^\//, "");
@ -59,8 +61,8 @@ http.adornUrl = (actionName) => {
}
http.adornUrlUp = (actionName) => {
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
// return 'http://192.168.0.132:8183/sqx_fast/' + actionName
// return 'https://duanjuadmin.xianmxkj.com/sqx_fast/' + actionName
actionName = actionName.replace(/^\//, "");
@ -68,8 +70,8 @@ http.adornUrlUp = (actionName) => {
}
http.adornUrlWX = (actionName) => {
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
actionName = actionName.replace(/^\//, "");
return '/weixin/' + actionName
// return 'https://api.weixin.qq.com/' + actionName
@ -82,10 +84,10 @@ http.adornUrlWX = (actionName) => {
* @param {*} openDefultParams 是否开启默认参数?
*/
http.adornParams = (params = {}, openDefultParams = false) => {
var defaults = {
't': new Date().getTime()
}
return openDefultParams ? merge(defaults, params) : params
var defaults = {
't': new Date().getTime()
}
return openDefultParams ? merge(defaults, params) : params
}
/**
@ -97,11 +99,11 @@ http.adornParams = (params = {}, openDefultParams = false) => {
* form: 'application/x-www-form-urlencoded; charset=utf-8'
*/
http.adornData = (data = {}, openDefultdata = false, contentType = 'json') => {
var defaults = {
't': new Date().getTime()
}
data = openDefultdata ? merge(defaults, data) : data
return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
var defaults = {
't': new Date().getTime()
}
data = openDefultdata ? merge(defaults, data) : data
return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
}
export default http

View File

@ -5,10 +5,10 @@ const $headers = {
"Access-Control-Allow-Origin": "*"
};
const $config = {
region: "oss-cn-shanghai",
region: "oss-cn-nanjing",
accessKeyId: "",
accessKeySecret: "",
bucket: "djvideo"
bucket: "sy-duanju"
}
import { Notification } from 'element-ui'
function urlConversion(path) {
@ -16,7 +16,7 @@ function urlConversion(path) {
path = path.replace(reg, "https://$2$3$4$5$6");
return path
}
async function uploadAndDownloadFile(name, file, headers) {
return new Promise((resolve, reject) => {
try {
@ -70,7 +70,7 @@ class ossClient {
* 分片上传
* @param {Object} client oss客户端
* @param {Object} file 上传的文件
* @param {Object} dir 上传oss的文件夹
* @param {Object} dir 上传oss的文件夹
* @param {Object} progressCallback 分片进度回调
*/
async partUpload(name, file, progressCallback) {
@ -126,4 +126,4 @@ class ossClient {
}
export default ossClient;
export default ossClient;

View File

@ -2164,8 +2164,8 @@ export default {
return;
}
this.url = fileRes.replace(
"https://djvideo.oss-cn-shanghai.aliyuncs.com/",
"https://duanju.hnsiyao.cn/"
"https://sy-duanju.oss-cn-nanjing.aliyuncs.com/",
"https://short-video.hnsiyao.cn/"
);
},
onVideoFileSubmit(data) {