Ver código fonte

upload

dev_YWQ
HolyKnightIX 2 anos atrás
pai
commit
95a9bd8d7f
7 arquivos alterados com 52 adições e 36 exclusões
  1. +3
    -0
      .env.production
  2. +8
    -0
      .env.test
  3. +1
    -1
      package.json
  4. +3
    -13
      src/layout/index.vue
  5. +6
    -19
      src/router/index.ts
  6. +27
    -0
      src/types/components.d.ts
  7. +4
    -3
      src/utils/request.js

+ 3
- 0
.env.production Ver arquivo

@@ -1,5 +1,8 @@
## 生产环境 ## 生产环境


# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV='production'

VITE_APP_TITLE = 'Metavatar-PC' VITE_APP_TITLE = 'Metavatar-PC'
VITE_APP_PORT = 3000 VITE_APP_PORT = 3000
VITE_APP_BASE_API = 'https://photo.metavatar.cc/C' VITE_APP_BASE_API = 'https://photo.metavatar.cc/C'

+ 8
- 0
.env.test Ver arquivo

@@ -0,0 +1,8 @@
## 开发环境

# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV='test'

VITE_APP_TITLE = 'Metavatar-PC'
VITE_APP_PORT = 3000
VITE_APP_BASE_API = 'https://photo.metavatar.cc/C'

+ 1
- 1
package.json Ver arquivo

@@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite serve --mode development", "dev": "vite serve --mode development",
"build:dev": "vite build --mode development &&vue-tsc --noEmit",
"build:dev": "vite build --mode test &&vue-tsc --noEmit",
"build:prod": "vite build --mode production &&vue-tsc --noEmit" "build:prod": "vite build --mode production &&vue-tsc --noEmit"
}, },
"config": { "config": {


+ 3
- 13
src/layout/index.vue Ver arquivo

@@ -1,5 +1,5 @@
<template> <template>
<div v-if="sideBarVisible" :class="classObj" class="app-wrapper">
<div :class="classObj" class="app-wrapper">
<!-- 手机设备侧边栏打开遮罩层 --> <!-- 手机设备侧边栏打开遮罩层 -->
<div <div
v-if="classObj.mobile && classObj.openSidebar" v-if="classObj.mobile && classObj.openSidebar"
@@ -18,16 +18,12 @@
<!--主页面--> <!--主页面-->
<app-main /> <app-main />


<!-- 设置面板 -->
<!-- 设置面板 -->-
<RightPanel v-if="showSettings"> <RightPanel v-if="showSettings">
<settings /> <settings />
</RightPanel> </RightPanel>
</div> </div>
</div> </div>

<div v-if="!sideBarVisible">
<SignSucceed />
</div>
</template> </template>


<script setup lang="ts"> <script setup lang="ts">
@@ -57,7 +53,6 @@ const WIDTH = 992;
const appStore = useAppStore(); const appStore = useAppStore();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();


const sideBarVisible = ref(true);
const fixedHeader = computed(() => settingsStore.fixedHeader); const fixedHeader = computed(() => settingsStore.fixedHeader);
const showTagsView = computed(() => settingsStore.tagsView); const showTagsView = computed(() => settingsStore.tagsView);
const showSettings = computed(() => settingsStore.showSettings); const showSettings = computed(() => settingsStore.showSettings);
@@ -89,12 +84,7 @@ function handleOutsideClick() {
appStore.closeSideBar(false); appStore.closeSideBar(false);
} }


onMounted(() => {
if (route.path == "/signSucceed") {
sideBarVisible.value = false;
console.log(true);
}
});
onMounted(() => {});
</script> </script>


<style lang="scss" scoped> <style lang="scss" scoped>


+ 6
- 19
src/router/index.ts Ver arquivo

@@ -22,6 +22,11 @@ export const constantRoutes: RouteRecordRaw[] = [
component: () => import("@/views/login/index.vue"), component: () => import("@/views/login/index.vue"),
meta: { hidden: true }, meta: { hidden: true },
}, },
{
path: "/signSucceed",
component: () => import("@/views/signSucceed/index.vue"),
meta: { hidden: true },
},
// 创建视频 // 创建视频
{ {
path: "/", path: "/",
@@ -116,25 +121,7 @@ export const constantRoutes: RouteRecordRaw[] = [
}, },
], ],
}, },
// 商店
{
path: "/",
component: Layout,
redirect: "/signSucceed",
children: [
{
path: "signSucceed",
component: () => import("@/views/signSucceed/index.vue"),
name: "signSucceed",
meta: {
title: "signSucceed",
icon: "homepage",
affix: true,
name: "signSucceed.title",
},
},
],
},

