fix/non-blocking-route-navigation
qinzhenpen 2 years ago
parent 73b97c4295
commit 620a561f7d

@ -5,4 +5,4 @@ VITE_APP_TITLE = 数字营销实训系统
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
VITE_APP_BASE_API = 'http://118.31.7.2:9868' VITE_APP_BASE_API = 'http://120.79.54.255:9868'

@ -1,3 +1,11 @@
###
# @Author: qinzhenpen qzp1807@126.com
# @Date: 2024-08-27 10:39:50
# @LastEditors: qinzhenpen qzp1807@126.com
# @LastEditTime: 2024-08-28 17:15:51
# @FilePath: \digital-marketing\.env.production
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 页面标题 # 页面标题
VITE_APP_TITLE = 数字营销实训系统 VITE_APP_TITLE = 数字营销实训系统
@ -5,7 +13,7 @@ VITE_APP_TITLE = 数字营销实训系统
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
VITE_APP_BASE_API = 'http://118.31.7.2:9868' VITE_APP_BASE_API = 'http://120.79.54.255:9868'
# 是否在打包时开启压缩,支持 gzip 和 brotli # 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip VITE_BUILD_COMPRESS = gzip

Binary file not shown.

@ -1,3 +1,11 @@
<!--
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-28 14:21:24
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-29 08:57:36
* @FilePath: \digital-marketing\src\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<router-view /> <router-view />
</template> </template>
@ -5,11 +13,16 @@
<script setup> <script setup>
import useSettingsStore from "@/store/modules/settings"; import useSettingsStore from "@/store/modules/settings";
import { handleThemeStyle } from "@/utils/theme"; import { handleThemeStyle } from "@/utils/theme";
import cache from "@/plugins/cache";
import { removeUserInfo, removeToken } from "@/utils/auth.js";
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
// 初始化主题样式 // 初始化主题样式
handleThemeStyle(useSettingsStore().theme); handleThemeStyle(useSettingsStore().theme);
}); });
if (cache.session.getJSON("sessionObj") === undefined) {
removeToken();
removeUserInfo();
}
}); });
</script> </script>

