版本号更新

This commit is contained in:
2025-05-06 15:38:23 +08:00
parent 5e34aaf402
commit 60f6fc4873
10 changed files with 139 additions and 19 deletions

View File

@@ -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 = '/';
}

View File

@@ -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
};
}

View File

@@ -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'));
}