// { // {
// path: "/dashboard", // path: "/dashboard",
// component: Layout, // component: Layout,


+ 27
- 0
src/types/components.d.ts Ver arquivo

@@ -8,9 +8,12 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCol: typeof import('element-plus/es')['ElCol']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider'] ElDivider: typeof import('element-plus/es')['ElDivider']
ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdown: typeof import('element-plus/es')['ElDropdown']
@@ -20,25 +23,46 @@ declare module '@vue/runtime-core' {
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs'] ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default'] GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default']
Hamburger: typeof import('./../components/Hamburger/index.vue')['default'] Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default'] IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
IEpClose: typeof import('~icons/ep/close')['default'] IEpClose: typeof import('~icons/ep/close')['default']
IEpCollection: typeof import('~icons/ep/collection')['default']
IEpDelete: typeof import('~icons/ep/delete')['default'] IEpDelete: typeof import('~icons/ep/delete')['default']
IEpDownload: typeof import('~icons/ep/download')['default'] IEpDownload: typeof import('~icons/ep/download')['default']
IEpEdit: typeof import('~icons/ep/edit')['default'] IEpEdit: typeof import('~icons/ep/edit')['default']
IEpGoods: typeof import('~icons/ep/goods')['default'] IEpGoods: typeof import('~icons/ep/goods')['default']
IEpMenu: typeof import('~icons/ep/menu')['default'] IEpMenu: typeof import('~icons/ep/menu')['default']
IEpPlus: typeof import('~icons/ep/plus')['default']
IEpPosition: typeof import('~icons/ep/position')['default']
IEpRefresh: typeof import('~icons/ep/refresh')['default']
IEpRefreshLeft: typeof import('~icons/ep/refresh-left')['default']
IEpSearch: typeof import('~icons/ep/search')['default']
IEpSetting: typeof import('~icons/ep/setting')['default'] IEpSetting: typeof import('~icons/ep/setting')['default']
IEpTop: typeof import('~icons/ep/top')['default']
IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
IEpVideoPlay: typeof import('~icons/ep/video-play')['default'] IEpVideoPlay: typeof import('~icons/ep/video-play')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default'] MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default']
@@ -51,4 +75,7 @@ declare module '@vue/runtime-core' {
SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default'] SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default']
WangEditor: typeof import('./../components/WangEditor/index.vue')['default'] WangEditor: typeof import('./../components/WangEditor/index.vue')['default']
} }
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
} }

+ 4
- 3
src/utils/request.js Ver arquivo

@@ -3,14 +3,15 @@ import router from '@/router'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
ElMessage ElMessage


const env = process.env.NODE_ENV
// 开发环境需以 "/api" 拼接,其他环境需以 "/C" 拼接
const env = process.env.NODE_ENV == 'development' ? "/api" : "/C"
console.log(env, 'env') console.log(env, 'env')

/** /**
* @description:发送Axios请求 * @description:发送Axios请求
*/ */
const request = axios.create({ const request = axios.create({
baseURL: '/C',
baseURL: env,
timeout: 5000 timeout: 5000
}) })




Carregando…
Cancelar
Salvar