文章获取逻辑改为根据创建时间
This commit is contained in:
parent
ad70789af5
commit
df31006038
@ -23,8 +23,8 @@ export default {
|
|||||||
this.isLoading=true;
|
this.isLoading=true;
|
||||||
this.error=null;
|
this.error=null;
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const pageid = params.get('id');
|
const pagecreatedAt = params.get('createdAt');
|
||||||
axios.get('/api/examples?populate=*&filters[id]='+pageid)
|
axios.get('/api/examples?populate=*&filters[createdAt]='+pagecreatedAt)
|
||||||
.then(response =>{
|
.then(response =>{
|
||||||
const resp = response.data;
|
const resp = response.data;
|
||||||
if(resp.meta.pagination.total==0){
|
if(resp.meta.pagination.total==0){
|
||||||
@ -61,7 +61,7 @@ export default {
|
|||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const id = params.get('id');
|
const id = params.get('id');
|
||||||
if (!id) {
|
if (!id) {
|
||||||
window.location.href = '/Err404';
|
// window.location.href = '/Err404';
|
||||||
}
|
}
|
||||||
this.fetchpsginfos();
|
this.fetchpsginfos();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
<a
|
<a
|
||||||
v-for="item in titles"
|
v-for="item in titles"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:href="`/ExampleItem?id=${item.id}`"
|
:href="`/ExampleItem?createdAt=${item.createdAt}`"
|
||||||
>
|
>
|
||||||
<div class="listblock">
|
<div class="listblock">
|
||||||
<img :src="`https://cms.yangprivate.site${item.headimage.formats.large.url}`" alt="" />
|
<img :src="`https://cms.yangprivate.site${item.headimage.formats.large.url}`" alt="" />
|
||||||
@ -87,13 +87,13 @@ export default {
|
|||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const type = params.get('type');
|
const type = params.get('type');
|
||||||
console.log('type!',type);
|
console.log('type!',type);
|
||||||
let reqarg='/api/examples?fields=id,brandname_cn,projectname_cn&populate=headimage&sort=createdAt:desc';
|
let reqarg='/api/examples?fields=id,brandname_cn,projectname_cn,createdAt&populate=headimage&sort=createdAt:desc';
|
||||||
if(type){
|
if(type){
|
||||||
console.log('type!',type);
|
console.log('type!',type);
|
||||||
reqarg='/api/examples?fields=id,brandname_cn,projectname_cn&populate=headimage&filters[example_type]='+type+'&sort=createdAt:desc';
|
reqarg='/api/examples?fields=id,brandname_cn,projectname_cn,createdAt&populate=headimage&filters[example_type]='+type+'&sort=createdAt:desc';
|
||||||
}
|
}
|
||||||
if (this.$route.name != 'Examples'){
|
if (this.$route.name != 'Examples'){
|
||||||
let reqarg='/api/examples?fields=id,brandname_cn,projectname_cn&populate=headimage&pagination[page]=1&pagination[pageSize]=5&sort=createdAt:desc';
|
let reqarg='/api/examples?fields=id,brandname_cn,projectname_cn,createdAt&populate=headimage&pagination[page]=1&pagination[pageSize]=5&sort=createdAt:desc';
|
||||||
}
|
}
|
||||||
axios.get(reqarg)
|
axios.get(reqarg)
|
||||||
.then(response =>{
|
.then(response =>{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user