Переглянути джерело

change: axios 取消全局prefix.

peter 4 місяців тому
батько
коміт
a68432e1af
42 змінених файлів з 107 додано та 94 видалено
  1. 4 4
      components/Bxh.vue
  2. 1 1
      components/Card.vue
  3. 1 1
      components/ImageUpload.vue
  4. 4 4
      components/PcFooter.vue
  5. 7 7
      components/PcHeader.vue
  6. 4 4
      components/ProjectDialog.vue
  7. 2 2
      components/addAddressDialog.vue
  8. 2 2
      components/loginDialog.vue
  9. 3 3
      components/product-builder/step-3.vue
  10. 1 1
      components/product/ProductLeft.vue
  11. 2 2
      components/product/ProductRight.vue
  12. 5 5
      components/product/Quote.vue
  13. 1 1
      components/resetPasswordDialog.vue
  14. 1 1
      mixins/category.js
  15. 11 1
      nuxt.config.js
  16. 1 1
      pages/design/_id.vue
  17. 1 1
      pages/home/EDMS.vue
  18. 1 1
      pages/home/FAQs.vue
  19. 1 1
      pages/home/catalogue.vue
  20. 1 1
      pages/home/compareList.vue
  21. 1 1
      pages/home/contactPromoCollection.vue
  22. 1 1
      pages/home/currentFlyer/index.vue
  23. 1 1
      pages/home/downloadCenter.vue
  24. 1 1
      pages/home/myDetail/enquiryDetail.vue
  25. 9 9
      pages/home/myDetail/index.vue
  26. 1 1
      pages/home/newsLetter.vue
  27. 1 1
      pages/home/privacyPolicy.vue
  28. 4 4
      pages/home/projects.vue
  29. 1 1
      pages/home/refundReturns.vue
  30. 1 1
      pages/home/termsConditions.vue
  31. 1 1
      pages/home/video.vue
  32. 10 7
      pages/index.vue
  33. 1 1
      pages/media.vue
  34. 1 1
      pages/news/_newsName.vue
  35. 2 2
      pages/pdf/_id.vue
  36. 6 6
      pages/product-builder/_code.vue
  37. 1 1
      pages/product-record/_code.vue
  38. 3 3
      pages/product/_code.vue
  39. 2 2
      pages/product/index.vue
  40. 1 1
      pages/qrcode/_id.vue
  41. 1 1
      pages/setNewPassword.vue
  42. 3 3
      store/index.js

+ 4 - 4
components/Bxh.vue

