重构后端服务架构并优化前端错误处理
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
@@ -3,6 +3,7 @@ import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
// @ts-ignore
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
|
||||
import App from './App.vue'
|
||||
|
||||
@@ -113,7 +113,7 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
// 路由守卫
|
||||
router.beforeEach((to, from, next) => {
|
||||
router.beforeEach((to, _from, next) => {
|
||||
const userStore = useUserStore()
|
||||
|
||||
// 设置页面标题
|
||||
|
||||
@@ -158,7 +158,7 @@ const orderStatusChart = ref<HTMLElement>()
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string) => {
|
||||
const statusMap: Record<string, string> = {
|
||||
const statusMap: Record<string, any> = {
|
||||
pending: 'warning',
|
||||
confirmed: 'info',
|
||||
shipping: 'primary',
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import type { User, UserListParams, UserCreateForm, UserUpdateForm } from '@/types/user'
|
||||
import type { User, UserListParams, UserCreateForm } from '@/types/user'
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false)
|
||||
@@ -417,7 +417,7 @@ const resetForm = () => {
|
||||
|
||||
// 获取角色类型
|
||||
const getRoleType = (role: string) => {
|
||||
const roleMap: Record<string, string> = {
|
||||
const roleMap: Record<string, any> = {
|
||||
admin: 'danger',
|
||||
buyer: 'primary',
|
||||
trader: 'success',
|
||||
@@ -441,7 +441,7 @@ const getRoleText = (role: string) => {
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string) => {
|
||||
const statusMap: Record<string, string> = {
|
||||
const statusMap: Record<string, any> = {
|
||||
active: 'success',
|
||||
inactive: 'warning',
|
||||
banned: 'danger'
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"sourceMap": true,
|
||||
"removeComments": true,
|
||||
|
||||
Reference in New Issue
Block a user