修改用户搜索部分代码问题,删去日期cookie记录

This commit is contained in:
junleea 2024-07-03 17:22:22 +08:00
parent 639bcd4848
commit 6be1272d04
3 changed files with 16 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import axios from "axios";
import router from "@/router/index.js";
const baseURL = "https://gep.ljsea.top/";
const baseURL = "https://gep.ljsea.xyz/";
//const baseURL= "http://localhost:8082";
const request = axios.create({
baseURL: baseURL,

View File

@ -91,8 +91,8 @@ export default {
if (localStorage.getItem("token") === null) {
router.push("/login");
}
this.search_id = Cookies.get("search_id")?cookies.get("search_id"):2002;
this.keyword = Cookies.get("keyword")?cookies.get("keyword"):"";
this.search_id = Cookies.get("search_id")?Cookies.get("search_id"):2002;
this.keyword = Cookies.get("keyword")?Cookies.get("keyword"):"";
},
};
</script>

View File

@ -3,6 +3,7 @@ import axios from "axios";
import { getVideoListService, quashVideoService } from "@/api/video.js";
import { delayVideoService } from "@/api/video.js";
import router from "@/router/index.js";
import Cookies from "js-cookie";
export default {
data() {
@ -31,15 +32,18 @@ export default {
async getVideoList() {
let result = {};
try {
if(this.tokenData.entrydate.length > 0) {
Cookies.set("entrydate", this.tokenData.entrydate);
}
// console.log("this entrydate:", this.tokenData.entrydate[0]);
// console.log("type time:",typeof this.tokenData.entrydate[0])
// if(this.tokenData.entrydate.length > 0) {
// // get the date from the date picker
// Cookies.set("entrydate", [this.tokenData.entrydate[0], this.tokenData.entrydate[1]]);
// }
result = await getVideoListService(this.tokenData);
} catch (e) {
console.log(e);
}
let data = result.data;
let len = data.length;
let len = data?data.length:0;
for (let i = 0; i < len; i++) {
//this.file_sum_size += parseFloat(data[i].file_size);
@ -208,7 +212,11 @@ export default {
}
// console.log("mounted");
await this.getIpClient();
this.tokenData.entrydate = Cookies.get("entrydate")? Cookies.get("entrydate"): [];
// if( Cookies.get("entrydate")){
// console.log("entrydate:",Cookies.get("entrydate"));
// this.tokenData.entrydate = [Object(Cookies.get("entrydate")[0]),Object(Cookies.get("entrydate")[1])];
// }
this.getVideoList();
},
};