提交 ce316564 编写于 作者: guangjun.yang's avatar guangjun.yang

请求方式等

上级 4a764094
......@@ -10,19 +10,20 @@ import request from '@/service/api'
import { getHospital } from '@/service';
import About from '../components/about';
import { getNcovRealReports } from "@/service";
export default {
components: {
About
},
async asyncData({ $axios }) {
console.log('index page async data');
const { data } = await request({
baseURL: 'https://sc.yunqueyi.com',
url: '/contents/template/116/widgetList?token=55122B14EAD64B77B4D65E083C994979&setEntry=true'
});
// console.log('index page async data');
// const { data } = await request({
// baseURL: 'https://sc.yunqueyi.com',
// url: '/contents/template/116/widgetList?token=55122B14EAD64B77B4D65E083C994979&setEntry=true'
// });
return { hos: data.model.widgetList }
// return { hos: data.model.widgetList }
},
// fetch() {
// console.log('index page fetch');
......@@ -33,7 +34,16 @@ export default {
created() {
// this.$store.dispatch('searchHospital', { name: '测试' });
},
mounted() {}
mounted() {},
methods: {
async getNcovRealReports() {
await getNcovRealReports(100).then(res => {
if (res.code === "000000") {
this.infoData = res.data || this.infoData;
}
});
},
},
}
</script>
......
......@@ -5,7 +5,7 @@ import WebBuriedPoint, { sendBuriedData } from 'web-buried-point';
const { name } = require('../package.json');
const cookies = require('cookie-universal')();
const { NUXT_ENV_APP } = process.env;
// const { NUXT_ENV_APP } = process.env;
Vue.prototype.$cookies = cookies;
Vue.prototype.$rocNative = new rocNative();
......
......@@ -6,4 +6,8 @@ export const getHospital = async (params) => {
const str = qs.stringify(query);
return request({ url: `/api-ws/hospitals/?${str}` });
};
export const getNcovRealReports = async (pageSize) => {
return request({ url: `ncov/ncovPage/realReports?pageSize=${pageSize}` });
};
\ No newline at end of file
import { getHospital } from '@/service';
// import { getHospital } from '@/service';
export const state = () => ({
hospitals: []
......@@ -14,9 +14,9 @@ export const mutations = {
export const actions = {
async searchHospital({ commit }, { name }) {
getHospital({ name }).then(res => {
commit('add', res);
return res;
});
// getHospital({ name }).then(res => {
// commit('add', res);
// return res;
// });
}
};
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册