From 95b3a5c4ce0ec292def88e82f1022fff0f801ac6 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 12 Dec 2024 16:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=8E=BB=E9=99=A4=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=89=93=E5=8C=85=EF=BC=8C=E4=BF=AE=E6=94=B9app=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0=E6=A0=B9=E6=8D=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=B7=E6=B1=82=E5=9C=B0=E5=9D=80=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 4 ++-- src/config/index.js | 10 ++++++++++ src/utils/httpRequest.js | 5 +++-- src/views/app/app.vue | 8 ++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/config/index.js diff --git a/gulpfile.js b/gulpfile.js index f1a8ee2..7848d90 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,8 +16,8 @@ var env = ''; // 运行环境 var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate() var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours() var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes() - version = yy + MM + DD + h + mm - versionPath = distPath + '/' + version + // version = yy + MM + DD + h + mm + // versionPath = distPath + '/' + version })() // 编译 diff --git a/src/config/index.js b/src/config/index.js new file mode 100644 index 0000000..5dbc966 --- /dev/null +++ b/src/config/index.js @@ -0,0 +1,10 @@ +export const testUrl='video-admin'; +export const productUrl='dj-admin'; + +// const baseUrl = "http://192.168.1.15:8100/sqx_fast/" + const baseUrl = "https://video.hnsiyao.cn/sqx_fast/" +// const baseUrl = "https://dj-api.hnsiyao.cn/sqx_fast/" + +export default{ + baseUrl +} \ No newline at end of file diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index 45821a1..429ae8d 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -4,12 +4,13 @@ import router from '@/router' import qs from 'qs' import merge from 'lodash/merge' import {clearLoginInfo} from '@/utils' - +import config from '@/config/index.js' export const entryName = '短剧13.2系统'; +const baseUrl = config.baseUrl // const baseUrl = "http://192.168.1.15:8100/sqx_fast/" -const baseUrl = "https://video.hnsiyao.cn/sqx_fast/" +// const baseUrl = "https://video.hnsiyao.cn/sqx_fast/" // const baseUrl = "https://dj-api.hnsiyao.cn/sqx_fast/" // const $urlMap={ diff --git a/src/views/app/app.vue b/src/views/app/app.vue index 636ad5e..5888e20 100644 --- a/src/views/app/app.vue +++ b/src/views/app/app.vue @@ -250,6 +250,8 @@ import { getUUID } from "@/utils"; import OSS from "@/utils/oss-upload.js"; import { $getCredentials } from "@/api/oss.js"; +import config from "@/config/index.js"; + export default { data() { return { @@ -402,8 +404,10 @@ export default { console.log(data); const date = new Date(); const houzhui = "." + data.name.substr(data.name.lastIndexOf(".") + 1); - const name = "app/" + "test-duanju" + houzhui; - // const name = "app/" + "sy-duanju" + houzhui; + const isTest=config.baseUrl.includes('dj-api.hnsiyao.cn')?false:true + const appName=isTest?'test-duanju':'sy-duanju' + const name = "app/" + appName + houzhui; + console.log(name); const fileRes = await this.ossClient.partUpload(name, data.raw, (p) => { this.percentage = Math.floor(p * 100); console.log(this.percentage);