diff --git a/.env.development b/.env.development index 89219d7..5d94317 100644 --- a/.env.development +++ b/.env.development @@ -5,4 +5,6 @@ NODE_ENV='development' VITE_APP_TITLE = 'Metavatar-PC' VITE_APP_PORT = 3000 -VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' +# VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' +VITE_APP_BASE_API = 'https://phototest.metavatar.cc/C' + diff --git a/.env.production b/.env.production index 7c0ff2a..76cae70 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,5 @@ NODE_ENV='production' VITE_APP_TITLE = 'Metavatar-PC' VITE_APP_PORT = 3000 +# VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' diff --git a/.env.test b/.env.test index ce525c5..0abe29d 100644 --- a/.env.test +++ b/.env.test @@ -5,4 +5,5 @@ NODE_ENV='test' VITE_APP_TITLE = 'Metavatar-PC' VITE_APP_PORT = 3000 -VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' +# VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' +VITE_APP_BASE_API = 'https://phototest.metavatar.cc/C' diff --git a/src/apis/createVideo.js b/src/apis/createVideo.js index 6874ea3..cf150a4 100644 --- a/src/apis/createVideo.js +++ b/src/apis/createVideo.js @@ -206,7 +206,7 @@ export function musicListPersonApi(pageNum, pageSize) { } /** - * @description 保存音频(新) + * @description 保存音乐 * @params videoId * @returns data */ @@ -216,4 +216,17 @@ export function saveMusicApi(data) { method: 'post', data }) +} + +/** + * @description 保存音乐 + * @params videoId + * @returns data + */ +export function delMusicApi(id) { + return request({ + url: `api/userPhotoVideo/delete?id=${id}`, + method: 'get', + + }) } \ No newline at end of file diff --git a/src/components/myLoadingIcon.vue b/src/components/myLoadingIcon.vue index 3366999..a4a4f3d 100644 --- a/src/components/myLoadingIcon.vue +++ b/src/components/myLoadingIcon.vue @@ -32,8 +32,8 @@ const props = defineProps({ .loadingIcon { position: relative; width: 100%; - height: 80px; - line-height: 80px; + height: 60px; + line-height: 60px; text-align: center; transform: scale(2); > div { diff --git a/src/lang/package/en.ts b/src/lang/package/en.ts index 5132349..ab79283 100644 --- a/src/lang/package/en.ts +++ b/src/lang/package/en.ts @@ -73,6 +73,10 @@ export default { searchMusic:'Search Music', comingSoon:'coming soon', hotMusic:'Hit song', + inputRequirement:'Please enter your requirements', + GeneratedText:'Generated Text', + SmartText:'Smart Text', + copy:'Copy to text', }, // 我的视频 @@ -162,4 +166,8 @@ export default { goLogin: "Login Now", reSend: "Resend", }, + tips:{ + tokenExpired:'Login expired, please login again', + systemException:'The system is abnormal. Please try again later' + } }; diff --git a/src/lang/package/zh-cn.ts b/src/lang/package/zh-cn.ts index 146e0a8..852230c 100644 --- a/src/lang/package/zh-cn.ts +++ b/src/lang/package/zh-cn.ts @@ -73,6 +73,10 @@ export default { searchMusic:'搜索音乐', comingSoon:'敬请期待', hotMusic:'热门歌曲', + inputRequirement:'请输入您的需求', + GeneratedText:'生成文本', + SmartText:'智能文本', + copy:'复制到文案', }, // 我的视频 @@ -161,4 +165,8 @@ export default { goLogin: "即将登录", reSend: "重新发送", }, + tips:{ + tokenExpired:'登录过期,请重新登录', + systemException:'系统异常,请稍后再试' + } }; diff --git a/src/mixins/webSocket.js b/src/mixins/webSocket.js new file mode 100644 index 0000000..55b8b8f --- /dev/null +++ b/src/mixins/webSocket.js @@ -0,0 +1,38 @@ +export default { + data() { + return { + socket: null + }; + }, + methods: { + connectWebSocket() { + this.socket = new WebSocket('wss://gptsocket.malls.iformall.com:8010'); + this.socket.onopen = () => { + console.log('WebSocket 连接成功'); + }; + + this.socket.onmessage = (event) => { + console.log('接收到 WebSocket 消息:', event.data); + }; + + this.socket.onclose = () => { + console.log('WebSocket 连接关闭'); + }; + + this.socket.onerror = (error) => { + console.error('WebSocket 错误:', error); + }; + }, + sendWebSocketMessage(message) { + if (this.socket && this.socket.readyState === WebSocket.OPEN) { + this.socket.send(message); + } + }, + closeWebSocket() { + if (this.socket) { + this.socket.close(); + this.socket = null; + } + } + } +}; diff --git a/src/permission.ts b/src/permission.ts index c5b163a..9758fc8 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -20,7 +20,7 @@ router.beforeEach(async (to, from, next) => { // if ((to.params.type as string) == "4") { // next(); // } - if (to.params.type ) { + if (to.query.type ) { next(); } // 邮件重置密码 忘记密码 diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 5352139..d9ee3fe 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -11,6 +11,8 @@ declare module '@vue/runtime-core' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElCol: typeof import('element-plus/es')['ElCol'] + ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] @@ -32,14 +34,20 @@ declare module '@vue/runtime-core' { Hamburger: typeof import('./../components/Hamburger/index.vue')['default'] IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IEpClose: typeof import('~icons/ep/close')['default'] + IEpCloseBold: typeof import('~icons/ep/close-bold')['default'] + IEpDelete: typeof import('~icons/ep/delete')['default'] IEpDocumentAdd: typeof import('~icons/ep/document-add')['default'] + IEpDownload: typeof import('~icons/ep/download')['default'] IEpEdit: typeof import('~icons/ep/edit')['default'] IEpGoods: typeof import('~icons/ep/goods')['default'] IEpHeadset: typeof import('~icons/ep/headset')['default'] + IEpLoading: typeof import('~icons/ep/loading')['default'] IEpLock: typeof import('~icons/ep/lock')['default'] IEpMenu: typeof import('~icons/ep/menu')['default'] IEpMic: typeof import('~icons/ep/mic')['default'] + IEpSearch: typeof import('~icons/ep/search')['default'] IEpSetting: typeof import('~icons/ep/setting')['default'] + IEpVideoPlay: typeof import('~icons/ep/video-play')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default'] MyLoading: typeof import('./../components/myLoading.vue')['default'] @@ -52,6 +60,8 @@ declare module '@vue/runtime-core' { SizeSelect: typeof import('./../components/SizeSelect/index.vue')['default'] SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default'] WangEditor: typeof import('./../components/WangEditor/index.vue')['default'] + Websocket: typeof import('./../components/websocket.vue')['default'] + Websoket: typeof import('./../components/websoket.vue')['default'] } export interface ComponentCustomProperties { vInfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll'] diff --git a/src/utils/request.js b/src/utils/request.js index 9a13562..32e16da 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -38,18 +38,23 @@ request.interceptors.request.use( // 响应拦截器 request.interceptors.response.use( function (response) { + console.log(response.data); + if (!response.data) { + ElMessage.error($t('tips.systemException')); + } let code = response.data.code // 当token无效(过期或损坏)时 1053为未登录 if (code == 1052 || code == 1053) { localStorage.removeItem("AccessToken"); router.push("/login"); - ElMessage.error("登录过期,请重新登录!"); + // ElMessage.error("登录过期,请重新登录!"); + ElMessage.error($t('tips.tokenExpired')); return // 弹出错误 } else if (code != 200) { if (code == 500) { - ElMessage.error("系统异常,请稍后再试"); - + // ElMessage.error("系统异常,请稍后再试"); + ElMessage.error($t('tips.systemException')); // 其他错误 } else { return Promise.reject(response.data) diff --git a/src/views/createVideo/index.vue b/src/views/createVideo/index.vue index b55ee13..2329ecb 100644 --- a/src/views/createVideo/index.vue +++ b/src/views/createVideo/index.vue @@ -483,6 +483,12 @@ > 🎵{{ item.name }} {{ handleTime(item.time) }} + + @@ -542,104 +548,40 @@
+
- 🔊 - 🕗
-

