修复bug

This commit is contained in:
yannqing 2024-03-14 23:22:22 +08:00
parent 31797fb51a
commit cd1819385b
2 changed files with 37 additions and 8 deletions

View File

@ -534,18 +534,47 @@ const projectAdd =(token,data) => {
/**
* 展示游客查看的项目
*/
const projectGetCustom = () =>{
const projectGetCustom = (data) =>{
// const tags = ['web','大数据']
// const params = {
// tags:
// }
// const config = {
// headers: {
// 'Timestamp': getCurrentTimestamp(),
// // 添加其他需要的头部信息
// }
// };
// return axios.get(api+"/project/get/custom", {
// params,
// config
// })
const tags = data.tags
const encodedTags = tags.map(tag => encodeURIComponent(tag));
const queryString = `tags=${encodedTags.join('&tags=')}`;
return axios({
url:api+ "/project/get/custom",
url:`${api}/project/get/custom?${queryString}`,
method: "get",
data: {
tags: ["web"]
},
headers:{
'Timestamp': getCurrentTimestamp()
}
})
}
// projectGetCustom().interceptors.request.use(config => {
// let url = config.url
// if (config.params) {
// url += '?'
// const keys = Object.keys(config.params)
// for (const key of keys) {
// url += `${key}=${encodeURIComponent(config.params[key])}&`
// }
// url = url.substring(0, url.length-1)
// config.params = {}
// }
// config.url = url
// return config
// })

View File

@ -68,7 +68,7 @@ onMounted(() =>{
getAllProject()
})
function getAllProject(){
request.projectGetCustom().then((res)=>{
request.projectGetCustom(data).then((res)=>{
console.log("project-res:",res.data.data)
// console.log("data:",data)
// Project.data= res.data.data.data
@ -156,8 +156,8 @@ console.log(project.id)
// @click="selectedTags.web = !selectedTags.web"
const data = reactive({
id:1,
tags:['web','ai'],
id:null,
tags:[],
isFinish:[]
})
watch(() => selectedTags.value.length, async (newValue, oldValue) =>{