|
@@ -35,19 +35,18 @@ const api = {
|
|
|
// 站点管理
|
|
|
siteQuery: '/api/cms/site/query',
|
|
|
siteFetch: `/api/cms/site/config`,
|
|
|
+ siteContent: `/api/cms/site/content`,
|
|
|
// 新闻管理
|
|
|
- query: '/api/cms/news/list',
|
|
|
- fetch: '/api/cms/news/fetch/{id}',
|
|
|
- // update: '/api/cms/news/update/{id}',
|
|
|
- // delete: '/api/cms/news/delete/{id}',
|
|
|
- // news: '/adminapi/cms/news/create',
|
|
|
- // query: '/adminapi/cms/news/query',
|
|
|
- // fetch: id => `/adminapi/cms/news/fetch/${id}`,
|
|
|
- // update: id => `/adminapi/cms/news/update/${id}`,
|
|
|
- // delete: id => `/adminapi/cms/news/delete/${id}`,
|
|
|
+ newsQuery: '/api/cms/news/list',
|
|
|
+ newsFetch: '/api/cms/news/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}`,
|
|
|
+ //模块管理
|
|
|
+ moduleQuery: `/api/cms/modules/list`,
|
|
|
+ //合作单位/友情链接
|
|
|
+ linkQuery: `${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}/img/list`,
|
|
|
+
|
|
|
// 学生关注企业
|
|
|
// stucorp: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
|
|
|
// stucorpsearch: `/adminapi${process.env.NODE_ENV === 'development' ? '' : ' / jobs'}/studentcorp`,
|
|
@@ -58,6 +57,7 @@ const api = {
|
|
|
stucorpsearch: '/api/stud/studentcorp',
|
|
|
stucorplist: '/api/stud/studentcorp',
|
|
|
stucorpdelete: '/api/stud/studentcorp/{id}',
|
|
|
+ //测试前缀${process.env.NODE_ENV === 'development' ? '/adminapi' : '/api/cms'}
|
|
|
};
|
|
|
|
|
|
export default new Vuex.Store({
|
|
@@ -285,7 +285,7 @@ export default new Vuex.Store({
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
let { site } = data;
|
|
|
- result = await this.$axios.$get(api.menuQuery, {}, { site: site });
|
|
|
+ result = await this.$axios.$get(api.menuQuery, {}, { site: site, is_use: '0' });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
let { id } = data;
|
|
@@ -293,6 +293,15 @@ export default new Vuex.Store({
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
|
+ //模块管理
|
|
|
+ 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' });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ },
|
|
|
// 站点管理
|
|
|
async siteOperation({ state }, { type, data }) {
|
|
|
let result;
|
|
@@ -303,7 +312,11 @@ export default new Vuex.Store({
|
|
|
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;
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -312,12 +325,12 @@ export default new Vuex.Store({
|
|
|
let { skip, limit } = data;
|
|
|
let result;
|
|
|
if (type === 'list') {
|
|
|
- let { site, column } = data;
|
|
|
- result = await this.$axios.$get(api.query, {}, { site: site, column: column, skip: skip, limit: limit });
|
|
|
+ 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' });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
let { id } = data;
|
|
|
- result = await this.$axios.$get(api.fetch, { id: id });
|
|
|
+ result = await this.$axios.$get(api.newsFetch, { id: id });
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -327,10 +340,12 @@ export default new Vuex.Store({
|
|
|
let result;
|
|
|
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' });
|
|
|
}
|
|
|
if (type === 'search') {
|
|
|
- let { id } = data;
|
|
|
- result = await this.$axios.$get(api.columnFetch, { id: id });
|
|
|
+ let { parent_id } = data;
|
|
|
+ result = await this.$axios.$get(api.columnFetch, { id: parent_id });
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
@@ -364,6 +379,15 @@ export default new Vuex.Store({
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
|
+ //合作单位/友情链接
|
|
|
+ async linkOperation({ state }, { type, data }) {
|
|
|
+ let result;
|
|
|
+ if (type === 'list') {
|
|
|
+ let { site, type } = data;
|
|
|
+ result = await this.$axios.$get(api.linkQuery, {}, { site: site, type: type, is_use: `0` });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|