Commit 0a26e3c7 by lei

1

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