feat: mock动态开关
This commit is contained in:
@@ -8,8 +8,8 @@ export interface ToolsReqData {
|
||||
//tools
|
||||
export interface ToolsInfo {
|
||||
id: number,
|
||||
value: string,
|
||||
img: string,
|
||||
title: string,
|
||||
logo: string,
|
||||
desc: string,
|
||||
url: string,
|
||||
cate: string
|
||||
@@ -18,7 +18,7 @@ export interface ToolsInfo {
|
||||
//tools cate
|
||||
export interface ToolCate {
|
||||
id: number,
|
||||
value: string,
|
||||
title: string,
|
||||
img: string,
|
||||
desc: string,
|
||||
url: string,
|
||||
|
||||
@@ -30,10 +30,10 @@ onMounted(() => {
|
||||
<div class="mr-3 flex justify-between flex-wrap self-card-div" :gutter="10">
|
||||
<router-link v-for="(item, index) in toolsStore.list" :key="index" :to="item.url" class="flex flex-col mt-3 border-solid rounded border-gray border w-[32.5%] p-2 bg-gray-50 hover:shadow-md">
|
||||
<div class="flex items-center border-b pb-2">
|
||||
<el-image :src="item.img" class="w-10 h-10 min-h-[2.5rem] min-w-[2.5rem] rounded-full"></el-image>
|
||||
<el-image :src="item.logo" class="w-10 h-10 min-h-[2.5rem] min-w-[2.5rem] rounded-full"></el-image>
|
||||
<div class="flex flex-col ml-2 w-full">
|
||||
<div class="flex">
|
||||
<div class="font-semibold text-lg ">{{ item.value }}</div>
|
||||
<div class="font-semibold text-lg ">{{ item.title }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<el-text size="small">{{ item.cate }}</el-text>
|
||||
|
||||
@@ -84,12 +84,19 @@ onMounted(() => {
|
||||
<!-- cates -->
|
||||
<div class="mr-3">
|
||||
<ul class="flex bg-gray-100 h-10 rounded leading-10 pl-3">
|
||||
<li class="flex items-center mr-3">
|
||||
<el-text></el-text>
|
||||
<div
|
||||
class="hover:text-blue-400 hover:underline hover:decoration-2 hover:underline-offset-[6px] text-sm" :class="searchParam.cateId == 0 ? 'text-blue-400 underline decoration-2 underline-offset-[6px]' : ''"
|
||||
@click="chooseCate(0)"
|
||||
>全部工具</div>
|
||||
</li>
|
||||
<li v-for="(item, index) in toolsStore.cates" :key="index" class="flex items-center">
|
||||
<el-text>{{ index != 0 ? ' ' : '' }} </el-text>
|
||||
<div
|
||||
class="hover:text-blue-400 hover:underline hover:decoration-2 hover:underline-offset-[6px] text-sm" :class="searchParam.cateId == item.id ? 'text-blue-400 underline decoration-2 underline-offset-[6px]' : ''"
|
||||
@click="chooseCate(item.id)"
|
||||
>{{ item.value }}</div>
|
||||
>{{ item.title }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,8 @@ import axios from "axios";
|
||||
import { ElMessage } from "element-plus";
|
||||
//创建axios实例
|
||||
let request = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
//判断mock是否启用
|
||||
baseURL: import.meta.env.VITE_IS_MOCK == 'true' ? import.meta.env.VITE_APP_BASE_API : import.meta.env.VITE_SERVE + import.meta.env.VITE_APP_BASE_API,
|
||||
timeout: 5000
|
||||
})
|
||||
//请求拦截器
|
||||
|
||||
Reference in New Issue
Block a user