diff --git a/.env.development b/.env.development deleted file mode 100644 index d540087..0000000 --- a/.env.development +++ /dev/null @@ -1 +0,0 @@ -VITE_BASE_URL = '' diff --git a/.env.production b/.env.production deleted file mode 100644 index 48e4c8f..0000000 --- a/.env.production +++ /dev/null @@ -1 +0,0 @@ -VITE_BASE_URL = '' \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index adbcec7..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.local -*.sh \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 3dc5b08..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["johnsoncodehk.volar"] -} diff --git a/dist/assets/About.4a0a852a.js b/assets/About.4a0a852a.js similarity index 100% rename from dist/assets/About.4a0a852a.js rename to assets/About.4a0a852a.js diff --git a/dist/assets/Home.648ad928.js b/assets/Home.648ad928.js similarity index 100% rename from dist/assets/Home.648ad928.js rename to assets/Home.648ad928.js diff --git a/dist/assets/Home.b1f579af.css b/assets/Home.b1f579af.css similarity index 100% rename from dist/assets/Home.b1f579af.css rename to assets/Home.b1f579af.css diff --git a/dist/assets/Search.14cecb77.js b/assets/Search.14cecb77.js similarity index 100% rename from dist/assets/Search.14cecb77.js rename to assets/Search.14cecb77.js diff --git a/dist/assets/Search.6732d741.css b/assets/Search.6732d741.css similarity index 100% rename from dist/assets/Search.6732d741.css rename to assets/Search.6732d741.css diff --git a/dist/assets/index.19d4961f.js b/assets/index.19d4961f.js similarity index 100% rename from dist/assets/index.19d4961f.js rename to assets/index.19d4961f.js diff --git a/dist/assets/index.b863cb84.css b/assets/index.b863cb84.css similarity index 100% rename from dist/assets/index.b863cb84.css rename to assets/index.b863cb84.css diff --git a/dist/assets/index.f96d417c.js b/assets/index.f96d417c.js similarity index 100% rename from dist/assets/index.f96d417c.js rename to assets/index.f96d417c.js diff --git a/dist/assets/logo.b28d5e28.js b/assets/logo.b28d5e28.js similarity index 100% rename from dist/assets/logo.b28d5e28.js rename to assets/logo.b28d5e28.js diff --git a/dist/assets/logo.f1443e42.png b/assets/logo.f1443e42.png similarity index 100% rename from dist/assets/logo.f1443e42.png rename to assets/logo.f1443e42.png diff --git a/dist/assets/vendor.17bdbd54.js b/assets/vendor.17bdbd54.js similarity index 100% rename from dist/assets/vendor.17bdbd54.js rename to assets/vendor.17bdbd54.js diff --git a/dist/assets/vendor.7dd8395f.css b/assets/vendor.7dd8395f.css similarity index 100% rename from dist/assets/vendor.7dd8395f.css rename to assets/vendor.7dd8395f.css diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 3721ebb..0000000 --- a/dist/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Vite App - - - - - - -
- - - diff --git a/dist/favicon.ico b/favicon.ico similarity index 100% rename from dist/favicon.ico rename to favicon.ico diff --git a/index.html b/index.html index 11603f8..3721ebb 100644 --- a/index.html +++ b/index.html @@ -2,12 +2,16 @@ - + Vite App + + + +
- + diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 52b6aed..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/src/App.vue b/src/App.vue deleted file mode 100644 index b5d4b15..0000000 --- a/src/App.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/src/api/home.ts b/src/api/home.ts deleted file mode 100644 index c89a9ea..0000000 --- a/src/api/home.ts +++ /dev/null @@ -1,5 +0,0 @@ -import axiosInstance, { AxiosResponseProps } from '@/uitls/request'; - -export const getList = (params?: any) => { - return axiosInstance.get("https://www.fastmock.site/mock/826b7b3ffc420fe885bdce88c8e6cdb7/test/api/list", { params: params || {} }); -}; diff --git a/src/api/orders.ts b/src/api/orders.ts deleted file mode 100644 index cfbd88f..0000000 --- a/src/api/orders.ts +++ /dev/null @@ -1,5 +0,0 @@ -import axiosInstance, { AxiosResponseProps } from '@/uitls/request' - -export const getList = (params: any) => { - return axiosInstance.get("/common/code/logisticsInfo/getLogisticsByOrderId", { params: params || {} }); -} diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index 6d58b32..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/assets/scss/index.scss b/src/assets/scss/index.scss deleted file mode 100644 index ddfa33a..0000000 --- a/src/assets/scss/index.scss +++ /dev/null @@ -1,210 +0,0 @@ -@import './reset.scss'; -@import './mixin.scss'; -@import './variables.scss'; -html { - @include root-font-size(); -} -//@author TalkTao - -.flex-shrink-0 { - flex-shrink: 0; -} -.flex-grow-0 { - flex-grow: 0; -} -.flex-grow-1 { - flex-grow: 1; -} -.flex-column { - flex-direction: column; -} -.flex-wrap { - flex-wrap: wrap; -} -.object-fit-cover { - object-fit: cover; -} -.border-box { - box-sizing: border-box; -} -.fw-bold { - font-weight: bold; -} -.w-0 { - width: 0; -} -.w-100 { - width: 100%; -} -.w-50{ - width: 50%; -} -.h-100 { - height: 100%; -} -.text-ellipsis { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} -.text-again-center { - text-align: center; -} -.flex-column{ - flex-direction: column; -} -@each $key, $val in $fontSizeS { - .fs-#{$key} { - font-size: #{$val}; - } -} -//.d-flex {display: flex;} -@each $item in $displayList { - .d-#{$item} { - display: #{$item}; - } -} -//.flex-center {justify-content: center;} -@each $commonKey, $commonVal in $flexCommonValues { - .flex-#{$commonKey} { - display: flex; - justify-content: #{$commonVal}; - align-items: #{$commonVal}; - } - .align-self-#{$commonKey} { - align-self: #{$commonVal}; - } -} -//.justify-content-between {justify-content: sapce-between;} -@each $key, $val in $justify-content-values { - .justify-content-#{$key} { - justify-content: #{$val}; - } -} -//.align-items-start {align-items-start: flex-start;} -@each $key, $val in $align-items-values { - .align-items-#{$key} { - align-items: #{$val}; - } -} -//.postion-absolute {absolute;} -@each $pos in $positionList { - .position-#{$pos} { - position: #{$pos}; - } -} -//.overflow-x-scroll {overflow-x:scroll} -@each $dir in $overflowDirs { - .#{$dir}-scroll { - #{$dir}: scroll; - } -} -//pt-5 {padding-top: 1vw} -.rounded-circle { - border-radius: 50%; -} -@for $size from 1 through 50 { - .rounded-#{$size} { - border-radius: #{$size}vw; - } - @each $t_d_key, $t_d_val in $spaceTypes_Dirs { - .#{$t_d_key}-#{$size} { - #{$t_d_val}: #{$size}vw; - } - } - .mx-#{$size} { - margin-left: #{$size}vw; - margin-right: #{$size}vw; - } - .my-#{$size} { - margin-top: #{$size}vw; - margin-bottom: #{$size}vw; - } - .px-#{$size} { - padding-left: #{$size}vw; - padding-right: #{$size}vw; - } - .py-#{$size} { - padding-top: #{$size}vw; - padding-bottom: #{$size}vw; - } -} -//top-0 {top: 0;} -@each $type, $val in $positionTypes { - .#{$type}-0 { - #{$val}: 0; - } -} -//bg-white {background-color: white;} -@each $key, $val in $colors { - .bg-#{"" + $key} { - background-color: #{$val}; - } - .text-#{"" + $key} { - color: #{$val}; - } -} -//.border-pill {border-radius: 50rem} -@each $key, $val in $radiusList { - .border-#{$key} { - border-radius: #{$val}; - } -} -//.opacity-75 {opacity: 0.75} -@for $index from 0 through 4 { - .opacity-#{$index * 25} { - opacity: #{$index * 0.25}; - } -} -//.text-center {text-align: center} -@each $var in $textAlignDirs { - .text-#{$var} { - text-align: #{$var}; - } -} -//.border-bottom-1 {border-bottom: 1px} .border-bottom {border-bottom: 1px} -@for $size from 0 to 5 { - @each $posKey, $posVal in $positionTypes { - @if $size == 0 { - .border-#{$posKey} { - border-#{$posVal}: 1px solid #e6e6e6; - } - } @else { - .border-#{$posKey}-#{$size} { - border-#{$posVal}: #{$size}px solid #e6e6e6; - } - } - } -} -@mixin placeholderColor($color) { - &::input-placeholder { - /*WebKit browsers*/ - color: $color; - } - &::-webkit-input-placeholder { - /*WebKit browsers*/ - color: $color; - } - &::-moz-input-placeholder { - /*Mozilla Firefox*/ - color: $color; - } - &::-ms-input-placeholder { - /*Internet Explorer*/ - color: $color; - } -} -@mixin ellipsisRow($row: 1) { - @debug "$row is #{$row}"; - @if $row == 1 { - // @debug "1行"; - @extend .text-ellipsis; - } @else { - // @debug "多行"; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; // 作为弹性伸缩盒子模型显示。 - -webkit-box-orient: vertical; // 设置伸缩盒子的子元素排列方式--从上到下垂直排列 - -webkit-line-clamp: #{$row}; // 显示的行 - } -} \ No newline at end of file diff --git a/src/assets/scss/mixin.scss b/src/assets/scss/mixin.scss deleted file mode 100644 index 5736d22..0000000 --- a/src/assets/scss/mixin.scss +++ /dev/null @@ -1,191 +0,0 @@ -// 清除浮动 -@mixin clearfix { - &:after { - content: ""; - display: table; - clear: both; - } -} - -// 多行隐藏 -@mixin textoverflow($clamp:1) { - display: block; - overflow: hidden; - text-overflow: ellipsis; - -o-text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: $clamp; - /*! autoprefixer: ignore next */ - -webkit-box-orient: vertical; -} - -//flex box -@mixin flexbox($jc:space-between, $ai:center, $fd:row, $fw:nowrap) { - display: flex; - display: -webkit-flex; - flex: 1; - justify-content: $jc; - -webkit-justify-content: $jc; - align-items: $ai; - -webkit-align-items: $ai; - flex-direction: $fd; - -webkit-flex-direction: $fd; - flex-wrap: $fw; - -webkit-flex-wrap: $fw; -} - - -/* 移动端页面设计稿宽度 */ -$design-width: 750; -/* 移动端页面设计稿dpr基准值 */ -$design-dpr: 2; -/* 将移动端页面分为10块 */ -$blocks: 10; -/* 缩放所支持的设备最小宽度 */ -$min-device-width: 320px; -/* 缩放所支持的设备最大宽度 */ -$max-device-width: 750px; - -/* - rem与px对应关系,1rem代表html font-size值(为一块的宽度),$rem即为$px对应占多少块 - - $px $rem - ------------- === ------------ - $design-width $blocks -*/ - -/* html根元素的font-size定义,简单地将页面分为$blocks块,方便计算 */ -@mixin root-font-size() { - font-size: calc(100vw / $blocks); - - body { - @include container-min-width(); - } - - /* 最小宽度定义 */ - @media screen and (max-width: $min-device-width) { - font-size: calc($min-device-width / $blocks); - } - - /* 最大宽度定义 */ - &[data-content-max] { - body[data-content-max] { - @include container-max-width(); - } - - @media screen and (min-width: $max-device-width) { - font-size: calc($max-device-width / $blocks); - } - } -} - -/* 单位px转化为rem */ -@function px2rem($px) { - @return #{$px / $design-width * $blocks}rem; -} - -/* 单位rem转化为px,可用于根据rem单位快速计算原px */ -@function rem2px($rem) { - @return #{$rem / $blocks * $design-width}px; -} - -/** - * 实现固定宽高比 - * @param {string} $position: relative 定位方式 - * @param {string} $width: 100% 容器宽度 - * @param {string} $sub: null 容器的目标子元素 - * @param {number} $aspectX: 1 容器宽 - * @param {number} $aspectY: 1 容器高 - */ -@mixin aspect-ratio($position: relative, - $width: 100%, - $sub: null, - $aspectX: 1, - $aspectY: 1) { - overflow: hidden; - position: $position; - padding-top: percentage($aspectY / $aspectX); - width: $width; - height: 0; - - @if $sub==null { - $sub: "*"; - } - - &>#{$sub} { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - } -} - -/* 设置容器拉伸的最小宽度 */ -@mixin container-min-width() { - margin-right: auto; - margin-left: auto; - min-width: $min-device-width; -} - -/* 设置容器拉伸的最大宽度 */ -@mixin container-max-width() { - margin-right: auto; - margin-left: auto; - max-width: $max-device-width; -} - -/* 设置字体大小,不使用rem单位, 根据dpr值分段调整 */ -@mixin font-size($fontSize) { - font-size: $fontSize / $design-dpr; - - [data-dpr="2"] & { - font-size: $fontSize / $design-dpr * 2; - } - - [data-dpr="3"] & { - font-size: $fontSize / $design-dpr * 3; - } -} - -/* 清除浮动 */ -@mixin clearfix { - *zoom: 1; - - &:after { - content: ""; - display: block; - height: 0; - visibility: hidden; - clear: both; - } -} - -/* -*$line:超出显示几行省略号 -*$substract:预留区域百分比 -*/ -@mixin text-overflow($line:1, $substract:0) { - overflow: hidden; - - @if $line==1 { - white-space: nowrap; - text-overflow: ellipsis; - width: 100% -$substract; - } - - @else { - display: -webkit-box; - -webkit-line-clamp: $line; - -webkit-box-orient: vertical; - } -} - - - - - -@mixin WH($Width:100%, $Height:100%) { - width: $Width; - height: $Height; -} \ No newline at end of file diff --git a/src/assets/scss/reset.scss b/src/assets/scss/reset.scss deleted file mode 100644 index c23179c..0000000 --- a/src/assets/scss/reset.scss +++ /dev/null @@ -1,60 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v4.0 | 20180602 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, menu, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -main, menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, main, menu, nav, section { - display: block; -} -/* HTML5 hidden-attribute fix for newer browsers */ -*[hidden] { - display: none; -} -body { - line-height: 1; -} -menu, ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -img{ - border: none; -} - -/* 去除iPhone中默认的input样式 */ -input[type="submit"],input[type="reset"],input[type="button"],input:focus,button:focus,select:focus,textarea:focus{ outline: none;} -input{-webkit-appearance:none; resize: none; border-radius: 0;} - diff --git a/src/assets/scss/variables.scss b/src/assets/scss/variables.scss deleted file mode 100644 index deed28f..0000000 --- a/src/assets/scss/variables.scss +++ /dev/null @@ -1,73 +0,0 @@ -$background-color: #eeeeee; -$title: 18px; -$primary: #b42e46; -$positionList: (relative, absolute, fixed); -$displayList: (flex, block, inline-block, none); -$flexCommonValues: ( - start: flex-start, - center: center, - end: flex-end, -); -$justify-content-values: ( - start: flex-start, - center: center, - between: space-between, - around: space-around, - evenly: space-evenly, - end: flex-end, -); -$align-items-values: ( - start: flex-start, - center: center, - end: flex-end, -); -$overflowDirs: (overflow, overflow-x, overflow-y); -$spaceTypes_Dirs: ( - "p": padding, - "m": margin, - "ps": padding-left, - "pe": padding-right, - "pt": padding-top, - "pb": padding-bottom, - "ms": margin-left, - "me": margin-right, - "mt": margin-top, - "mb": margin-bottom, -); -$positionTypes: ( - "top": top, - "bottom": bottom, - "left": left, - "right": right, - "start": left, - "end": right, -); -$colors: ( - primary: $primary, - white: #ffffff, - muted: #6c757d, - black: #000, - dark: #333, - bgPrimary: "#303c5a", - red: red, - immediateColor: #94765c, -); -$radiusList: ( - circle: 100%, - pill: 50rem, -); -$fontSizeS: ( - 6: 3.2vw, - 5: calc(3.2vw * 1.1), - 4: calc(3.2vw * 1.2), - 3: calc(3.2vw * 1.3), - 2: calc(3.2vw * 1.4), - 1: calc(3.2vw * 2.3), -); -$textAlignDirs: (left, center, right); -//导出js变量 -:export { - primary: $primary; - bgPrimary: "#303c5a"; - muted: #6c757d; -} diff --git a/src/components/interactions/RequestLoading.vue b/src/components/interactions/RequestLoading.vue deleted file mode 100644 index d378ec0..0000000 --- a/src/components/interactions/RequestLoading.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/components/mainPat/CustomHeader.vue b/src/components/mainPat/CustomHeader.vue deleted file mode 100644 index 2f6bf3c..0000000 --- a/src/components/mainPat/CustomHeader.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/components/mainPat/TabBar.vue b/src/components/mainPat/TabBar.vue deleted file mode 100644 index 18947d2..0000000 --- a/src/components/mainPat/TabBar.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/components/svgIcon/LoadingIcon.vue b/src/components/svgIcon/LoadingIcon.vue deleted file mode 100644 index 4e356ec..0000000 --- a/src/components/svgIcon/LoadingIcon.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts deleted file mode 100644 index aafef95..0000000 --- a/src/env.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -declare module '*.vue' { - import type { DefineComponent } from 'vue' - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types - const component: DefineComponent<{}, {}, any> - export default component -} diff --git a/src/layout/index.vue b/src/layout/index.vue deleted file mode 100644 index f5253e2..0000000 --- a/src/layout/index.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main.ts b/src/main.ts deleted file mode 100644 index bf63bfb..0000000 --- a/src/main.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createApp } from 'vue'; -import App from './App.vue'; -import router from './router'; -import { vuexStore, piniaStore } from './store'; - -// 移动端适配 -import 'lib-flexible/flexible.js'; - -// 引入全局样式 -import '@/assets/scss/index.scss'; - -// 全局引入按需引入UI库 vant -import { vantPlugins } from './plugins/vant.js'; - -//全局公共组件 -import components from './plugins/components.js'; - -createApp(App).use(vuexStore).use(piniaStore).use(router).use(vantPlugins).use(components).mount('#app'); \ No newline at end of file diff --git a/src/plugins/components.ts b/src/plugins/components.ts deleted file mode 100644 index 4d5e8d6..0000000 --- a/src/plugins/components.ts +++ /dev/null @@ -1,16 +0,0 @@ -const modules = import.meta.globEager('../components/*/*.vue'); - -export default { - install(app) { - Object.keys(modules).forEach(componentPath => { - - // 获取遍历的当前组件实例对象 - let curComponent = modules[componentPath]?.default; - - app.component(curComponent.name, curComponent); - }); - } - -} - - diff --git a/src/plugins/vant.ts b/src/plugins/vant.ts deleted file mode 100644 index 255fa54..0000000 --- a/src/plugins/vant.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @author TalkTao - * @description 按需引入Vant -*/ -import { Button, Tabbar, TabbarItem, Sticky, NavBar, Icon, Search, DropdownMenu, DropdownItem, Image, Lazyload, Tabs, Tab, Toast, Field, Cell, CellGroup, Form, List } from 'vant' -const pluginsVant = [ - Button, - Tabbar, - TabbarItem, - Sticky, - NavBar, - Icon, - Search, - DropdownMenu, - DropdownItem, - Image, - Lazyload, - Tabs, - Tab, - Toast, - Field, - Cell, - CellGroup, - Form, - List -] -export const vantPlugins = { - install: function(vm) { - pluginsVant.forEach((item:any) => { - vm.component(item.name, item); - }); - } -}; \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts deleted file mode 100644 index fbe41c6..0000000 --- a/src/router/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; - -// 通过Vite的import.meta.glob()方法实现自动化导入路由 -const mainRouterModules = import.meta.glob('../layout/*.vue') -const viewRouterModules = import.meta.glob('../views/**/*.vue') - -// 子路由 -const childRoutes = Object.keys(viewRouterModules).map((path)=>{ - const childName = path.match(/\.\.\/views\/(.*)\.vue$/)[1].split('/')[1]; - return { - path: `/${childName.toLowerCase()}`, - name: childName, - component: viewRouterModules[path] - } -}) - -// 根路由 -const rootRoutes = Object.keys(mainRouterModules).map((path) => { - const name = path.match(/\.\.\/layout\/(.*)\.vue$/)[1].toLowerCase(); - const routePath = `/${name}`; - if (routePath === '/index') { - return { - path: '/', - name, - redirect: '/home', - component: mainRouterModules[path], - children: childRoutes - }; - } -}) - -const routes: Array = rootRoutes - -const router = createRouter({ - history: createWebHashHistory(), - routes, -}); - -export default router - - - - - - - diff --git a/src/store/index.ts b/src/store/index.ts deleted file mode 100644 index 0478deb..0000000 --- a/src/store/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createStore } from "vuex"; -import { createPinia } from "pinia"; - -export const vuexStore = createStore({ - state: { - isLoading: false, - userName: "" - }, - getters: { - - }, - mutations: { - changeIsLoading(state, val) { - state.isLoading = val; - }, - - getUserNmae(state, data) { - state.userName = data; - } - - }, - actions: { - - }, - modules: {}, -}); - - -export const piniaStore = createPinia(); diff --git a/src/store/testPinia.ts b/src/store/testPinia.ts deleted file mode 100644 index c5572ee..0000000 --- a/src/store/testPinia.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ref } from 'vue' -import { defineStore } from "pinia" -export const usePiniaState = defineStore('pinia', ()=>{ - const userName = ref('') - const getUserNmae = (data) => { - userName.value = data - } - return { userName, getUserNmae} -}) - - -// export const usePiniaState = defineStore({ -// id: 'textPinia', -// state: () => { -// return { -// userName: '' -// } -// }, -// getters: { - -// }, -// actions: { -// getUserNmae(data) { -// this.userName = data -// } -// } -// }) \ No newline at end of file diff --git a/src/uitls/request.ts b/src/uitls/request.ts deleted file mode 100644 index 643ce28..0000000 --- a/src/uitls/request.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author TalkTao - * @description 接口封装 -*/ -import { vuexStore } from "@/store/index"; -import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, Method } from "axios"; -export interface AxiosResponseProps { - code?: number; - status?: number; - data?: any; - datas?: any; - msg?: string | null; -} -class HttpRequest { - private readonly baseURL: string; - private readonly withCredentials: boolean; - private readonly timeout: number; - constructor() { - //获取当前环境的api地址 - this.baseURL = import.meta.env.VITE_BASE_URL as string; - this.withCredentials = true; - this.timeout = 1000 * 60; - } - //初始化get请求 - getInitConfig(): AxiosRequestConfig { - return { - baseURL: this.baseURL, - withCredentials: this.withCredentials, - timeout: this.timeout, - }; - } - interceptors(instance: AxiosInstance) { - let requestList = []; - const setLoadingToFalse = response => { - - requestList - .filter(item => item.url == response.config.url && item.method == response.config.method) - .forEach(item => (item.isLoading = false)); - - //所有请求都加载完才让加载提示消失 - if (requestList.every(item => !item.isLoading)) vuexStore.commit("changeIsLoading", false); - - }; - - instance.interceptors.request.use( - (config: any) => { - - let ignoreLoadingUrls = ["/login"]; - - if (!ignoreLoadingUrls.includes(config.url)) { - - if (requestList.length < 10) { - requestList.unshift({ ...config, isLoading: true }); - } else { - requestList = [...requestList.slice(0, 9), { ...config, isLoading: true }]; - } - vuexStore.commit("changeIsLoading", true); - } - return config; - }, - error => Promise.reject(error + '请求错误') - ); - - instance.interceptors.response.use( - response => { - setLoadingToFalse(response); - return response.data; - }, - error => { - if (error.response.status == 301) { - vuexStore.commit("changeLoginModalVisible", true); - } - setLoadingToFalse(error); - return Promise.reject(error.response?.data); - } - ); - } - request(): AxiosInstance { - const instance = axios.create(this.getInitConfig()); - this.interceptors(instance); - return instance; - } -} -const http = new HttpRequest(); -export default http.request(); diff --git a/src/views/about/About.vue b/src/views/about/About.vue deleted file mode 100644 index e6b2e85..0000000 --- a/src/views/about/About.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/home/Home.vue b/src/views/home/Home.vue deleted file mode 100644 index f80d468..0000000 --- a/src/views/home/Home.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/home/Search.vue b/src/views/home/Search.vue deleted file mode 100644 index e082ef4..0000000 --- a/src/views/home/Search.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - \ No newline at end of file