{{ $t("createVideo.languages") }}

+
+ + + {{ $t("createVideo.GeneratedText") }} + +
+ +

{{ $t("createVideo.SmartText") }}

- - - - {{ item.name }} - - -

{{ $t("createVideo.voices") }}

- - - - -

{{ $t("createVideo.styles") }}

- - - + + - - - - - {{ - $t("createVideo.saveVideo") - }} - - - - {{ - $t("createVideo.generateVideo") - }} +
+
+ {{ $t("createVideo.copy") }} +
@@ -653,6 +595,7 @@ @@ -2111,7 +2159,7 @@ onMounted(async () => { cursor: pointer; .musicNmae { display: inline-block; - width: 280px; + width: 260px; margin-right: 20px; overflow: hidden; text-overflow: ellipsis; @@ -2124,6 +2172,13 @@ onMounted(async () => { text-overflow: ellipsis; white-space: nowrap; } + .delMusic { + color: #fff; + padding-left: 15px; + padding-top: -15px; + line-height: 30px; + vertical-align: top; + } } .musicItemAvtive { background-color: #000; @@ -2184,7 +2239,7 @@ onMounted(async () => { .card4 { .text { padding: 10px; - border: 1px solid #000; + border: 1px solid #c0c4cc; .el-button { float: right; margin-top: 10px; @@ -2199,16 +2254,15 @@ onMounted(async () => { p { margin: 7px 0; } - - > .el-button { - width: 100%; - height: 50px; + .card4Btn { margin-top: 10px; - } - - :deep(.el-input .is-focus) { - // box-shadow: none !important; - // box-shadow: 0 0 0 1px #000 !important; + border-radius: 5px; + height: 50px; + width: 100%; + color: #fff; + background-color: #000; + text-align: center; + line-height: 50px; } } :deep(.el-tabs__item.is-active) { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 8991b73..b1ddfa5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -996,8 +996,15 @@ onMounted(() => { getCode(); getInfo(); // 重置密码 - if (router.currentRoute.value.params.type) { - // isLogin.value = Number(router.currentRoute.value.params.type); + // if (router.currentRoute.value.params.type) { + // // isLogin.value = Number(router.currentRoute.value.params.type); + // isLogin.value = 4; + // } + // if (router.currentRoute.value.params.type) { + // // isLogin.value = Number(router.currentRoute.value.params.type); + // isLogin.value = 4; + // } + if (route.query.type) { isLogin.value = 4; } //有resetPwd则说明是重置密码邮件来的 diff --git a/src/views/myAccount/index.vue b/src/views/myAccount/index.vue index 0529152..02dc92d 100644 --- a/src/views/myAccount/index.vue +++ b/src/views/myAccount/index.vue @@ -233,7 +233,7 @@ const dialogAvatarData = ref(null); //图片上传数据 const infoDialogLoad = ref(false); //load效果 // 去重置密码 function resetPassWord() { - router.push({ name: "login", params: { type: 4 } }); + router.push({ name: "login", query: { type: 4 } }); } // 选择图片 async function chooseImg(e) {