|
@@ -30,22 +30,24 @@ const api = {
|
|
|
fairCorp: '/api/jobs/faircorps',
|
|
|
fairJobs: '/api/jobs/faircorps/{id}/jobs',
|
|
|
//分站菜单
|
|
|
- menuQuery: '/api/cms/menu/list',
|
|
|
+ menuQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/menu/list`,
|
|
|
menuSearch: `/adminapi/menu/fetch/{id}`,
|
|
|
// 站点管理
|
|
|
- siteQuery: '/api/cms/site/query',
|
|
|
- siteFetch: `/api/cms/site/config`,
|
|
|
- siteContent: `/api/cms/site/content`,
|
|
|
+ siteQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/site/query`,
|
|
|
+ siteFetch: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/site/config`,
|
|
|
+ siteContent: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/site/content`,
|
|
|
// 新闻管理
|
|
|
- newsQuery: '/api/cms/news/list',
|
|
|
- newsFetch: '/api/cms/news/fetch/{id}',
|
|
|
+ newsQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/news/list`,
|
|
|
+ newsFetch: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/news/fetch/{id}`,
|
|
|
+ bugInfo: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/newscreeper/fetch/{id}`,
|
|
|
//栏目管理
|
|
|
- columnQuery: `/api/cms/column/list`,
|
|
|
- columnFetch: `/api/cms/column/fetch/{id}`,
|
|
|
+ columnQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/column/list`,
|
|
|
+ columnFetch: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/column/fetch/{id}`,
|
|
|
+ bugList: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/newscreeper/list`,
|
|
|
//模块管理
|
|
|
- moduleQuery: `/api/cms/modules/list`,
|
|
|
+ moduleQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/modules/list`,
|
|
|
//合作单位/友情链接
|
|
|
- linkQuery: `/api/cms/img/list`,
|
|
|
+ linkQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/img/list`,
|
|
|
|
|
|
// 学生关注企业
|
|
|
// stucorp: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
|
|
@@ -57,7 +59,7 @@ const api = {
|
|
|
stucorpsearch: '/api/stud/studentcorp',
|
|
|
stucorplist: '/api/stud/studentcorp',
|
|
|
stucorpdelete: '/api/stud/studentcorp/{id}',
|
|
|
- //测试前缀${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}
|
|
|
+ //测试前缀${process.env.NODE_ENV === 'development' ? '/adminapi' : '${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}'}
|
|
|
};
|
|
|
|
|
|
export default new Vuex.Store({
|
|
@@ -274,18 +276,12 @@ export default new Vuex.Store({
|
|
|
}
|
|
|
console.error('create qrcode fail', result);
|
|
|
},
|
|
|
- //抓取信息
|
|
|
- async getBugInfo({ state }, { data }) {
|
|
|
- let { skip, limit } = data;
|
|
|
- let result = await this.$axios.$get('/bugInfo/newsinfo', {}, { skip: skip, limit: limit });
|
|
|
- return result;
|
|
|
- },
|
|
|
//分站菜单
|
|
|
async menuOperation({ state }, { type, data }) {
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
let { site } = data;
|
|
|
- result = await this.$axios.$get(api.menuQuery, {}, { site: site, is_use: '0' });
|
|
|
+ result = await this.$axios.$get(api.menuQuery, {}, { is_use: '0' });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
let { id } = data;
|
|
@@ -297,8 +293,7 @@ export default new Vuex.Store({
|
|
|
async moduleOperation({ state }, { type, data }) {
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
- let { site } = data;
|
|
|
- result = await this.$axios.$get(api.moduleQuery, {}, { site: site, is_use: '0' });
|
|
|
+ result = await this.$axios.$get(api.moduleQuery, {}, { is_use: '0' });
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -307,15 +302,16 @@ export default new Vuex.Store({
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
let { site, column } = data;
|
|
|
- result = await this.$axios.$get(api.siteQuery, { site: site, column: column });
|
|
|
+ result = await this.$axios.$get(api.siteQuery, { column: column });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
let { site } = data;
|
|
|
//_tenant
|
|
|
- let content = await this.$axios.$get(api.siteContent, {}, { _tenant: site });
|
|
|
- result = await this.$axios.$get(api.siteFetch, {}, { _tenant: site });
|
|
|
- if (`${content.errcode}` === '0') {
|
|
|
- result.data.content = content.data;
|
|
|
+ let content = await this.$axios.$get(api.siteContent, {});
|
|
|
+ result = await this.$axios.$get(api.siteFetch, {});
|
|
|
+ if (content.data && `${content.errcode}` === '0') {
|
|
|
+ console.log('in function:');
|
|
|
+ result.data.content = content && content.data ? content.data : '';
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
@@ -325,12 +321,16 @@ export default new Vuex.Store({
|
|
|
let { skip, limit } = data;
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
- let { site, parent_id } = data;
|
|
|
- result = await this.$axios.$get(api.newsQuery, {}, { site: site, parent_id: parent_id, skip: skip, limit: limit, is_use: '0' });
|
|
|
+ let { site, parent_id, news_type } = data;
|
|
|
+ if (news_type === '0') {
|
|
|
+ result = await this.$axios.$get(api.bugList, {}, { parent_id: parent_id, skip: skip, limit: limit, is_use: '0' });
|
|
|
+ } else {
|
|
|
+ result = await this.$axios.$get(api.newsQuery, {}, { parent_id: parent_id, skip: skip, limit: limit, is_use: '0' });
|
|
|
+ }
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
- let { id } = data;
|
|
|
- result = await this.$axios.$get(api.newsFetch, { id: id });
|
|
|
+ let { id, news_type } = data;
|
|
|
+ result = await this.$axios.$get(api.bugInfo, { id: id });
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -341,7 +341,7 @@ export default new Vuex.Store({
|
|
|
if (type === 'list') {
|
|
|
//TODO
|
|
|
let { parent_id, site } = data;
|
|
|
- result = await this.$axios.$get(api.columnQuery, {}, { parent_id: parent_id, site: site, is_use: '0' });
|
|
|
+ result = await this.$axios.$get(api.columnQuery, {}, { parent_id: parent_id, is_use: '0' });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
let { parent_id } = data;
|
|
@@ -384,7 +384,7 @@ export default new Vuex.Store({
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
let { site, type } = data;
|
|
|
- result = await this.$axios.$get(api.linkQuery, {}, { site: site, type: type, is_use: `0` });
|
|
|
+ result = await this.$axios.$get(api.linkQuery, {}, { type: type, is_use: `0` });
|
|
|
}
|
|
|
return result;
|
|
|
},
|