到期时间

This commit is contained in:
2025-08-25 15:18:07 +08:00
parent 4fdeb971d4
commit 57066fb864
3 changed files with 38 additions and 6 deletions

View File

@@ -23,7 +23,10 @@ export function tkhostdata(data) {
return postAxios({ url: '/api/save_data/hosts_info', data }) return postAxios({ url: '/api/save_data/hosts_info', data })
} }
//获取到期时间
export function getExpiredTime(tenantId) {
return getAxios({ url: '/api/tenant/get-expired-time?tenantId=' + tenantId })
}

View File

@@ -17,8 +17,8 @@ let baseURL = ''
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// 生产环境 // 生产环境
// baseURL = "https://api.tkpage.yolozs.com" // baseURL = "https://api.tkpage.yolozs.com"
// baseURL = "http://192.168.1.174:8101" baseURL = "http://192.168.1.174:8101"
baseURL = "https://crawlclient.api.yolozs.com" // baseURL = "https://crawlclient.api.yolozs.com"
} else { } else {
// 测试环境 // 测试环境
// baseURL = "http://120.26.251.180:8085/" // baseURL = "http://120.26.251.180:8085/"

View File

@@ -139,6 +139,8 @@
v-model="pyData.filterGame" label="过滤游戏主播" border /> v-model="pyData.filterGame" label="过滤游戏主播" border />
<el-checkbox @click="console.log(pyData)" :disabled="!pyData.isStart" <el-checkbox @click="console.log(pyData)" :disabled="!pyData.isStart"
v-model="pyData.filterSelling" label="过滤带货主播" border /> v-model="pyData.filterSelling" label="过滤带货主播" border />
<el-checkbox @click="console.log(pyData)" :disabled="!pyData.isStart"
v-model="pyData.rankingList" label="排行榜" border />
</div> </div>
<el-button class="submit-button" :disabled="false" v-show="pyData.isStart" type="primary" <el-button class="submit-button" :disabled="false" v-show="pyData.isStart" type="primary"
@click="submit">{{ @click="submit">{{
@@ -150,7 +152,12 @@
</el-card> </el-card>
</div> </div>
<div style="color: green;">
到期时间: {{ timestampToTime(expiredTime) }}
</div>
</div> </div>
</template> </template>
<script setup> <script setup>
@@ -159,7 +166,7 @@ import { usePythonBridge, } from '@/utils/pythonBridge'
import { setNumData, getNumData, getUser, setTkUser, getTkUser } from '@/utils/storage' import { setNumData, getNumData, getUser, setTkUser, getTkUser } from '@/utils/storage'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { getCountryName } from '@/utils/countryUtil' import { getCountryName } from '@/utils/countryUtil'
import { tkaccountuseinfo } from '@/api/account' import { tkaccountuseinfo, getExpiredTime } from '@/api/account'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
const { locale } = useI18n() const { locale } = useI18n()
//导入python交互方法 //导入python交互方法
@@ -230,6 +237,7 @@ let pyData = ref({
country: countryData.value, country: countryData.value,
filterSelling: false, filterSelling: false,
filterGame: false, filterGame: false,
rankingList: false,
tenantId: getUser().tenantId, tenantId: getUser().tenantId,
userId: getUser().userId, userId: getUser().userId,
}); });
@@ -241,7 +249,7 @@ let hostNum = ref(0);
//按钮提交状态 //按钮提交状态
let submitting = ref(true); let submitting = ref(true);
let expiredTime = ref(null);
onMounted(() => { onMounted(() => {
//从缓存获取数据 //从缓存获取数据
@@ -258,7 +266,12 @@ onMounted(() => {
tkaccountuse(tkData.value[1].account, 1) tkaccountuse(tkData.value[1].account, 1)
getIpInfo() getIpInfo()
setTimeout(() => {
getExpiredTime(getUser().tenantId).then((res) => {
console.log('time:', res);
expiredTime.value = res.expiredTime
})
}, 1000);
}) })
@@ -351,6 +364,7 @@ const submit = () => {
isStart: true, isStart: true,
filterSelling: pyData.value.filterSelling, filterSelling: pyData.value.filterSelling,
filterGame: pyData.value.filterGame, filterGame: pyData.value.filterGame,
rankingList: pyData.value.rankingList,
country: countryData.value, country: countryData.value,
tenantId: getUser().tenantId, tenantId: getUser().tenantId,
userId: getUser().id, userId: getUser().id,
@@ -401,6 +415,7 @@ const unsubmit = () => {
isStart: false, isStart: false,
filterSelling: pyData.value.filterSelling, filterSelling: pyData.value.filterSelling,
filterGame: pyData.value.filterGame, filterGame: pyData.value.filterGame,
rankingList: pyData.value.rankingList,
country: countryData.value, country: countryData.value,
tenantId: getUser().tenantId, tenantId: getUser().tenantId,
userId: getUser().id, userId: getUser().id,
@@ -598,6 +613,20 @@ function handleInputDay(value) {
// 更新模型 // 更新模型
pyData.value.frequency.day = num; pyData.value.frequency.day = num;
} }
function timestampToTime(timestamp_ms) {
const date = new Date(timestamp_ms);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
const milliseconds = date.getMilliseconds().toString().padStart(3, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">