@ -1,7 +1,16 @@
<!--
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-28 17:09:02
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-28 18:37:43
* @FilePath: \digital-marketing\src\components\video\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="el-Aitools"> <div class="el-Aitools">
<div class="video-title">{{ videlinfo.resourcesName }}</div> <div class="video-title">{{ videlinfo.resourcesName }}</div>
<video-player class="video-player" :options="playerOptions" :volume="0.6" @mounted="handleMounted" @ready="handleEvent($event)" @play="handleEvent($event)" @pause="handleEvent($event)" @ended="handleEvent($event)" @loadeddata="handleEvent($event)" @waiting="handleEvent($event)" @playing="handleEvent($event)" @canplay="handleEvent($event)" @canplaythrough="handleEvent($event)" @timeupdate="handleEvent(player?.currentTime())" /> <video-player v-if="playerOptions.sources[0].src" class="video-player" :options="playerOptions"
:volume="0.6" @mounted="handleMounted" @ready="handleEvent($event)" @play="handleEvent($event)" @pause="handleEvent($event)" @ended="handleEvent($event)" @loadeddata="handleEvent($event)" @waiting="handleEvent($event)" @playing="handleEvent($event)" @canplay="handleEvent($event)" @canplaythrough="handleEvent($event)" @timeupdate="handleEvent(player?.currentTime())" />
</div> </div>
</template> </template>
@ -11,11 +20,11 @@ import useAlgorithmStore from "@/store/modules/algorithm.js";
const algorithmStore = useAlgorithmStore(); const algorithmStore = useAlgorithmStore();
import { VideoPlayer } from "@videojs-player/vue"; import { VideoPlayer } from "@videojs-player/vue";
import "video.js/dist/video-js.css"; import "video.js/dist/video-js.css";
import { onMounted } from "vue"; import { nextTick, onMounted } from "vue";
const router = useRouter(); const router = useRouter();
const player = shallowRef(); const player = shallowRef();
const videlinfo = ref({}); const videlinfo = ref({});
const videoSrc = ref("https://szjj.sztzjy.com:99/uploadFile/2024/2/26/3ef371decafa4bcc84c181dea4a0797f.mp4"); const videoSrc = ref("");
const playerOptions = ref({ const playerOptions = ref({
playbackRates: [0.7, 1.0, 1.5, 2.0], playbackRates: [0.7, 1.0, 1.5, 2.0],
sources: [ sources: [
@ -24,7 +33,7 @@ const playerOptions = ref({
src: videoSrc.value, src: videoSrc.value,
}, },
], ],
height: 600, height: 750,
autoplay: "any", autoplay: "any",
muted: true, muted: true,
loop: false, loop: false,
@ -51,8 +60,12 @@ const handleEvent = (log) => {
// console.log("Basic player event", log); // console.log("Basic player event", log);
}; };
onMounted(() => { onMounted(() => {
videlinfo.value = cache.session.getJSON("video_history") videlinfo.value = cache.session.getJSON("video_history");
videlinfo.value.resourcesName = videlinfo.value.resourcesName.replace(/.mp4/g, "") videlinfo.value.resourcesName = videlinfo.value.resourcesName.replace(/.mp4/g, "");
videoSrc.value = `http://120.79.54.255:8042/file${videlinfo.value.resourcesUrl}`;
nextTick(() => {
playerOptions.value.sources[0].src = videoSrc.value;
});
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -61,7 +74,7 @@ onMounted(() => {
// padding: 20px 20px 0; // padding: 20px 20px 0;
min-height: 100vh; min-height: 100vh;
background: #020002; background: #020002;
.video-title{ .video-title {
color: #fff; color: #fff;
height: 50px; height: 50px;
padding: 10px; padding: 10px;
@ -77,6 +90,10 @@ onMounted(() => {
border: none; border: none;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
border-radius: 4px; border-radius: 4px;
transition: all 0.3s ease-in-out;
&:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
} }
} }
</style> </style>

@ -1,4 +1,3 @@
import axios from "axios"; import axios from "axios";
import { ElNotification, ElMessageBox, ElMessage, ElLoading } from "element-plus"; import { ElNotification, ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
@ -17,7 +16,7 @@ axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
// baseURL: import.meta.env.VITE_APP_BASE_API, // baseURL: import.meta.env.VITE_APP_BASE_API,
baseURL: "http://118.31.7.2:9868/", baseURL: "http://120.79.54.255:9868/",
// baseURL:'http://192.168.2.14:9868/', // baseURL:'http://192.168.2.14:9868/',
// 超时 // 超时
timeout: 100000, timeout: 100000,
@ -46,6 +45,10 @@ service.interceptors.request.use(
time: new Date().getTime(), time: new Date().getTime(),
}; };
const sessionObj = cache.session.getJSON("sessionObj"); const sessionObj = cache.session.getJSON("sessionObj");
if (sessionObj === undefined || sessionObj === null || sessionObj === "") {
cache.session.setJSON("sessionObj", requestObj);
} else {
}
} }
return config; return config;
}, },

@ -128,7 +128,7 @@ const sendText = async () => {
const messageId = Date.now(); const messageId = Date.now();
const newMessage = reactive({ id: messageId, type: "ai-main", displayContent: "" }); const newMessage = reactive({ id: messageId, type: "ai-main", displayContent: "" });
messages.push(newMessage); messages.push(newMessage);
const resp = await fetch("http://118.31.7.2:9868/api/bigModule/createArticleByAi", { const resp = await fetch("http://120.79.54.255:9868/api/bigModule/createArticleByAi", {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",

@ -213,7 +213,7 @@ const downloadArticle=()=>{
return proxy.$modal.msgWarning("请先完成上一步") return proxy.$modal.msgWarning("请先完成上一步")
} }
answerRecord.value=2 answerRecord.value=2
window.open(`http://118.31.7.2:9868/api/stu/experimental/downloadImg?userId=${JSON.parse(getUserInfo()).userId}&TOKEN=${getToken()}`) window.open(`http://120.79.54.255:9868/api/stu/experimental/downloadImg?userId=${JSON.parse(getUserInfo()).userId}&TOKEN=${getToken()}`)
} }
// 识别文字 // 识别文字

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> --> <!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">使用“购物车数据”,对所购商品进行购物篮分析(关联规则挖掘),其中min_support = 0.4, <p style="font-weight: 400; font-size: 15px; color: #e2e7ee !important">使用“购物车数据”,对所购商品进行购物篮分析(关联规则挖掘),其中min_support = 0.4,
min_confidence = 0.5,最后将运行结果提交实训任务。</p> min_confidence = 0.5,最后将运行结果提交实训任务。</p>
</div> </div>
<div class="main-but"> <div class="main-but">

@ -27,14 +27,16 @@
</div> </div>
</div> </div>
<div class="main-right"> <div class="main-right">
<el-table :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle"> <el-scrollbar height="740px" style="padding: 20px">
<el-table-column v-for="column in tableLabel" :key="column" :prop="column.prop" :label="column.label" align="center"> <el-table :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle">
<template #default="{ row }"> <el-table-column v-for="column in tableLabel" :key="column" :prop="column" :label="column" align="center">
{{ formatDate(row[column.prop]) ?? "..." }} <template #default="{ row }">
</template> {{ formatDate(row[column]) ?? "..." }}
</el-table-column> </template>
</el-table> </el-table-column>
<pagination v-show="datatotal > 0" :total="datatotal" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="getSurface" style="margin-top: 10px" /> </el-table>
<pagination v-show="datatotal > 0" :total="datatotal" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="getSurface" style="margin-top: 10px" />
</el-scrollbar>
</div> </div>
</div> </div>
</template> </template>
@ -46,14 +48,16 @@ import useUserStore from "@/store/modules/user";
import useAlgorithmStore from "@/store/modules/algorithm.js"; import useAlgorithmStore from "@/store/modules/algorithm.js";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
import { getUserInfo } from "@/utils/auth"; import { getUserInfo } from "@/utils/auth";
import { warn } from "vue";
const userInfo = JSON.parse(getUserInfo()); const userInfo = JSON.parse(getUserInfo());
const loading = ref(false); const loading = ref(false);
const fileData = ref(null); const fileData = ref(null);
const scrollbarHeight = ref(0);
const algorithmStore = useAlgorithmStore(); const algorithmStore = useAlgorithmStore();
// 数据表query // 数据表query
const n_dataTableQuery = ref({ const n_dataTableQuery = ref({
index: 1, index: 1,
size: 7, size: 15,
tableName: "", tableName: "",
userId: userInfo.userId, userId: userInfo.userId,
}); });
@ -62,42 +66,19 @@ const nzIndex = ref(0);
const nzData = ref([]); const nzData = ref([]);
const zjIndex = ref(-1); const zjIndex = ref(-1);
const zjData = ref([]); const zjData = ref([]);
const tableLabel = ref([ const tableLabel = ref([]);
{ prop: "id", label: "ID" },
{ prop: "age", label: "年龄" },
{ prop: "annualIncome", label: "年收入" },
{ prop: "spendingScore", label: "消费水平" },
]);
const tableLabel3 = ref([
{ prop: "id", label: "ID" },
{ prop: "content", label: "评论内容" },
{ prop: "creationTime", label: "评论时间" },
{ prop: "nickName", label: "昵称" },
{ prop: "referenceName", label: "评论对象" },
{ prop: "contentType", label: "评论类型" },
]);
const tableLabel4 = ref([
{ prop: "id", label: "ID" },
{ prop: "salesVolume", label: "销售量" },
{ prop: "salesForehead", label: "销售额" },
]);
const tableLabel5 = ref([
{ prop: "id", label: "ID" },
{ prop: "consumerGoods", label: "消费商品" },
]);
const tableLabel2 = ref([]); const tableLabel2 = ref([]);
const arrhander = ref([]); const arrhander = ref([]);
const arrhanderkey = ref([]); const arrhanderkey = ref([]);
const arrMap = { // const arrMap = {
客户细分数据表: tableLabel.value, // 客户细分数据表: tableLabel.value,
销售预测数据表: tableLabel4.value, // 销售预测数据表: tableLabel4.value,
购物车数据表: tableLabel5.value, // 购物车数据表: tableLabel5.value,
用户评论表: tableLabel3.value, // 用户评论表: tableLabel3.value,
}; // };
const goNZ = (index, item) => { const goNZ = (index, item) => {
nzIndex.value = index; nzIndex.value = index;
tableLabel.value = arrMap[item]; // tableLabel.value = arrMap[item];
n_dataTableQuery.value.tableName = item; n_dataTableQuery.value.tableName = item;
delete n_dataTableQuery.value.selfTableName; delete n_dataTableQuery.value.selfTableName;
getSurface(); getSurface();
@ -125,6 +106,7 @@ const getSurface = () => {
portraitModel portraitModel
.getUserTableData(n_dataTableQuery.value) .getUserTableData(n_dataTableQuery.value)
.then((res) => { .then((res) => {
tableLabel.value = Object.keys(res?.data?.list[0]);
tableData.value = res?.data?.list; tableData.value = res?.data?.list;
datatotal.value = res?.data?.total; datatotal.value = res?.data?.total;
tableLabel2.value = []; tableLabel2.value = [];
@ -137,7 +119,7 @@ const getSurface = () => {
label: item, label: item,
}); });
}); });
tableLabel.value = tableLabel2.value; tableLabel.value = arrhanderkey.value;
} }
setTimeout(() => { setTimeout(() => {
loading.value = false; loading.value = false;
@ -172,6 +154,7 @@ const importData = (e) => {
const selectZJ = (item) => { const selectZJ = (item) => {
portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => { portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => {
nzData.value = res.data.tableNames; nzData.value = res.data.tableNames;
console.log(tableLabel.value, " tableLabel.value");
n_dataTableQuery.value.tableName = nzData.value[0]; n_dataTableQuery.value.tableName = nzData.value[0];
getSurface(); getSurface();
algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable].filter((item) => item !== "用户评论表"); algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable].filter((item) => item !== "用户评论表");
@ -191,13 +174,12 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
// background-color: #f5f5f5;
margin: 20px 20px 0; margin: 20px 20px 0;
height: calc(100vh - 150px); height: calc(100vh - 150px);
display: flex; display: flex;
overflow: auto; // width: 100%;
.main-left { .main-left {
width: 205px; width: 12.3rem;
height: 100%; height: 100%;
background: #041c49; background: #041c49;
.left-top { .left-top {
@ -273,12 +255,9 @@ onMounted(() => {
} }
} }
.main-right { .main-right {
width: 1639px; width: calc(100% - 12.3rem);
height: 100%; height: 100%;
padding: 20px;
// background: #001D40;
border: 1px solid #0452c6; border: 1px solid #0452c6;
// opacity: 0.5;
} }
} }
:deep(.el-table__header) { :deep(.el-table__header) {
@ -294,4 +273,8 @@ onMounted(() => {
color: #e6e6e6; color: #e6e6e6;
} }
} }
:deep(.pagination-container .el-pagination) {
// 去除定位
position: static;
}
</style> </style>

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> --> <!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">使用“客户细分数据”,对客户进行聚类分析,并提交实训任务。</p> <p style="font-weight: 400; font-size: 15px; color: #e6e6e6">使用“客户细分数据”,对客户进行聚类分析,并提交实训任务。</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="algorithmicKnowledge()"> <el-button @click="algorithmicKnowledge()">

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> --> <!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">使用“销售预测数据”,建立回归模型,并预测销量是84610下的销售额,最后提交实训任务。</p> <p style="font-weight: 400; font-size: 15px; color: #e6e6e6">使用“销售预测数据”,建立回归模型,并预测销量是84610下的销售额,最后提交实训任务。</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="runResultShow = true"> <el-button @click="runResultShow = true">

@ -476,7 +476,7 @@ const uploadReport = async (id) => {
if (!id) { if (!id) {
return; return;
} }
window.open(`http://118.31.7.2:9868/api/stu/concept/block/download?TOKEN=${"Bearer " + getToken()}&id=${id}`); window.open(`http://120.79.54.255:9868/api/stu/concept/block/download?TOKEN=${"Bearer " + getToken()}&id=${id}`);
// window.open(`http://202.97.179.126:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`) // window.open(`http://202.97.179.126:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`)
// window.open(`http://202.199.90.115:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`) // window.open(`http://202.199.90.115:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`)
}; };

@ -3,15 +3,15 @@
<el-scrollbar :height="height + 'px'" always style="padding-right: 15px"> <el-scrollbar :height="height + 'px'" always style="padding-right: 15px">
<div class="main"> <div class="main">
<el-row :gutter="40"> <el-row :gutter="40">
<el-col :span="3" v-for="i in item" :key="i"> <el-col :span="3" v-for="i in item" :key="i" @click="showResource(i)">
<div class="zs"> <div class="zs">
<div class="el_top"> <div class="el_top">
<a target="_blank" @click="showResource(i.resourcesUrl)"> <a target="_blank">
<span>{{ i.resourcesName }}</span> <span>{{ i.resourcesName }}</span>
</a> </a>
</div> </div>
<div class="el_bon"> <div class="el_bon">
<a target="_blank" @click="showResource(i)"> <a target="_blank">
<img data-src="https://jrdsj.sztzjy.com:598/assets/%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%BA%90-1.a6a80357.png" :src="getImg(i.resourcesImg)" /> <img data-src="https://jrdsj.sztzjy.com:598/assets/%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%BA%90-1.a6a80357.png" :src="getImg(i.resourcesImg)" />
</a> </a>
</div> </div>
@ -51,8 +51,10 @@ onMounted(() => {
}); });
const showResource = async (i) => { const showResource = async (i) => {
window.open("/video", "_blank"); await cache.session.set("video_history", JSON.stringify(i));
cache.session.set('video_history',JSON.stringify(i)) setTimeout(() => {
window.open("/video", "_blank");
}, 300);
// const newWindow=window.open(`http://192.168.2.4:8800/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`) // const newWindow=window.open(`http://192.168.2.4:8800/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
// window.open(`http://qkljr.sztzjy.com:90/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`) // window.open(`http://qkljr.sztzjy.com:90/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
// if (i.includes("mp4")) { // if (i.includes("mp4")) {

@ -1,5 +1,5 @@
<template> <template>
<div class="login" v-loading="loading"> <div class="login" v-loading="loadpage">
<div class="login-main"> <div class="login-main">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">数字营销</h3> <h3 class="title">数字营销</h3>
@ -47,32 +47,34 @@ const loginForm = ref({
username: "", username: "",
password: "", password: "",
rememberMe: false, rememberMe: false,
code: "", TOKEN: "",
uuid: "",
}); });
const loginRules = { const loginRules = {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }], username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }], password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }], code: [{ required: true, trigger: "change", message: "请输入验证码" }],
}; };
const codeUrl = ref("");
const loading = ref(false); const loading = ref(false);
const loadpage = ref(false);
// 验证码开关 // 验证码开关
const captchaEnabled = ref(true); const captchaEnabled = ref(true);
// 注册开关 // 注册开关
const register = ref(false); const register = ref(false);
const redirect = ref(undefined); const redirect = ref(undefined);
watch( watch(
route, route,
(newRoute) => { (newRoute) => {
redirect.value = newRoute.query && newRoute.query.redirect; if (newRoute.query.token) {
loadpage.value = true;
setTimeout(() => {
loginForm.value.TOKEN = newRoute.query.token;
return handleLogin();
}, 1000);
}
}, },
{ immediate: true } { immediate: true }
); );
function handleLogin() { function handleLogin() {
// proxy.$refs.loginRef.validate(valid => { // proxy.$refs.loginRef.validate(valid => {
// if (valid) { // if (valid) {
@ -100,29 +102,19 @@ function handleLogin() {
router.push({ path: redirect.value || "/index" }); router.push({ path: redirect.value || "/index" });
if (params.token) { if (params.token) {
setTimeout(() => { setTimeout(() => {
loadpage.value = false;
loading.value = false; loading.value = false;
}, 3000); }, 3000);
} else { } else {
loadpage.value = false;
loading.value = false; loading.value = false;
} }
}) })
.catch(() => { .catch(() => {
loadpage.value = false;
loading.value = false; loading.value = false;
}); });
// }
// });
} }
// function getCode() {
// getCodeImg().then(res => {
// captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
// if (captchaEnabled.value) {
// codeUrl.value = "data:image/gif;base64," + res.img;
// loginForm.value.uuid = res.uuid;
// }
// });
// }
function getCookie() { function getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");
@ -133,7 +125,6 @@ function getCookie() {
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe), rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; };
} }
// getCode(); // getCode();
getCookie(); getCookie();
</script> </script>

@ -2,7 +2,7 @@
* @Author: qinzhenpen qzp1807@126.com * @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-16 09:16:26 * @Date: 2024-08-16 09:16:26
* @LastEditors: qinzhenpen qzp1807@126.com * @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-27 10:15:10 * @LastEditTime: 2024-08-28 17:51:46
* @FilePath: \vue3\src\views\visual-analysis\index.vue * @FilePath: \vue3\src\views\visual-analysis\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->

Loading…
Cancel
Save