@@ -45,14 +45,14 @@ export default {
   methods: {
     async createBxh() {
       if(this.bxhType=='3D'){
-        let companyToken = await this.$axios.get("/bxh/company/token")
+        let companyToken = await this.$axios.get("/api/bxh/company/token")
         let design=this.design || this.link
         this.init(design,companyToken.result,this.bxhType)
       }else if(this.bxhType=='design'){
-        let token = await this.$axios.get("/bxh/token")
+        let token = await this.$axios.get("/api/bxh/token")
         this.init(this.design,token.result,this.bxhType)
       }else if(this.bxhType=='render'){
-        let token = await this.$axios.get("/bxh/token")
+        let token = await this.$axios.get("/api/bxh/token")
         this.init(this.design,token.result,this.bxhType)
       }
     },
@@ -123,4 +123,4 @@ export default {
 .iframe-dom {
   position: relative;
 }
-</style>
+</style>

+ 1 - 1
components/Card.vue

@@ -62,7 +62,7 @@ export default {
   methods: {
     addCompareList(id, e) {
       this.$axios
-        .post("home/compare_add", {
+        .post("/api/home/compare_add", {
           id,
           compare_keys: "keys",
         })

+ 1 - 1
components/ImageUpload.vue

@@ -149,7 +149,7 @@ export default {
       })
       formData.append('type', 1)
       this.$axios
-        .post(`/user_base/imagesUpload`,formData)
+        .post(`/api/user_base/imagesUpload`,formData)
         .then((response) => {
           if (response.result.code === 200) {
             this.imageList.push({

+ 4 - 4
components/PcFooter.vue

@@ -221,20 +221,20 @@ export default {
   },
   async fetch() {
     await this.$axios
-      .post('home/indexBanner', { site: 1, type: 6 })
+      .post('/api/home/indexBanner', { site: 1, type: 6 })
       .then(res => {
         this.footerBannerList = res.result.data
         // this.$store.commit("config/setConfigInfo", res.result);
       })
-    await this.$axios.post('home/indexConfigWebsite', { site: 1 }).then(res => {
+    await this.$axios.post('/api/home/indexConfigWebsite', { site: 1 }).then(res => {
       this.indexConfigWebsite = res.result
       this.$store.commit('config/setConfigInfo', res.result)
     })
-    await this.$axios.post('common/shopProductList').then(res => {
+    await this.$axios.post('/api/common/shopProductList').then(res => {
       this.productList = res.result
     })
     await this.$axios
-      .post('/home/articleLists', { state: 'au', keyword: 'About us' })
+      .post('/api/home/articleLists', { state: 'au', keyword: 'About us' })
       .then(res => {
         this.aboutUsArticle = res.result.data[0]
       })

+ 7 - 7
components/PcHeader.vue

@@ -631,30 +631,30 @@ export default {
     }
   },
   async fetch() {
-    const p1 = this.$axios.post('/common/shopProductList').then(res => {
+    const p1 = this.$axios.post('/api/common/shopProductList').then(res => {
       if (res.code === 1) {
         this.categoryList = res.result
       }
     })
-    const p2 = this.$axios.get('/home/lead_time').then(res => {
+    const p2 = this.$axios.get('/api/home/lead_time').then(res => {
       if (res.code === 1) {
         this.leadTime = res.result.sort((a, b) => a.rank - b.rank)
       }
     })
     const p3 = this.$axios
-      .post('/common/goodsFilterList', { pid: 2 })
+      .post('/api/common/goodsFilterList', { pid: 2 })
       .then(res => {
         if (res.code === 1) {
           this.budget = res.result
         }
       })
     const p4 = this.$axios
-      .post('/home/articleLists', { state: 'au', keyword: 'Indent Ideas' })
+      .post('/api/home/articleLists', { state: 'au', keyword: 'Indent Ideas' })
       .then(res => {
         this.indentIdeasArticle = res.result.data[0] || {}
       })
     const p5 = this.$axios
-      .post('/home/articleLists', { state: 'au', keyword: 'Compliance' })
+      .post('/api/home/articleLists', { state: 'au', keyword: 'Compliance' })
       .then(res => {
         this.complianceArticle = res.result.data[0] || {}
       })
@@ -905,7 +905,7 @@ export default {
     },
     clearCompare(id) {
       this.$axios
-        .post('home/compare_clear', {
+        .post('/api/home/compare_clear', {
           id,
           compare_keys: 'keys',
         })
@@ -921,7 +921,7 @@ export default {
     clearAll() {
       if (this.compareList.length) {
         this.$axios
-          .post('home/compare_clear', {
+          .post('/api/home/compare_clear', {
             id: 0,
             compare_keys: 'keys',
           })

+ 4 - 4
components/ProjectDialog.vue

@@ -56,7 +56,7 @@ export default {
   },
   methods: {
     getSelect(){
-      this.$axios.post("/goods_cart/cartLabelLists", { keyword:this.keyword }).then(res =>{
+      this.$axios.post("/api/goods_cart/cartLabelLists", { keyword:this.keyword }).then(res =>{
         this.selList=res.result
       })
     },
@@ -72,7 +72,7 @@ export default {
               return
       }
       if(this.isCopy){
-          this.$axios.post("/goods_cart/cartLabelGoodsCopy",{
+          this.$axios.post("/api/goods_cart/cartLabelGoodsCopy",{
               id: this.id,
               label_type_new: this.keyword})
             .then((res) => {
@@ -82,7 +82,7 @@ export default {
           return
       }
       let data = { ...{label_type:this.keyword,goods_id: this.id},...this.projectObj}
-      this.$axios.post("/goods_cart/cartAdd", data).then(res =>{
+      this.$axios.post("/api/goods_cart/cartAdd", data).then(res =>{
         this.$message.success("Add success") 
         this.$emit("update:visible", false);
       })
@@ -104,4 +104,4 @@ export default {
   text-align: center;
 }
 
-</style>
+</style>

+ 2 - 2
components/addAddressDialog.vue

@@ -239,7 +239,7 @@ export default {
     },
     addAddress() {
       this.$axios
-        .post("/address/add", this.data)
+        .post("/api/address/add", this.data)
         .then((res) => {
           if (res.code === 1) {
             this.$notify({
@@ -258,7 +258,7 @@ export default {
     },
     editAddress() {
       this.$axios
-        .post("/address/edit", this.data)
+        .post("/api/address/edit", this.data)
         .then((res) => {
           if (res.code === 1) {
             this.$notify({

+ 2 - 2
components/loginDialog.vue

@@ -436,7 +436,7 @@ export default {
         formData.address = this.selectAddress
       }
       this.$axios({
-        url: '/au/register',
+        url: '/api/au/register',
         method: 'post',
         data: formData,
       })
@@ -467,7 +467,7 @@ export default {
     },
     registerEmail() {
       this.$axios
-        .get('/member/register_email?email=' + this.registData.email)
+        .get('/api/member/register_email?email=' + this.registData.email)
         .then(res => {})
         .catch(error => {
           this.$message.error(error.response.data.msg)

+ 3 - 3
components/product-builder/step-3.vue

@@ -395,7 +395,7 @@ export default {
     // Job 下拉/输入框候选数据
     getJobList() {
       this.$axios
-        .post('/goods_cart/cartLabelLists', { keyword: [] })
+        .post('/api/goods_cart/cartLabelLists', { keyword: [] })
         .then(res => {
           this.jobOptions = res.result
         })
@@ -403,7 +403,7 @@ export default {
     // 获取配送地址数据
     async getAddressData() {
       return await this.$axios
-        .get('address/list', {
+        .get('/api/address/list', {
           params: {
             keyword: '',
             page: 1,
@@ -529,7 +529,7 @@ export default {
       if (!this.form.defaultAddr.post_code) return
       this.freightLoading = true
       this.$axios
-        .post('/quote/freight', {
+        .post('/api/quote/freight', {
           postcode: this.form.defaultAddr.post_code,
           type: this.form.freight_type,
         })

+ 1 - 1
components/product/ProductLeft.vue

@@ -131,7 +131,7 @@ export default {
     },
     goDesign(template_id, goods_id) {
       this.$axios
-        .get("/bxh/design", { params: { template_id, goods_id } })
+        .get("/api/bxh/design", { params: { template_id, goods_id } })
         .then((res) => {
           const { href } = this.$router.resolve({
             name: "design-id",

+ 2 - 2
components/product/ProductRight.vue

@@ -530,7 +530,7 @@ export default {
       )
     },
     getStock() {
-      this.$axios.get('/quote/stock_new', { params: {id: this.id} }).then(res => {
+      this.$axios.get('/api/quote/stock_new', { params: {id: this.id} }).then(res => {
         this.stockData = res.result
       })
     },
@@ -613,7 +613,7 @@ export default {
       window.open(a, '_blank')
     },
     sendTicket() {
-      this.$axios.post('/ticket/add', { product_code: this.pageData.product_code,ticket_type: this.ticketForm['问题类型'].join(),content: this.ticketForm['反馈详情']  }).then(res => {
+      this.$axios.post('/api/ticket/add', { product_code: this.pageData.product_code,ticket_type: this.ticketForm['问题类型'].join(),content: this.ticketForm['反馈详情']  }).then(res => {
         this.setLoading(false)
         this.$notify({
               title: "success",

+ 5 - 5
components/product/Quote.vue

@@ -597,7 +597,7 @@ export default {
 
     getQuote() {
       this.$axios
-        .post('/quote/pricequote', { id: this.id })
+        .post('/api/quote/pricequote', { id: this.id })
         .then(res => {
           if (localStorage.getItem('unit')) {
             this.unitData = JSON.parse(localStorage.getItem('unit'))
@@ -751,7 +751,7 @@ export default {
     },
     getWeight() {
       this.$axios
-        .post('/quote/weight', { id: this.id })
+        .post('/api/quote/weight', { id: this.id })
         .then(res => {
           this.weight = res.result
         })
@@ -766,7 +766,7 @@ export default {
         return
       }
       this.$axios
-        .post('/quote/freight', {
+        .post('/api/quote/freight', {
           postcode,
           type
         })
@@ -846,7 +846,7 @@ export default {
         'Customer manager': customerManager,
       } = this.enquiryForm
       this.$axios
-        .post('/quote/sendenquiry', {
+        .post('/api/quote/sendenquiry', {
           content: this.$refs.mailtable.$el.innerHTML,
           name: Name,
           email: Email,
@@ -901,7 +901,7 @@ export default {
     // 发送PDF邮件
     sendPdfMail() {
       this.$axios
-        .post('/quote/sendpdf', {
+        .post('/api/quote/sendpdf', {
           content: this.$refs.pdf.$el.innerHTML,
           product_code: this.pageData.product_code,
           email: this.commentObj['Email Address'],

+ 1 - 1
components/resetPasswordDialog.vue

@@ -94,7 +94,7 @@ export default {
           }
         }, 1000)
         this.$axios
-            .post('au/resetemail', {
+            .post('/api/au/resetemail', {
               email: this.email,
               content: this.$refs.resetPasswordMail.$el.innerHTML,
             })

+ 1 - 1
mixins/category.js

@@ -268,7 +268,7 @@ export default {
     },
   },
   async fetch() {
-    const res = await this.$axios.post('/common/shopProductList')
+    const res = await this.$axios.post('/api/common/shopProductList')
     this.categoryList = res.code === 1 ? res.result : []
     return true
   },

+ 11 - 1
nuxt.config.js

@@ -56,9 +56,19 @@ export default {
   modules: ['@nuxtjs/axios', '@nuxtjs/proxy', 'cookie-universal-nuxt'],
   axios: {
     proxy: true,
-    prefix: '/api',
+    prefix: '/',
   },
   proxy: {
+    '/uk-api': {
+      target:
+        process.env.NODE_ENV === 'development'
+          ? 'http://192.168.10.64:80'
+          : 'http://127.0.0.1:8082',
+      changeOrigin: true,
+      pathRewrite: {
+        '^/uk-api': '',
+      },
+    },
     '/api': {
       target:
         process.env.NODE_ENV === 'development'

+ 1 - 1
pages/design/_id.vue

@@ -124,7 +124,7 @@ export default {
       this.emailDialogVisible=true
     },
     sendMail() {
-      this.$axios.post("/bxh/email", this.emailForm).then(res =>{
+      this.$axios.post("/api/bxh/email", this.emailForm).then(res =>{
         this.emailDialogVisible=false
         this.$confirm("send successfully", {
               confirmButtonText: "OK",

+ 1 - 1
pages/home/EDMS.vue

@@ -47,7 +47,7 @@ export default {
   methods: {
     getInfoList() {
       this.$axios
-        .post('/resources/edm/list', {
+        .post('/api/resources/edm/list', {
           page: this.listQuery.page,
           limit: this.listQuery.limit,
         })

+ 1 - 1
pages/home/FAQs.vue

@@ -143,7 +143,7 @@ export default {
   methods: {
     getInfoList() {
       this.$axios
-        .get("others/issue/list")
+        .get("/api/others/issue/list")
         .then((res) => {
           if (res.code == 1) {
             this.issueInfo = res.result;

+ 1 - 1
pages/home/catalogue.vue

@@ -64,7 +64,7 @@ export default {
   methods: {
     getList() {
       this.$axios
-        .post("/resources/catalogue/list", {
+        .post("/api/resources/catalogue/list", {
           state: "au",
           page: this.listQuery.page,
           limit: this.listQuery.limit,

+ 1 - 1
pages/home/compareList.vue

@@ -104,7 +104,7 @@ export default {
   methods: {
     getCompareList() {
       this.$axios
-        .post("home/compare_list", { compare_keys: "keys" })
+        .post("/api/home/compare_list", { compare_keys: "keys" })
         .then((res) => {
           this.compareList = res.result;
         })

+ 1 - 1
pages/home/contactPromoCollection.vue

@@ -170,7 +170,7 @@ export default {
             }
           }, 1000);
           this.$axios
-            .post("/others/visitor", this.ruleForm)
+            .post("/api/others/visitor", this.ruleForm)
             .then((res) => {
               if (res.code == 1) {
                 this.$notify({

+ 1 - 1
pages/home/currentFlyer/index.vue

@@ -62,7 +62,7 @@ export default {
   methods: {
     getList() {
       this.$axios
-        .post("/home/articleLists", {
+        .post("/api/home/articleLists", {
           state: "au",
           page: this.listQuery.page,
           limit: this.listQuery.limit,

+ 1 - 1
pages/home/downloadCenter.vue

@@ -50,7 +50,7 @@ export default {
   methods: {
     getInfoList() {
       this.$axios
-        .get('others/download/list', {
+        .get('/api/others/download/list', {
           page: this.listQuery.page,
           limit: this.listQuery.limit,
         })

+ 1 - 1
pages/home/myDetail/enquiryDetail.vue

@@ -408,7 +408,7 @@ export default {
     },
     getDetail() {
       this.$axios
-        .post('/crmdata/enquiries_detail', {
+        .post('/api/crmdata/enquiries_detail', {
           accounts_id: this.$store.state.userInfo?.crm_accounts_id || '',
           id: this.$route.query.id,
         })

+ 9 - 9
pages/home/myDetail/index.vue

@@ -563,7 +563,7 @@ export default {
     // 获取用户信息
     getMemberDetail() {
       this.$axios
-        .get('/au/member/detail')
+        .get('/api/au/member/detail')
         .then(res => {
           if (res.code === 1) {
             this.profileform = res.result
@@ -600,7 +600,7 @@ export default {
             needLogout = true
           }
           this.$axios
-            .post('/au/member/edit', requestBody)
+            .post('/api/au/member/edit', requestBody)
             .then(res => {
               if (res.code === 1) {
                   this.$notify({
@@ -631,7 +631,7 @@ export default {
       const type = this.activeMenu === 'all-orders'?'':this.activeMenu === 'open-orders'? 'Open Orders':'Closed Orders'
       this.tableLoading = true
       this.$axios
-        .post('/crmdata/order_lists', {
+        .post('/api/crmdata/order_lists', {
           keyword: this.orderKeyword,
           page: this.orderListQuery.page,
           limit: this.orderListQuery.limit,
@@ -663,7 +663,7 @@ export default {
     getEnquiryList() {
       this.tableLoading = true
       this.$axios
-        .post('/crmdata/enquiries_lists', {
+        .post('/api/crmdata/enquiries_lists', {
           keyword: this.enquiryKeyword,
           page: this.enquiryListQuery.page,
           limit: this.enquiryListQuery.limit,
@@ -692,7 +692,7 @@ export default {
     // 获取地址列表
     getAddressList() {
       this.$axios
-        .get('address/list', {
+        .get('/api/address/list', {
           params: {
             page: this.addressListQuery.page,
             limit: this.addressListQuery.limit,
@@ -718,7 +718,7 @@ export default {
     },
     editAddress(num, id) {
       this.$axios
-        .get('address/detail/' + id)
+        .get('/api/address/detail/' + id)
         .then(res => {
           this.addressDetail = res.result
           this.addressDetail.is_default = res.result.is_default === 1
@@ -728,7 +728,7 @@ export default {
         .catch(() => {})
     },
     delAddress(id) {
-      this.$axios.get('address/delete/' + id).then(res => {
+      this.$axios.get('/api/address/delete/' + id).then(res => {
         this.$notify({
           title: 'success',
           message: 'Deleted successfully',
@@ -740,7 +740,7 @@ export default {
       // .catch((error) => {});
     },
     setDefault(id) {
-      this.$axios.get('address/set_default/' + id).then(res => {
+      this.$axios.get('/api/address/set_default/' + id).then(res => {
         this.$notify({
           title: 'success',
           message: 'Default address is set successfully',
@@ -762,7 +762,7 @@ export default {
         this.$message.error('The second password is inconsistent!')
       } else {
         this.$axios({
-          url: 'au/member/reset',
+          url: '/api/au/member/reset',
           method: 'POST',
           data: this.accountPasswordForm,
         })

+ 1 - 1
pages/home/newsLetter.vue

@@ -46,7 +46,7 @@ export default {
   methods: {
     getInfoList() {
       this.$axios
-        .get("others/au/newsletter",{
+        .get("/api/others/au/newsletter",{
           page: this.listQuery.page,
           limit: this.listQuery.limit,
         })

+ 1 - 1
pages/home/privacyPolicy.vue

@@ -20,7 +20,7 @@ export default {
   },
   methods: {
     getInfoList() {
-      this.$axios.get("others/privacy").then((res) => {
+      this.$axios.get("/api/others/privacy").then((res) => {
         if(res.code==1){
           this.privacyInfo = res.result.content;
         }

+ 4 - 4
pages/home/projects.vue

@@ -223,7 +223,7 @@ export default {
   methods: {
     getProjectList() {
       this.$axios
-        .post("/goods_cart/lists", {
+        .post("/api/goods_cart/lists", {
           keyword: this.keyword,
           page: this.listQuery.page,
           limit: this.listQuery.limit,
@@ -253,7 +253,7 @@ export default {
           return
         }
         this.$axios
-        .post("/goods_cart/cartLabelEdit", {
+        .post("/api/goods_cart/cartLabelEdit", {
           label_type_new: items.label_type,
           label_type_used: this.old_label_type
         })
@@ -292,7 +292,7 @@ export default {
         showClose: false,
         customClass: "message_style",
       }).then(() => {
-        this.$axios.post("/goods_cart/delete", { id: item.id }).then((res) => {
+        this.$axios.post("/api/goods_cart/delete", { id: item.id }).then((res) => {
           this.list[index].lists.splice(idx, 1);
           if (!this.list[index].lists.length) {
             this.list.splice(index, 1);
@@ -304,7 +304,7 @@ export default {
       });
     },
     delGoods(id,index,idx){
-      this.$axios.post("/goods_cart/delete", { id: id }).then((res) => {
+      this.$axios.post("/api/goods_cart/delete", { id: id }).then((res) => {
           this.list[index].lists.splice(idx, 1);
           if (!this.list[index].lists.length) {
             this.list.splice(index, 1);

+ 1 - 1
pages/home/refundReturns.vue

@@ -22,7 +22,7 @@ export default {
   },
   methods: {
     getInfoList() {
-      this.$axios.get("others/au/refund").then((res) => {
+      this.$axios.get("/api/others/au/refund").then((res) => {
         if(res.code==1){
           this.refundInfo = res.result.content;
         }

+ 1 - 1
pages/home/termsConditions.vue

@@ -22,7 +22,7 @@ export default {
   },
   methods: {
     getInfoList() {
-      this.$axios.get("/others/clause").then((res) => {
+      this.$axios.get("/api/others/clause").then((res) => {
         if(res.code==1){
           this.termsConditionsInfo = res.result.content;         
         }

+ 1 - 1
pages/home/video.vue

@@ -57,7 +57,7 @@ export default {
   methods: {
     getList() {
       this.$axios
-        .post("/resources/video/list", {
+        .post("/api/resources/video/list", {
           state: "au",
           page: this.listQuery.page,
           limit: this.listQuery.limit,

+ 10 - 7
pages/index.vue

@@ -90,22 +90,25 @@ export default {
 
   async asyncData({ $axios, req }) {
     // type:1、首页顶部banner,2、首页小图推荐,3、中部banner,4、,5、推荐文章栏目,6、底部banner,7、社交链接
-    const indexBanner = await $axios.post('home/indexBanner', {
+    const indexBanner = await $axios.post('/api/home/indexBanner', {
       site: 1,
       type: 1,
     })
-    const secondaryBanner = await $axios.post('home/indexBanner', {
+    const secondaryBanner = await $axios.post('/api/home/indexBanner', {
       site: 1,
       type: 2,
     })
-    const indexGoodsRankLists = await $axios.post('home/indexGoodsRankLists', {
-      site: 1,
-    })
-    const midBanner = await $axios.post('home/indexBanner', {
+    const indexGoodsRankLists = await $axios.post(
+      '/api/home/indexGoodsRankLists',
+      {
+        site: 1,
+      }
+    )
+    const midBanner = await $axios.post('/api/home/indexBanner', {
       site: 1,
       type: 3,
     })
-    const articleList = await $axios.post('home/indexBanner', {
+    const articleList = await $axios.post('/api/home/indexBanner', {
       site: 1,
       type: 5,
     })

+ 1 - 1
pages/media.vue

@@ -87,7 +87,7 @@ export default {
       }
       this.curTab && (params.type = this.comCurObj?.id)
       this.$axios
-        .get('/data/list', {
+        .get('/api//data/list', {
           params
         })
         .then(res => {

+ 1 - 1
pages/news/_newsName.vue

@@ -94,7 +94,7 @@ export default {
       let title = this.$route.params.newsName || ''
       title = decodeURIComponent(title)
       this.$axios
-        .post('home/articleDetails', {
+        .post('/apihome/articleDetails', {
           title: title.replaceAll('-', ' '),
           state: 'au',
         })

+ 2 - 2
pages/pdf/_id.vue

@@ -7,7 +7,7 @@
   export default {
     layout: "blank_layout",
     created(){
-      this.$axios.get("/bxh/pdf", { params:{project_id: +this.$route.params.id}}).then((res) => {
+      this.$axios.get("/api/bxh/pdf", { params:{project_id: +this.$route.params.id}}).then((res) => {
         fetch(res.result.file_path, {
         method: 'get',
         responseType: 'arraybuffer',
@@ -38,4 +38,4 @@
     method:{
     }
   };
-  </script>
+  </script>

+ 6 - 6
pages/product-builder/_code.vue

@@ -55,7 +55,7 @@ export default {
   layout: 'product_builder_layout',
   async asyncData({ $axios, params }) {
     const detail = await $axios
-      .get(`/au/goods/detail/${params.code}`)
+      .get(`/api/au/goods/detail/${params.code}`)
       .catch(e => {
         console.log(e)
         return {}
@@ -63,7 +63,7 @@ export default {
     let priceData = {}
     if (detail.result && detail.result.id) {
       priceData = await $axios
-        .post('/quote/price', {
+        .post('/api/quote/price', {
           id: detail.result.id,
         })
         .catch(e => {
@@ -111,11 +111,11 @@ export default {
   },
   mounted() {
     // 从页脚组件抄过来的. 运费计算需要里面的一些数据
-    this.$axios.post('home/indexConfigWebsite', { site: 1 }).then(res => {
+    this.$axios.post('/api/home/indexConfigWebsite', { site: 1 }).then(res => {
       this.$store.commit('config/setConfigInfo', res.result)
     })
     if (!this.detail.id) return
-    this.$axios.post('/quote/weight', { id: this.detail.id }).then(res => {
+    this.$axios.post('/api/quote/weight', { id: this.detail.id }).then(res => {
       this.weightInfo = res.result
     })
   },
@@ -181,7 +181,7 @@ export default {
       }
 
       this.$axios
-        .post('/goods_cart/cartAdd', temp)
+        .post('/api/goods_cart/cartAdd', temp)
         .then(res => {
           console.log(res)
           if (res.code === 1) {
@@ -300,7 +300,7 @@ export default {
       if (tempPrint.length) result.decoration = tempPrint
       // console.log(result)
       this.$axios
-        .post('/order/add', result)
+        .post('/api/order/add', result)
         .then(res => {
           console.log(res)
           if (res.code === 1) {

+ 1 - 1
pages/product-record/_code.vue

@@ -166,7 +166,7 @@ export default {
     },
     async getData() {
       const query = this.$route.query
-      let url = '/au/goods/record?product_code=' + this.$route.params.code
+      let url = '/api/au/goods/record?product_code=' + this.$route.params.code
       if (query.version && query.version.length) {
         url += `&version=${query.version}`
       }

+ 3 - 3
pages/product/_code.vue

@@ -74,16 +74,16 @@ export default {
     };
   },
   async asyncData({ $axios, params, error, redirect }) {
-    let pageData = await $axios.get(`/au/goods/detail?product_code=${params.code}`);
+    let pageData = await $axios.get(`/api/au/goods/detail?product_code=${params.code}`);
     let indexGoodsRankLists=[]
     if(pageData.result?.category_id){
         try{
-          indexGoodsRankLists = await $axios.get(`/au/goods/recommend/${pageData.result?.category_id}`);
+          indexGoodsRankLists = await $axios.get(`/api/au/goods/recommend/${pageData.result?.category_id}`);
         }catch (err) {
           console.log(err);
         }
       }else{
-        indexGoodsRankLists = await $axios.post("home/indexGoodsRankLists", { site: 1 });
+        indexGoodsRankLists = await $axios.post("/api/home/indexGoodsRankLists", { site: 1 });
     }
     return {
       pageData: pageData.result,

+ 2 - 2
pages/product/index.vue

@@ -18,7 +18,7 @@ export default {
     };
   },
    async asyncData({ $axios }) {
-    let indexGoodsRankLists = await $axios.post("home/indexGoodsRankLists", {
+    let indexGoodsRankLists = await $axios.post("/api/home/indexGoodsRankLists", {
       site: 1,
     });
     return {
@@ -36,4 +36,4 @@ export default {
   display: grid;
   justify-items: center;
 }
-</style>
+</style>

+ 1 - 1
pages/qrcode/_id.vue

@@ -65,7 +65,7 @@ export default {
   },
   created() {
     this.$axios
-      .get(`/data/detail/${+this.$route.params.id}`)
+      .get(`/api/data/detail/${+this.$route.params.id}`)
       .then((response) => {
         const { media_url, type } = response.result;
         this.mediaUrl = media_url;

+ 1 - 1
pages/setNewPassword.vue

@@ -141,7 +141,7 @@ export default {
             })
           } else {
             this.$axios
-              .post('/au/reset', {
+              .post('/api/au/reset', {
                 // email: this.ruleForm.email,
                 email: this.email,
                 password: this.ruleForm.password,

+ 3 - 3
store/index.js

@@ -44,7 +44,7 @@ export const actions = {
     return new Promise((resolve, reject) => {
       if (data) {
         this.$axios({
-          url: "/au/login",
+          url: "/uk-api/uk/login",
           method: "POST",
           data,
         }).then((res) => {
@@ -60,7 +60,7 @@ export const actions = {
   getUserInfo({ commit, dispatch }) {
     return new Promise((resolve, reject) => {
       this.$axios({
-        url: "au/member/detail",
+        url: "/api/au/member/detail",
         method: "GET",
       }).then((res) => {
         commit("setUserInfo", res.result);
@@ -77,7 +77,7 @@ export const actions = {
   getCompareList({ commit, dispatch }) {
     return new Promise((resolve, reject) => {
       this.$axios
-        .post("home/compare_list", { compare_keys: "keys" })
+        .post("/api/home/compare_list", { compare_keys: "keys" })
         .then((res) => {
           commit("setCompareList", res.result);
           resolve(res);