diff --git a/examples/router/axios.js b/examples/router/axios.js index 0f7510b4..3bf397f3 100644 --- a/examples/router/axios.js +++ b/examples/router/axios.js @@ -26,9 +26,12 @@ instance.interceptors.request.use(config => { } else if (/#url-/.test(location.hash)) { config.baseURL = location.hash.replace(/#url-/, '/') } - if (["/xsjr", "/omsapi", "/tfx"].includes(config.baseURL)) { + if (["/omsapi"].includes(config.baseURL)) { config.url = config.url.replace(/(app|auth|admin|api)\//, "") } + if (["/xsjr", "/tfx"].includes(config.baseURL)) { + config.url = config.url.replace(/(app|auth|admin|api)\//, "api/") + } if (['/qxn', '/analysis'].includes(config.baseURL)) { config.url = config.url.replace(/(app|auth|admin)\//, "api/") } diff --git a/project/oms/apps/AppArticles/components/Add.vue b/project/oms/apps/AppArticles/components/Add.vue index f1016172..9b606427 100644 --- a/project/oms/apps/AppArticles/components/Add.vue +++ b/project/oms/apps/AppArticles/components/Add.vue @@ -95,7 +95,7 @@ export default { }, getInfo() { - this.instance.post(`/appvillageinfo/queryDetailById?id=${this.params.id}`).then(res => { + this.instance.post(`/api/appvillageinfo/queryDetailById?id=${this.params.id}`).then(res => { if (res.code === 0) { this.form = { ...res.data @@ -109,7 +109,7 @@ export default { onSubmit() { this.$refs.form.validate((valid) => { if (valid) { - this.instance.post(`/appvillageinfo/addOrUpdate`, { + this.instance.post(`/api/appvillageinfo/addOrUpdate`, { ...this.form, fileIds: this.fileList.map(v => v.id), thumbUrl: this.form.thumbUrl.length ? JSON.stringify([{ diff --git a/project/oms/apps/AppArticles/components/Detail.vue b/project/oms/apps/AppArticles/components/Detail.vue index a1a550bf..22f1d8ca 100644 --- a/project/oms/apps/AppArticles/components/Detail.vue +++ b/project/oms/apps/AppArticles/components/Detail.vue @@ -44,7 +44,7 @@ export default { methods: { getInfo() { - this.instance.post(`/appvillageinfo/queryDetailById?id=${this.params.id}`).then(res => { + this.instance.post(`/api/appvillageinfo/queryDetailById?id=${this.params.id}`).then(res => { if (res?.data) { this.info = res.data if (res.data.thumbUrl) { diff --git a/project/oms/apps/AppArticles/components/Event.vue b/project/oms/apps/AppArticles/components/Event.vue index 895e40df..b63d4aaa 100644 --- a/project/oms/apps/AppArticles/components/Event.vue +++ b/project/oms/apps/AppArticles/components/Event.vue @@ -141,7 +141,7 @@ export default { methods: { getsaasList() { - this.instance.post("/appSaas/page", null, { + this.instance.post("/api/appSaas/page", null, { params: {size: 10000} }).then(res => { if (res?.data) { @@ -151,7 +151,7 @@ export default { }, getCompanyList() { - this.instance.post("/appCorp/page", null, { + this.instance.post("/api/appCorp/page", null, { params: {saasId: this.dialogForm.saasId, size: 10000} }).then(res => { if (res?.data) { @@ -173,7 +173,7 @@ export default { }, getList() { - this.instance.post(`/appvillageinfo/list`, null, { + this.instance.post(`/api/appvillageinfo/list`, null, { params: { ...this.search, areaId: this.areaId @@ -216,7 +216,7 @@ export default { saveSaas() { this.$refs.saasForm.validate(v => { if (v) { - this.instance.post(`/appvillageinfo/sync?corpId=${this.dialogForm.corpId}&id=${this.dialogForm.id}&areaId=${this.dialogForm.areaId}`).then(res => { + this.instance.post(`/api/appvillageinfo/sync?corpId=${this.dialogForm.corpId}&id=${this.dialogForm.id}&areaId=${this.dialogForm.areaId}`).then(res => { if (res?.code == 0) { this.dialog = false; this.$message.success("发布成功") diff --git a/project/oms/apps/AppCompany/components/List.vue b/project/oms/apps/AppCompany/components/List.vue index d4bd515d..192b4f69 100644 --- a/project/oms/apps/AppCompany/components/List.vue +++ b/project/oms/apps/AppCompany/components/List.vue @@ -130,7 +130,7 @@ export default { }, methods: { getsaasList() { - this.instance.post("/appSaas/page", null, { + this.instance.post("/api/appSaas/page", null, { params: {size: 10000} }).then(res => { if (res?.data) { @@ -143,7 +143,7 @@ export default { this.getTableData() }, getTableData() { - this.instance.post("/appCorp/page", null, { + this.instance.post("/api/appCorp/page", null, { params: {...this.page, ...this.search} }).then(res => { if (res?.data) { @@ -161,7 +161,7 @@ export default { this.dialogForm.saasName = item.name } }) - this.instance.post("/appCorp/addOrUpdate", this.dialogForm).then(res => { + this.instance.post("/api/appCorp/addOrUpdate", this.dialogForm).then(res => { if (res?.code == 0) { this.dialog = false; this.$message.success("保存成功") @@ -179,7 +179,7 @@ export default { }, handleDelete(ids) { this.$confirm("是否要删除该Saas信息?").then(() => { - this.instance.post("/appCorp/delete", null, { + this.instance.post("/api/appCorp/delete", null, { params: {ids} }).then(res => { if (res?.code == 0) { @@ -191,7 +191,7 @@ export default { }, handleSync(corpId) { this.$confirm("是否确定同步该企业数据?").then(() => { - this.instance.post("/appCorpStat/syncData?corpId=" + corpId, null, {}).then(res => { + this.instance.post("/api/appCorpStat/syncData?corpId=" + corpId, null, {}).then(res => { if (res?.code == 0) { this.getTableData(); this.$message.success("同步成功!"); diff --git a/project/oms/apps/AppCompany/components/Statistics.vue b/project/oms/apps/AppCompany/components/Statistics.vue index 37b42a61..d7c24d25 100644 --- a/project/oms/apps/AppCompany/components/Statistics.vue +++ b/project/oms/apps/AppCompany/components/Statistics.vue @@ -232,7 +232,7 @@ export default { }, getInfo() { this.myChart = echarts.init(document.getElementById("echart")); - this.instance.post(`/appCorpStat/getLatestInfo?corpId=${this.params.corpId}`).then(res => { + this.instance.post(`/api/appCorpStat/getLatestInfo?corpId=${this.params.corpId}`).then(res => { if (res.code === 0) { this.info = res.data this.getCharInfo() @@ -240,7 +240,7 @@ export default { }) }, getCharInfo() { - this.instance.post(`/appCorpStat/getLatestThreeMonthStat?corpId=${this.params.corpId}`).then(res => { + this.instance.post(`/api/appCorpStat/getLatestThreeMonthStat?corpId=${this.params.corpId}`).then(res => { if (res.code === 0) { if (res.data && res.data.length) { this.listData = [] @@ -255,7 +255,7 @@ export default { } }) - this.instance.post(`/wxcp/wxgroup/groupStatistic?corpId=${this.params.corpId}`).then(res => { + this.instance.post(`/api/wxcp/wxgroup/groupStatistic?corpId=${this.params.corpId}`).then(res => { if (res.code === 0) { if (res.data) { this.pieData = [] @@ -277,7 +277,7 @@ export default { this.getTableData() }, getTableData() { - this.instance.post(`/wxcp/wxgroup/list?corpId=${this.params.corpId}¤t=${this.page.current}&size=${this.page.size}&innerMemberId=${this.innerMemberId}`,).then(res => { + this.instance.post(`/api/wxcp/wxgroup/list?corpId=${this.params.corpId}¤t=${this.page.current}&size=${this.page.size}&innerMemberId=${this.innerMemberId}`,).then(res => { if (res.code === 0) { if (res.data) { this.gropList = res.data.records @@ -287,7 +287,7 @@ export default { }) }, getUserTableData() { - this.instance.post(`/wxcp/wxuser/userStat?corpId=${this.params.corpId}¤t=${this.userPage.current}&size=${this.userPage.size}&mainDepartment=1`,).then(res => { + this.instance.post(`/api/wxcp/wxuser/userStat?corpId=${this.params.corpId}¤t=${this.userPage.current}&size=${this.userPage.size}&mainDepartment=1`,).then(res => { if (res.code === 0) { if (res.data) { this.userList = res.data.records diff --git a/project/oms/apps/AppFeedback/components/Detail.vue b/project/oms/apps/AppFeedback/components/Detail.vue index dd8b1d80..066454dd 100644 --- a/project/oms/apps/AppFeedback/components/Detail.vue +++ b/project/oms/apps/AppFeedback/components/Detail.vue @@ -48,7 +48,7 @@ methods: { getInfo (id) { - this.instance.post(`/appfeedback/queryDetailById?id=${id}`).then(res => { + this.instance.post(`/api/appfeedback/queryDetailById?id=${id}`).then(res => { if (res.code === 0) { this.info = res.data this.info.images = res.data.pictureUrl ? res.data.pictureUrl.split(',').map(v => { diff --git a/project/oms/apps/AppFeedback/components/List.vue b/project/oms/apps/AppFeedback/components/List.vue index 22d048ed..0fbae253 100644 --- a/project/oms/apps/AppFeedback/components/List.vue +++ b/project/oms/apps/AppFeedback/components/List.vue @@ -87,7 +87,7 @@ methods: { getList() { - this.instance.post(`/appfeedback/list`, null, { + this.instance.post(`/api/appfeedback/list`, null, { params: { ...this.search } @@ -101,7 +101,7 @@ remove(id) { this.$confirm('确定删除该数据?').then(() => { - this.instance.post(`/appfeedback/delete?ids=${id}`).then(res => { + this.instance.post(`/api/appfeedback/delete?ids=${id}`).then(res => { if (res.code == 0) { this.$message.success('删除成功!') this.getList() diff --git a/project/oms/apps/AppLicense/AppLicense.vue b/project/oms/apps/AppLicense/AppLicense.vue index db1d1e23..4027699f 100644 --- a/project/oms/apps/AppLicense/AppLicense.vue +++ b/project/oms/apps/AppLicense/AppLicense.vue @@ -111,7 +111,7 @@ export default { }, methods: { getTableData() { - this.instance.post("/sysLicense/page", null, { + this.instance.post("/api/sysLicense/page", null, { params: {...this.page, ...this.search} }).then(res => { if (res?.data) { @@ -124,7 +124,7 @@ export default { saveLicense() { this.$refs.licenseForm.validate(v => { if (v) { - this.instance.post("/sysLicense/save", this.dialogForm).then(res => { + this.instance.post("/api/sysLicense/save", this.dialogForm).then(res => { if (res?.code == 0) { this.dialog = false; this.$message.success("保存成功") @@ -138,7 +138,7 @@ export default { }, handleDelete(ids) { this.$confirm("是否要删除该证书信息?").then(() => { - this.instance.post("/sysLicense/delete", null, { + this.instance.post("/api/sysLicense/delete", null, { params: {ids} }).then(res => { if (res?.code == 0) { @@ -149,7 +149,7 @@ export default { }).catch(() => 0) }, handleDownload(id) { - this.instance.post("/sysLicense/create?id="+id, null, {responseType: 'blob'}).then(res => { + this.instance.post("/api/sysLicense/create?id="+id, null, {responseType: 'blob'}).then(res => { const link = document.createElement('a') console.log(res.type) let blob = new Blob([res], {type: res.type}) diff --git a/project/oms/apps/AppSaas/AppSaas.vue b/project/oms/apps/AppSaas/AppSaas.vue index e449bc29..df8e58cc 100644 --- a/project/oms/apps/AppSaas/AppSaas.vue +++ b/project/oms/apps/AppSaas/AppSaas.vue @@ -131,7 +131,7 @@ export default { saveSaas() { this.$refs.saasForm.validate(v => { if (v) { - this.instance.post("/appSaas/addOrUpdate", this.dialogForm).then(res => { + this.instance.post("/api/appSaas/addOrUpdate", this.dialogForm).then(res => { if (res?.code == 0) { this.dialog = false; this.$message.success("保存成功") @@ -148,7 +148,7 @@ export default { this.$refs.updatePwdForm.validate(v => { if (v) { this.updatePwdForm.id = this.currentSaas.id - this.instance.post("/appSaas/updatePwd", null, {params: this.updatePwdForm}).then(res => { + this.instance.post("/api/appSaas/updatePwd", null, {params: this.updatePwdForm}).then(res => { if (res?.code == 0) { this.updateDialog = false; this.$message.success("密码修改成功") diff --git a/project/oms/apps/statistics/AppCorpStatistics/AppCorpStatistics.vue b/project/oms/apps/statistics/AppCorpStatistics/AppCorpStatistics.vue index 04553791..c9d92469 100644 --- a/project/oms/apps/statistics/AppCorpStatistics/AppCorpStatistics.vue +++ b/project/oms/apps/statistics/AppCorpStatistics/AppCorpStatistics.vue @@ -123,7 +123,7 @@ export default { methods: { loadNode(node, resolve) { if (node.level == 0) { - this.instance.post(`/appCorpStat/getCorpStatTotal`).then((res) => { + this.instance.post(`/api/appCorpStat/getCorpStatTotal`).then((res) => { if (res.data) { return resolve([{ name: `全国 (${res.data})`}]); } @@ -137,7 +137,7 @@ export default { if(node.level == 1) { //全国 areaId = '' } - this.instance.post(`/appCorpStat/getCorpStatByArea?areaId=${areaId}`).then((res) => { + this.instance.post(`/api/appCorpStat/getCorpStatByArea?areaId=${areaId}`).then((res) => { if (res.data) { res.data.map((item) => { item.name = item.name + `(${item.total})`