diff --git a/dist.rar b/dist.rar deleted file mode 100644 index fc33774..0000000 Binary files a/dist.rar and /dev/null differ diff --git a/src/components/EChartsComponent.vue b/src/components/EChartsComponent.vue index bbb09c0..e6e6eb1 100644 --- a/src/components/EChartsComponent.vue +++ b/src/components/EChartsComponent.vue @@ -38,6 +38,8 @@ export default { this.inputTime = this.time this.getTkhostdetail(); + console.log(this.time) + console.log(this.getPrevious7Days(this.inputTime)) }, diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index e7ff715..30f9b77 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -45,6 +45,8 @@ import { ref, reactive, onMounted } from 'vue'; import { getUser } from '@/utils/storage' import { defineEmits } from 'vue'; + + const userInfo = ref(getUser()) let activeIndex = ref(userInfo.value.userType == 3 ? 1 : 2); diff --git a/src/utils/axios.js b/src/utils/axios.js index e5ecf4c..3100a5a 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -6,6 +6,9 @@ import axios from 'axios' import { getToken, getUser } from '@/utils/storage' import { useRouter } from 'vue-router'; import { ElMessage } from 'element-plus'; +import { usePythonBridge, } from '@/utils/pythonBridge' + +const { stopScript } = usePythonBridge(); const router = useRouter(); @@ -13,8 +16,9 @@ const router = useRouter(); let baseURL = '' if (process.env.NODE_ENV === 'development') { // 生产环境 - baseURL = "http://api.tkpage.vvtiktok.cn" - // baseURL = "http://192.168.0.116:8085/" + // baseURL = "http://api.tkpage.vvtiktok.cn" + baseURL = "http://120.26.251.180:8085/" + // baseURL = "http://192.168.0.113:8085/" } else { // 开发环境 baseURL = "http://api.tkpage.vvtiktok.cn" @@ -90,7 +94,10 @@ export function postAxios({ url, data }) { reject('网络连接错误') } else { - ElMessage.error(err.message); + if (err.response.data.message) { + ElMessage.error(err.response.data.message); + } + reject(err.message) } @@ -146,6 +153,7 @@ function cheekalive() { if (res.data) { } else { + stopScript(); alert("账号在其他地方登录!") window.location.href = '/'; } diff --git a/src/utils/pythonBridge.js b/src/utils/pythonBridge.js index b92164f..33ef1ee 100644 --- a/src/utils/pythonBridge.js +++ b/src/utils/pythonBridge.js @@ -99,8 +99,23 @@ export function usePythonBridge() { } }; + const stopScript = () => { + if (bridge.value) { + bridge.value.stopScript(); + } + }; + //获取版本号 + const getVersion = () => { + return new Promise((resolve, reject) => { + if (bridge.value) { + bridge.value.currentVersion(function (result) { + resolve(result); + }); + } + }); + }; // 在组件挂载时初始化桥接 onMounted(initBridge); @@ -112,6 +127,8 @@ export function usePythonBridge() { givePyAnchorId, backStageloginStatus, backStageloginStatusCopy, - exportToExcel + exportToExcel, + stopScript, + getVersion }; } \ No newline at end of file diff --git a/src/utils/storage.js b/src/utils/storage.js index 6dc01f9..cc1182a 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -42,4 +42,13 @@ export function setTkUser(userdata) { // 用于获取tk账户密码 export function getTkUser() { return JSON.parse(localStorage.getItem('tkuser')); +} + +// 用于列表筛选条件 +export function setSerch(data) { + localStorage.setItem('Serch', JSON.stringify(data)); +} +// 用于获取列表筛选条件 +export function getSerch() { + return JSON.parse(localStorage.getItem('Serch')); } \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index c96e19f..1fe0c2b 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -53,12 +53,16 @@
登录 +
+
版本号:{{ version }}
+ + @@ -69,6 +73,20 @@ import { useRouter } from 'vue-router'; import { login } from '@/api/account'; import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage'; import { ElLoading } from 'element-plus'; +import { usePythonBridge } from '@/utils/pythonBridge' + + +const { getVersion } = usePythonBridge(); +let version = ref('0.0.0'); +onMounted(() => { + setTimeout(() => { + getVersion().then((res) => { + version.value = res; + }) + }, 500); + +}) + const router = useRouter(); @@ -78,6 +96,7 @@ const formData = ref({ }); + const onSubmit = () => { const loading = ElLoading.service({ lock: true, @@ -88,6 +107,7 @@ const onSubmit = () => { login({ userId: formData.value.userId, password: formData.value.password, + source: 'app' }).then((res) => { loading.close(); console.log(res) @@ -101,7 +121,7 @@ const onSubmit = () => { } } else { - alert('账号或密码错误'); + // alert('账号或密码错误'); } }).catch((err) => { @@ -141,6 +161,18 @@ const onSubmit = () => { overflow: hidden; /* 防止内容溢出 */ + .version { + color: #fff; + position: absolute; + font-size: 20px; + bottom: 20px; + left: calc(50% - 50px); + // box-sizing: border-box; + // width: 1600px; + + } + + .background-video { position: absolute; top: 0; diff --git a/src/views/hosts/hostsList.vue b/src/views/hosts/hostsList.vue index d861e51..37ab4df 100644 --- a/src/views/hosts/hostsList.vue +++ b/src/views/hosts/hostsList.vue @@ -46,7 +46,7 @@
+ :time="scope.row.createDt.split('T')[0].replace(/-/g, '').substring(0, 8)">