Commit 0a26e3c7 by lei

1

parent 6027da9b
export default defineNuxtRouteMiddleware((context: any) => { export default defineNuxtRouteMiddleware((context: any) => {
const headers = useRequestHeaders(); const headers = useRequestHeaders();
let userAgent = process.server ? headers['user-agent'] : navigator.userAgent; let userAgent = process.server ? headers["user-agent"] : navigator.userAgent;
if (userAgent) { if (userAgent) {
if ( if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
...@@ -8,11 +8,11 @@ export default defineNuxtRouteMiddleware((context: any) => { ...@@ -8,11 +8,11 @@ export default defineNuxtRouteMiddleware((context: any) => {
) )
) { ) {
if (process.server) { if (process.server) {
navigateTo('http://m.dexfilter.com', { navigateTo("http://m.dexfilter.com", {
external: true, external: true,
}); });
} else { } else {
window.location.href = 'http://m.dexfilter.com'; window.location.href = "http://m.dexfilter.com";
} }
} }
} }
......
...@@ -6,6 +6,28 @@ let loginApi = "http://156.247.9.93:8001/"; ...@@ -6,6 +6,28 @@ let loginApi = "http://156.247.9.93:8001/";
export default defineNuxtConfig({ export default defineNuxtConfig({
// plugins: [], // plugins: [],
modules: ["nuxt-svgo", "@nuxtjs-alt/proxy"], modules: ["nuxt-svgo", "@nuxtjs-alt/proxy"],
builder: "vite",
sourcemap: false,
// app: {},
// nitro: {
// storage: {
// redis: {
// driver: "redis",
// url: "redis://localhost:6379",
// },
// },
// routeRules: {
// "/blog/**": {
// swr: 60 * 60,
// cache: {
// base: "redis",
// getKey() {
// return "dexfilter_2023_3_22_14_15";
// },
// },
// },
// },
// },
proxy: { proxy: {
enableProxy: true, enableProxy: true,
proxies: { proxies: {
...@@ -35,9 +57,6 @@ export default defineNuxtConfig({ ...@@ -35,9 +57,6 @@ export default defineNuxtConfig({
experimental: { experimental: {
writeEarlyHints: false, writeEarlyHints: false,
}, },
// env: {
// NODE_ENV: process.env.NODE_ENV,
// },
vite: { vite: {
plugins: [viteCompression()], plugins: [viteCompression()],
envDir: "~/env", envDir: "~/env",
...@@ -59,9 +78,14 @@ export default defineNuxtConfig({ ...@@ -59,9 +78,14 @@ export default defineNuxtConfig({
}, },
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: { manualChunks(id, { getModuleInfo }) {
// TdesignVueNext: ['tdesign-vue-next'], // 折线图
CustomEcharts: ["echarts"], if (id.includes("echarts")) {
return "CustomEcharts";
} else if (id.includes("ethers")) {
return "ethers";
}
// 合并小文件
}, },
}, },
}, },
...@@ -71,14 +95,12 @@ export default defineNuxtConfig({ ...@@ -71,14 +95,12 @@ export default defineNuxtConfig({
}, },
}, },
build: { build: {
// extractCSS: true,
// vendor-已被弃用
// 第三方插件转es5 // 第三方插件转es5
transpile: transpile:
process.env.NODE_ENV === "production" process.env.NODE_ENV === "production"
? ["tdesign-vue-next", "echarts", "vue-i18n"] ? ["tdesign-vue-next", "echarts", "vue-i18n"]
: ["echarts"], : ["echarts"],
// cssSourceMap: true, // 可视化捆绑包分析--目前无效
// analyze: true, // analyze: true,
}, },
css: ["@/style/font-family.css"], css: ["@/style/font-family.css"],
......
...@@ -14,14 +14,11 @@ import { ...@@ -14,14 +14,11 @@ import {
Select as TSelect, Select as TSelect,
Popup as TPopup, Popup as TPopup,
Dialog as TDialog, Dialog as TDialog,
Form as TForm,
FormItem as TFormItem,
Option as TOption, Option as TOption,
Switch as TSwitch, Switch as TSwitch,
RadioGroup as TRadioGroup, RadioGroup as TRadioGroup,
RadioButton as TRadioButton, RadioButton as TRadioButton,
InputNumber as TInputNumber, InputNumber as TInputNumber,
TimePicker as TTimePicker,
Row as TRow, Row as TRow,
Col as TCol, Col as TCol,
Checkbox as TCheckbox, Checkbox as TCheckbox,
...@@ -44,14 +41,11 @@ const components = [ ...@@ -44,14 +41,11 @@ const components = [
TSelect, TSelect,
TPopup, TPopup,
TDialog, TDialog,
TForm,
TFormItem,
TOption, TOption,
TSwitch, TSwitch,
TRadioGroup, TRadioGroup,
TRadioButton, TRadioButton,
TInputNumber, TInputNumber,
TTimePicker,
TRow, TRow,
TCol, TCol,
TCheckbox, TCheckbox,
......
...@@ -58,7 +58,10 @@ ...@@ -58,7 +58,10 @@
import { MessagePlugin } from "tdesign-vue-next"; import { MessagePlugin } from "tdesign-vue-next";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import Timefilter from "/public/images/svg/analysis/timefilter.svg"; import Timefilter from "/public/images/svg/analysis/timefilter.svg";
import { DatePicker as TDatePicker } from "tdesign-vue-next"; import {
DatePicker as TDatePicker,
TimePicker as TTimePicker,
} from "tdesign-vue-next";
const route = useRoute(); const route = useRoute();
const emit = defineEmits(["change"]); const emit = defineEmits(["change"]);
const { t } = useI18n(); const { t } = useI18n();
......
...@@ -72,7 +72,11 @@ ...@@ -72,7 +72,11 @@
import { LoadingPlugin, MessagePlugin } from "tdesign-vue-next"; import { LoadingPlugin, MessagePlugin } from "tdesign-vue-next";
import md5 from "md5"; import md5 from "md5";
import request from "@/utils/request"; import request from "@/utils/request";
import { Icon as TIcon } from "tdesign-vue-next"; import {
Icon as TIcon,
Form as TForm,
FormItem as TFormItem,
} from "tdesign-vue-next";
const emit = defineEmits(["registerSuccess", "go"]); const emit = defineEmits(["registerSuccess", "go"]);
// 用户token // 用户token
......
...@@ -125,7 +125,11 @@ import { MessagePlugin, LoadingPlugin } from "tdesign-vue-next"; ...@@ -125,7 +125,11 @@ import { MessagePlugin, LoadingPlugin } from "tdesign-vue-next";
import request from "@/utils/request"; import request from "@/utils/request";
import md5 from "md5"; import md5 from "md5";
import { useCounter } from "@/hooks"; import { useCounter } from "@/hooks";
import { Icon as TIcon } from "tdesign-vue-next"; import {
Icon as TIcon,
Form as TForm,
FormItem as TFormItem,
} from "tdesign-vue-next";
const [countDown, handleCounter] = useCounter(); const [countDown, handleCounter] = useCounter();
const props = defineProps({ const props = defineProps({
......
...@@ -110,7 +110,11 @@ import { ArrowLeftIcon } from "tdesign-icons-vue-next"; ...@@ -110,7 +110,11 @@ import { ArrowLeftIcon } from "tdesign-icons-vue-next";
import request from "@/utils/request"; import request from "@/utils/request";
import md5 from "md5"; import md5 from "md5";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { Icon as TIcon } from "tdesign-vue-next"; import {
Icon as TIcon,
Form as TForm,
FormItem as TFormItem,
} from "tdesign-vue-next";
const { t } = useI18n(); const { t } = useI18n();
const INITIAL_DATA = { const INITIAL_DATA = {
......
...@@ -124,11 +124,17 @@ import { useI18n } from "vue-i18n"; ...@@ -124,11 +124,17 @@ import { useI18n } from "vue-i18n";
import RightDetailHeader from "./rightDetailHeader.vue"; import RightDetailHeader from "./rightDetailHeader.vue";
import SubmitSocialInfo from "./SubmitSocialInfo.vue"; import SubmitSocialInfo from "./SubmitSocialInfo.vue";
import Collection from "./Collection.vue"; import Collection from "./Collection.vue";
let DetailsEcharts: any = null;
// 异步组件 // 异步组件
const DetailsEcharts = defineAsyncComponent( // const DetailsEcharts = defineAsyncComponent(
() => import("../analysis/detailsEcharts.vue") // () => import("../analysis/detailsEcharts.vue")
); // );
onMounted(() => {
console.log("导入");
console.log(DetailsEcharts);
// 加载完成后导入echarts
DetailsEcharts = () => import("../analysis/detailsEcharts.vue");
});
const router = useRouter(); const router = useRouter();
const { t, locale } = useI18n(); const { t, locale } = useI18n();
// 通知表格收藏图表取消收藏 // 通知表格收藏图表取消收藏
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
> >
<template #header> <template #header>
<div class="header-box"> <div class="header-box">
<span>{{ $t('Customized.SmartAlerts') }}</span> <span>{{ $t("Customized.SmartAlerts") }}</span>
<div class="icon" @click="closeDialog"> <div class="icon" @click="closeDialog">
<closeSvg></closeSvg> <closeSvg></closeSvg>
</div> </div>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="body-header" v-if="closeHeader"> <div class="body-header" v-if="closeHeader">
定制开发:智能警报可根据用户的需求进行定制开发,详情请 定制开发:智能警报可根据用户的需求进行定制开发,详情请
<span @click="JoinUs(tgUrl)">{{ <span @click="JoinUs(tgUrl)">{{
$t('Customized.Contact') $t("Customized.Contact")
}}</span> }}</span>
了解。 了解。
<div class="icon" @click="closeHeader = false"> <div class="icon" @click="closeHeader = false">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<template #icon> <template #icon>
<ResetSvg class="icon"></ResetSvg> <ResetSvg class="icon"></ResetSvg>
</template> </template>
{{ $t('Customized.reset') }}</t-button {{ $t("Customized.reset") }}</t-button
> >
</div> </div>
<t-form <t-form
...@@ -203,12 +203,12 @@ ...@@ -203,12 +203,12 @@
<t-button <t-button
@click="JoinUs(tgUrl)" @click="JoinUs(tgUrl)"
class="custom_button_back_border" class="custom_button_back_border"
>{{ $t('Customized.submit') }}</t-button >{{ $t("Customized.submit") }}</t-button
> >
</div> </div>
<div class="Contact-we" @click="JoinUs(tgUrl)"> <div class="Contact-we" @click="JoinUs(tgUrl)">
<CustomerSvg></CustomerSvg> <CustomerSvg></CustomerSvg>
<span>{{ $t('Customized.Contact') }}</span> <span>{{ $t("Customized.Contact") }}</span>
</div> </div>
</div> </div>
</template> </template>
...@@ -218,26 +218,27 @@ ...@@ -218,26 +218,27 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import closeSvg from '/public/images/svg/filter/close.svg'; import closeSvg from "/public/images/svg/filter/close.svg";
import close2Svg from '/public/images/svg/filter/close2.svg'; import close2Svg from "/public/images/svg/filter/close2.svg";
import ResetSvg from '/public/images/svg/filter/reset.svg'; import ResetSvg from "/public/images/svg/filter/reset.svg";
import DingSvg from '/public/images/svg/filter/ding.svg'; import DingSvg from "/public/images/svg/filter/ding.svg";
import TGSvg from '/public/images/svg/filter/tg.svg'; import TGSvg from "/public/images/svg/filter/tg.svg";
import discordSvg from '/public/images/svg/filter/discord.svg'; import discordSvg from "/public/images/svg/filter/discord.svg";
import emailSvg from '/public/images/svg/filter/email.svg'; import emailSvg from "/public/images/svg/filter/email.svg";
import phoneSvg from '/public/images/svg/filter/phone.svg'; import phoneSvg from "/public/images/svg/filter/phone.svg";
import CustomerSvg from '/public/images/svg/filter/Customer.svg'; import CustomerSvg from "/public/images/svg/filter/Customer.svg";
import { Form as TForm, FormItem as TFormItem } from "tdesign-vue-next";
import { import {
TIME_RANGE_OPTIONS, TIME_RANGE_OPTIONS,
PRICE_RANGE_OPTIONS, PRICE_RANGE_OPTIONS,
VOLUME_OPTIONS, VOLUME_OPTIONS,
} from '@/constants/token'; } from "@/constants/token";
import { import {
chain_options, chain_options,
filterChainObj, filterChainObj,
} from '@/constants/UnifiedManagementChain'; } from "@/constants/UnifiedManagementChain";
import QuestionMarkSvg from '/public/images/svg/filter/QuestionMark.svg'; import QuestionMarkSvg from "/public/images/svg/filter/QuestionMark.svg";
import { tgUrl } from '@/utils/open'; import { tgUrl } from "@/utils/open";
const props = defineProps({ const props = defineProps({
visible: Boolean, visible: Boolean,
}); });
...@@ -246,42 +247,42 @@ const chain = useChain(); ...@@ -246,42 +247,42 @@ const chain = useChain();
const formData = reactive({ const formData = reactive({
chain: chain.value, chain: chain.value,
chain2: chain.value, chain2: chain.value,
time: '', time: "",
range: '5-20', range: "5-20",
isRise: true, isRise: true,
mode: '', mode: "",
Account: '', Account: "",
volume: '', volume: "",
}); });
const JoinUs = (url: string) => { const JoinUs = (url: string) => {
window.open(url); window.open(url);
}; };
const closeHeader = ref(true); const closeHeader = ref(true);
let CurChain = filterChainObj('value', chain.value, true); let CurChain = filterChainObj("value", chain.value, true);
const curSelectImg = ref(CurChain.index); const curSelectImg = ref(CurChain.index);
const curSelectImg2 = ref(CurChain.index); const curSelectImg2 = ref(CurChain.index);
// select改变同时改变图片 // select改变同时改变图片
const selectChange = (v: string) => { const selectChange = (v: string) => {
let curList = filterChainObj('value', v, true); let curList = filterChainObj("value", v, true);
// 切换图片 // 切换图片
curSelectImg.value = curList.index; curSelectImg.value = curList.index;
// 切换filter数据 // 切换filter数据
formData.chain = curList.value; formData.chain = curList.value;
}; };
const selectChange2 = (v: string) => { const selectChange2 = (v: string) => {
let curList = filterChainObj('value', v, true); let curList = filterChainObj("value", v, true);
curSelectImg2.value = curList.index; curSelectImg2.value = curList.index;
// 切换filter数据 // 切换filter数据
formData.chain2 = curList.value; formData.chain2 = curList.value;
}; };
const emit = defineEmits(['close']); const emit = defineEmits(["close"]);
const closeDialog = () => { const closeDialog = () => {
emit('close', false); emit("close", false);
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/flex.less'; @import "@/style/flex.less";
.select_time_box { .select_time_box {
.t-popup__content { .t-popup__content {
.dja(); .dja();
...@@ -305,8 +306,8 @@ const closeDialog = () => { ...@@ -305,8 +306,8 @@ const closeDialog = () => {
} }
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/flex.less'; @import "@/style/flex.less";
@import '@/style/variables.less'; @import "@/style/variables.less";
:deep(.t-dialog) { :deep(.t-dialog) {
padding: 0; padding: 0;
border-radius: 4px; border-radius: 4px;
......
...@@ -97,7 +97,10 @@ ...@@ -97,7 +97,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { MessagePlugin } from "tdesign-vue-next"; import { MessagePlugin } from "tdesign-vue-next";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { DatePicker as TDatePicker } from "tdesign-vue-next"; import {
DatePicker as TDatePicker,
TimePicker as TTimePicker,
} from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
visible: Boolean, visible: Boolean,
option: Object as any, option: Object as any,
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<div class="change-pass-box"> <div class="change-pass-box">
<div @click="backCenter" class="back"> <div @click="backCenter" class="back">
<span class="span-back"> <span class="span-back">
<ChevronLeftIcon />{{ $t('login.backBtn') }} <ChevronLeftIcon />{{ $t("login.backBtn") }}
</span> </span>
</div> </div>
<span class="span-title">{{ $t('login.ChangeYourPassword') }}</span> <span class="span-title">{{ $t("login.ChangeYourPassword") }}</span>
<t-form <t-form
@submit="onSubmit" @submit="onSubmit"
:rules="FORM_RULES" :rules="FORM_RULES"
...@@ -45,38 +45,42 @@ ...@@ -45,38 +45,42 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ChevronLeftIcon } from 'tdesign-icons-vue-next'; import { ChevronLeftIcon } from "tdesign-icons-vue-next";
import request from '@/utils/request'; import request from "@/utils/request";
import { MessagePlugin } from 'tdesign-vue-next'; import {
import md5 from 'md5'; MessagePlugin,
Form as TForm,
FormItem as TFormItem,
} from "tdesign-vue-next";
import md5 from "md5";
const emit = defineEmits(['backPersonal']); const emit = defineEmits(["backPersonal"]);
// 用户token // 用户token
const userToken = useUserToken(); const userToken = useUserToken();
// //
const formData = reactive({ const formData = reactive({
old_password: '', old_password: "",
password: '', password: "",
password_confirmation: '', password_confirmation: "",
}); });
const backCenter = () => { const backCenter = () => {
emit('backPersonal', true); emit("backPersonal", true);
}; };
// 数据校验 // 数据校验
const repasswordValidator = (value) => { const repasswordValidator = (value) => {
if (formData.password === value) { if (formData.password === value) {
return { result: true }; return { result: true };
} else { } else {
return { result: false, message: '两次密码输入不一致', type: 'error' }; return { result: false, message: "两次密码输入不一致", type: "error" };
} }
}; };
const FORM_RULES = { const FORM_RULES = {
password: [ password: [
{ required: true, message: '密码必填', type: 'error' }, { required: true, message: "密码必填", type: "error" },
{ min: 6, message: '至少需要6位', type: 'error' }, { min: 6, message: "至少需要6位", type: "error" },
], ],
password_confirmation: [ password_confirmation: [
{ required: true, message: '确认密码必填', type: 'error' }, { required: true, message: "确认密码必填", type: "error" },
{ validator: repasswordValidator }, { validator: repasswordValidator },
], ],
}; };
...@@ -84,7 +88,7 @@ const FORM_RULES = { ...@@ -84,7 +88,7 @@ const FORM_RULES = {
const onSubmit = async ({ validateResult }) => { const onSubmit = async ({ validateResult }) => {
if (validateResult === true) { if (validateResult === true) {
const res: any = await request.post( const res: any = await request.post(
'/api/user/edit/password', "/api/user/edit/password",
{ {
old_password: md5(formData.old_password), old_password: md5(formData.old_password),
password: md5(formData.password), password: md5(formData.password),
...@@ -97,8 +101,8 @@ const onSubmit = async ({ validateResult }) => { ...@@ -97,8 +101,8 @@ const onSubmit = async ({ validateResult }) => {
} }
); );
if (res.code === 200) { if (res.code === 200) {
MessagePlugin.success('修改成功'); MessagePlugin.success("修改成功");
emit('backPersonal', true); emit("backPersonal", true);
} else { } else {
MessagePlugin.warning(res.msg); MessagePlugin.warning(res.msg);
} }
...@@ -107,7 +111,7 @@ const onSubmit = async ({ validateResult }) => { ...@@ -107,7 +111,7 @@ const onSubmit = async ({ validateResult }) => {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/variables.less'; @import "@/style/variables.less";
.change-pass-box { .change-pass-box {
padding: 30px 0 0 50px; padding: 30px 0 0 50px;
height: calc(100vh - 288px); height: calc(100vh - 288px);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment