From d098203c87b9b1e8d7bb71998fa960df35332339 Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Mon, 15 Dec 2025 23:27:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80API=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=89=8D=E7=BC=80=E5=B9=B6=E6=9B=B4=E6=96=B0=E9=9D=99?= =?UTF-8?q?=E6=80=81=E8=B5=84=E6=BA=90=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将所有API路径从'/v2/miniprogram'统一为'/miniprogram' - 更新静态资源域名从'http://jm.v0750.com'到'https://jm-static.v0750.com' - 在utils/login.js中设置统一的baseUrl为'https://t-jm.v0750.com/v3' - 移除不再使用的initial_url和baseUrl配置项 --- .cloudbase/container/debug.json | 1 + pages/OnlineCarHailing/OnlineCarHailing.js | 4 ++-- pages/duiquan/duiquan.js | 8 ++++---- pages/goodsDetails/goodsDetails.js | 6 +++--- pages/goodsSearch/goodsSearch.js | 8 ++++---- pages/index/index.js | 16 ++++++++-------- pages/login/login.js | 2 +- pages/mall/mall.js | 6 +++--- pages/orderDetails/orderDetails.js | 6 +++--- pages/orderIndex/orderIndex.js | 6 +++--- pages/orderList/orderList.js | 8 ++++---- pages/orderPay/orderPay.js | 12 ++++++------ pages/orderPaySuccess/orderPaySuccess.js | 4 ++-- pages/refund/refund.js | 6 +++--- pages/substituteWash/substituteWash.js | 4 ++-- pages/user/user.js | 8 ++++---- pages/user/user.wxml | 4 ++-- pages/wangdian/wangdian.js | 4 ++-- pages/washCodeDetail/washCodeDetail.js | 4 ++-- pages/washCodeList/washCodeList.js | 6 +++--- pages/washing/washing.js | 4 ++-- utils/login.js | 13 +++++++------ 22 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 .cloudbase/container/debug.json diff --git a/.cloudbase/container/debug.json b/.cloudbase/container/debug.json new file mode 100644 index 0000000..0d44458 --- /dev/null +++ b/.cloudbase/container/debug.json @@ -0,0 +1 @@ +{"containers":[],"config":{}} \ No newline at end of file diff --git a/pages/OnlineCarHailing/OnlineCarHailing.js b/pages/OnlineCarHailing/OnlineCarHailing.js index 17c1e61..5ffdb55 100644 --- a/pages/OnlineCarHailing/OnlineCarHailing.js +++ b/pages/OnlineCarHailing/OnlineCarHailing.js @@ -37,8 +37,8 @@ Page({ wx.showLoading({ title: '提交中...' }) - - t.request('/v2/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => { + + t.request('/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => { wx.hideLoading() if (res.code == 200) { wx.showToast({ diff --git a/pages/duiquan/duiquan.js b/pages/duiquan/duiquan.js index 079c658..90b4901 100644 --- a/pages/duiquan/duiquan.js +++ b/pages/duiquan/duiquan.js @@ -7,7 +7,7 @@ Page({ code: '' }, onLoad() { - t.request('/v2/miniprogram/coupons/index', {}, !0).then((res) => { + t.request('/miniprogram/coupons/index', {}, !0).then((res) => { if (res.code == 200) { this.setData({ tips: res.data.tips, @@ -23,7 +23,7 @@ Page({ success: function (i) { console.log(i), wx.showLoading({ title: "" - }), e.globalData.qrcode = i.result, t.request("/v2/miniprogram/identify/index", i, !0).then(function (t) { + }), e.globalData.qrcode = i.result, t.request("/miniprogram/identify/index", i, !0).then(function (t) { console.log("data", t), wx.hideLoading(); // 保存设备编号 getApp().globalData.deviceData = t.data || getApp().globalData.deviceData || {}; @@ -45,7 +45,7 @@ Page({ }); // 已扫码,启动机器 - t.request('/v2/miniprogram/' + getApp().globalData.deviceData.type + '/carwashcodestartup', params, !0).then((startRes) => { + t.request('/miniprogram/' + getApp().globalData.deviceData.type + '/carwashcodestartup', params, !0).then((startRes) => { if (startRes.code == 200) { wx.showToast({ title: startRes.message || '启动成功', icon: 'success' }); // 跳转到洗车券列表页面 @@ -81,7 +81,7 @@ Page({ wx.showLoading({ title: '兑换中...' }) - t.request('/v2/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => { + t.request('/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => { wx.hideLoading() if (res.code == 200) { diff --git a/pages/goodsDetails/goodsDetails.js b/pages/goodsDetails/goodsDetails.js index 0415505..ba9d4b8 100644 --- a/pages/goodsDetails/goodsDetails.js +++ b/pages/goodsDetails/goodsDetails.js @@ -1,4 +1,4 @@ -var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/slicedToArray"), a = require("../../@babel/runtime/helpers/asyncToGenerator"), r = require("../../@babel/runtime/helpers/defineProperty"), n = (getApp(), +var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/slicedToArray"), a = require("../../@babel/runtime/helpers/asyncToGenerator"), r = require("../../@babel/runtime/helpers/defineProperty"), n = (getApp(), require("../../utils/login.js")), i = require("../../utils/common.js"); Page({ @@ -39,7 +39,7 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - return s, e.prev = 1, e.next = 4, n.request(n.baseUrl + "shop/details", { + return s, e.prev = 1, e.next = 4, n.request("/shop/details", { id: s.data.id }, !0); @@ -76,7 +76,7 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - r = t, e.prev = 1, n = [ "header", "title", "merchantList", "needknow", "infomes" ], + r = t, e.prev = 1, n = [ "header", "title", "merchantList", "needknow", "infomes" ], i = 0, s = 0; case 5: diff --git a/pages/goodsSearch/goodsSearch.js b/pages/goodsSearch/goodsSearch.js index 3ee570e..5f78a43 100644 --- a/pages/goodsSearch/goodsSearch.js +++ b/pages/goodsSearch/goodsSearch.js @@ -1,4 +1,4 @@ -var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), a = require("../../@babel/runtime/helpers/toConsumableArray"), e = require("../../@babel/runtime/helpers/slicedToArray"), i = require("../../@babel/runtime/helpers/asyncToGenerator"), s = (getApp(), +var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), a = require("../../@babel/runtime/helpers/toConsumableArray"), e = require("../../@babel/runtime/helpers/slicedToArray"), i = require("../../@babel/runtime/helpers/asyncToGenerator"), s = (getApp(), require("../../utils/login.js")); Page({ @@ -43,7 +43,7 @@ Page({ page: 1 }); var t = this.data.historyList.indexOf(this.data.kw); - t > -1 && this.data.historyList.splice(t, 1), this.data.historyList.unshift(this.data.kw), + t > -1 && this.data.historyList.splice(t, 1), this.data.historyList.unshift(this.data.kw), this.setData({ historyList: this.data.historyList }), this.getData(); @@ -64,12 +64,12 @@ Page({ case 2: return r.setData({ loading: !0 - }), r, t.prev = 4, t.next = 7, s.request(s.baseUrl + "shop/search", { + }), r, t.prev = 4, t.next = 7, s.request("/shop/search", { keyword: r.data.kw }, !0); case 7: - n = t.sent, o = n.data, console.log("data,data", o), o.data.length < o.limit ? r.data.page = 0 : r.data.page += 1, + n = t.sent, o = n.data, console.log("data,data", o), o.data.length < o.limit ? r.data.page = 0 : r.data.page += 1, o.data.forEach(function(t) { var a = t.price.split("."), i = e(a, 2); t.price_buck = i[0], t.price_cent = i[1]; diff --git a/pages/index/index.js b/pages/index/index.js index ad3da20..db0df38 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -41,7 +41,7 @@ Page({ e.globalData.latitude = res.latitude; e.globalData.longitude = res.longitude; // 获取网点列表 - t.request('/v2/miniprogram/branch/lists', { + t.request('/miniprogram/branch/lists', { latitude: res.latitude || '', longitude: res.longitude || '' }, !0).then(function (res) { @@ -52,7 +52,7 @@ Page({ }, fail: function () { // 即使获取位置失败也加载网点列表,只是不传入经纬度参数 - t.request('/v2/miniprogram/branch/lists', {}, !0).then(function (res) { + t.request('/miniprogram/branch/lists', {}, !0).then(function (res) { a.setData({ wangdianList: res.data || [] }); @@ -70,7 +70,7 @@ Page({ }); // 获取首页数据 - t.request('/v2/miniprogram/index/home', { method: 'GET' }, !0).then(function (e) { + t.request('/miniprogram/index/home', { method: 'GET' }, !0).then(function (e) { a.setData({ banner: e.data.banner, tmplIds: e.data.tmplIds, @@ -93,7 +93,7 @@ Page({ getData: function () { var a = this; // 获取首页数据 - t.request('/v2/miniprogram/index/balance', e.globalData.deviceData, !0).then(function (e) { + t.request('/miniprogram/index/balance', e.globalData.deviceData, !0).then(function (e) { a.setData({ user: e.data || [], }); @@ -164,7 +164,7 @@ Page({ success: function (i) { console.log(i), wx.showLoading({ title: "" - }), e.globalData.qrcode = i.result, t.request("/v2/miniprogram/identify/index", i, !0).then(function (t) { + }), e.globalData.qrcode = i.result, t.request("/miniprogram/identify/index", i, !0).then(function (t) { console.log("data", t), wx.hideLoading(), e.globalData.deviceData = t.data || e.globalData.deviceData || {}; e.globalData.devicecode = t.data.devicecode || e.globalData.devicecode; @@ -236,7 +236,7 @@ Page({ var a = this; if (a.data.oneTimeLoading) return !1; a.setData({ oneTimeLoading: !0 }); - t.request('/v2/miniprogram/recharge/once', e.globalData.deviceData || {}, !0).then(function (res) { + t.request('/miniprogram/recharge/once', e.globalData.deviceData || {}, !0).then(function (res) { a.setData({ oneTimeOptions: res.data && res.data.list ? res.data.list : (res.data || []), showOneTimeOptions: !0, @@ -253,7 +253,7 @@ Page({ var a = this, i = evt.currentTarget.dataset.id; if (!i) return !1; wx.showLoading({ title: "" }); - t.request('/v2/miniprogram/recharge/once/create', { + t.request('/miniprogram/recharge/once/create', { id: i, devicecode: e.globalData.devicecode }, !0).then(function (res) { @@ -290,7 +290,7 @@ Page({ success: function (i) { i.confirm && (a.isSubmit = !0, wx.showLoading({ title: "正在启动" - }), t.request('/v2/miniprogram/' + e.globalData.deviceData.type + '/startup', e.globalData.deviceData || {}, !0).then(function (e) { + }), t.request('/miniprogram/' + e.globalData.deviceData.type + '/startup', e.globalData.deviceData || {}, !0).then(function (e) { a.isSubmit = !1, wx.hideLoading(), 200 == e.code && (wx.showModal({ title: "", content: e.message diff --git a/pages/login/login.js b/pages/login/login.js index d04f7d5..227d19e 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -28,7 +28,7 @@ Page({ var n = Object.assign(this.userInfo, t, { code: a }); - o.request('/v2/miniprogram/index/authorization', n, !0).then(function(o) { + o.request('/miniprogram/index/authorization', n, !0).then(function(o) { if (wx.hideLoading(), console.log("toAuthorization", "app.globalData.needJumpUrl", e.globalData.needJumpUrl, o), 200 != o.code) return wx.showModal({ title: "提示", diff --git a/pages/mall/mall.js b/pages/mall/mall.js index bd46c5f..36b3155 100644 --- a/pages/mall/mall.js +++ b/pages/mall/mall.js @@ -1,4 +1,4 @@ -var e = require("../../@babel/runtime/helpers/interopRequireDefault"), t = require("../../@babel/runtime/helpers/toConsumableArray"), a = e(require("../../@babel/runtime/regenerator")), n = require("../../@babel/runtime/helpers/slicedToArray"), o = require("../../@babel/runtime/helpers/asyncToGenerator"), r = (getApp(), +var e = require("../../@babel/runtime/helpers/interopRequireDefault"), t = require("../../@babel/runtime/helpers/toConsumableArray"), a = e(require("../../@babel/runtime/regenerator")), n = require("../../@babel/runtime/helpers/slicedToArray"), o = require("../../@babel/runtime/helpers/asyncToGenerator"), r = (getApp(), require("../../utils/login.js")); Page({ @@ -54,7 +54,7 @@ Page({ return a.default.wrap(function(t) { for (;;) switch (t.prev = t.next) { case 0: - return e, t.prev = 1, t.next = 4, r.request(r.baseUrl + "shop/home", {}, !0); + return e, t.prev = 1, t.next = 4, r.request("/shop/home", {}, !0); case 4: o = t.sent, (s = o.data).recommendedList.forEach(function(e) { @@ -99,7 +99,7 @@ Page({ case 3: return s.setData({ loading: !0 - }), e.prev = 4, e.next = 7, r.request(r.baseUrl + "shop/home/shopList", { + }), e.prev = 4, e.next = 7, r.request("/shop/home/shopList", { type: s.data.tab, point: { lng: s.longitude, diff --git a/pages/orderDetails/orderDetails.js b/pages/orderDetails/orderDetails.js index 5e4b49d..29ae9ae 100644 --- a/pages/orderDetails/orderDetails.js +++ b/pages/orderDetails/orderDetails.js @@ -1,4 +1,4 @@ -var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/asyncToGenerator"), t = (getApp(), +var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/asyncToGenerator"), t = (getApp(), require("../../utils/login.js")), a = require("../../utils/common.js"); Page({ @@ -26,12 +26,12 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - return i, o = i.data.orderid, e.prev = 2, e.next = 5, t.request(t.baseUrl + "shop/order/detail", { + return i, o = i.data.orderid, e.prev = 2, e.next = 5, t.request("/shop/order/detail", { orderid: o }, !0); case 5: - if (n = e.sent, (d = n.data).orderData.updatetime = a.changeTime(new Date(1e3 * d.orderData.updatetime)), + if (n = e.sent, (d = n.data).orderData.updatetime = a.changeTime(new Date(1e3 * d.orderData.updatetime)), d.orderValidity && d.orderValidity.length > 0) for (c = 0; c < d.orderValidity.length; c++) i.data.orderValidity[c] = a.changeTime(new Date(1e3 * d.orderValidity[c])); i.setData({ showLoding: !1, diff --git a/pages/orderIndex/orderIndex.js b/pages/orderIndex/orderIndex.js index 0d8fa99..efd57ea 100644 --- a/pages/orderIndex/orderIndex.js +++ b/pages/orderIndex/orderIndex.js @@ -1,4 +1,4 @@ -var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), e = require("../../@babel/runtime/helpers/asyncToGenerator"), a = (getApp(), +var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), e = require("../../@babel/runtime/helpers/asyncToGenerator"), a = (getApp(), require("../../utils/login.js")); Page({ @@ -82,7 +82,7 @@ Page({ return t.default.wrap(function(t) { for (;;) switch (t.prev = t.next) { case 0: - return t.prev = 0, t.next = 3, a.request(a.baseUrl + "shop/order/create", { + return t.prev = 0, t.next = 3, a.request("/shop/order/create", { token: n.data.token }, !0); @@ -119,7 +119,7 @@ Page({ return t.default.wrap(function(t) { for (;;) switch (t.prev = t.next) { case 0: - return t.prev = 0, t.next = 3, a.request(a.baseUrl + "shop/order/num", { + return t.prev = 0, t.next = 3, a.request("/shop/order/num", { uniqid: n.data.shoppingCartList.uniqid, cartnum: n.data.num }, !0); diff --git a/pages/orderList/orderList.js b/pages/orderList/orderList.js index a2e23a3..0777629 100644 --- a/pages/orderList/orderList.js +++ b/pages/orderList/orderList.js @@ -1,4 +1,4 @@ -var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), a = require("../../@babel/runtime/helpers/toConsumableArray"), e = require("../../@babel/runtime/helpers/asyncToGenerator"), n = (getApp(), +var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), a = require("../../@babel/runtime/helpers/toConsumableArray"), e = require("../../@babel/runtime/helpers/asyncToGenerator"), n = (getApp(), require("../../utils/login.js")); Page({ @@ -70,7 +70,7 @@ Page({ case 2: return r.setData({ loading: !0 - }), t.prev = 3, t.next = 6, n.request(n.baseUrl + "shop/order/lists", { + }), t.prev = 3, t.next = 6, n.request("/shop/order/lists", { page: r.data.next_page, typeid: r.data.tab }, !0); @@ -79,7 +79,7 @@ Page({ s = t.sent, i = s.data, r.setData({ loading: !1, showLoding: !1 - }), 200 == s.code && (i.data.length < i.limit ? r.data.next_page = 0 : r.data.next_page += 1, + }), 200 == s.code && (i.data.length < i.limit ? r.data.next_page = 0 : r.data.next_page += 1, r.setData({ type: i.type, count: i.count, @@ -108,7 +108,7 @@ Page({ case 0: return s = a.currentTarget.dataset, i = s.orderid, o = s.index, wx.showLoading({ title: "正在删除" - }), t.prev = 2, t.next = 5, n.request(n.baseUrl + "shop/order/delete", { + }), t.prev = 2, t.next = 5, n.request("/shop/order/delete", { orderid: i }, !0); diff --git a/pages/orderPay/orderPay.js b/pages/orderPay/orderPay.js index fb7f55e..c7ab99e 100644 --- a/pages/orderPay/orderPay.js +++ b/pages/orderPay/orderPay.js @@ -1,4 +1,4 @@ -var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), a = (getApp(), +var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), a = (getApp(), require("../../utils/login.js")), r = require("../../utils/common.js"); Page({ @@ -41,7 +41,7 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - return r, e.prev = 1, e.next = 4, a.request(a.baseUrl + "shop/order/submit", { + return r, e.prev = 1, e.next = 4, a.request("/shop/order/submit", { uniqid: r.data.uniqid, name: r.data.name, mobile: r.data.mobile, @@ -74,15 +74,15 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - return n, s = n.data.orderid || n.data.data.orderid, e.prev = 2, e.next = 5, a.request(a.baseUrl + "shop/order/detail", { + return n, s = n.data.orderid || n.data.data.orderid, e.prev = 2, e.next = 5, a.request("/shop/order/detail", { orderid: s }, !0); case 5: - i = e.sent, o = i.data, console.log("(data.orderData.status", o.orderData.status), + i = e.sent, o = i.data, console.log("(data.orderData.status", o.orderData.status), 1 == o.orderData.status && wx.redirectTo({ url: "/pages/orderPaySuccess/orderPaySuccess?orderid=" + o.orderData.orderid - }), o.orderData.updatetime = r.changeTime(new Date(1e3 * o.orderData.updatetime)), + }), o.orderData.updatetime = r.changeTime(new Date(1e3 * o.orderData.updatetime)), n.setData({ showLoding: !1, ordercart: o.ordercart, @@ -143,7 +143,7 @@ Page({ return e.abrupt("return", !1); case 7: - return r.ispay = !0, n = r, e.prev = 9, e.next = 12, a.request(a.baseUrl + "shop/order/pay", { + return r.ispay = !0, n = r, e.prev = 9, e.next = 12, a.request("/shop/order/pay", { token: r.data.token, mark: r.data.tips }, !0); diff --git a/pages/orderPaySuccess/orderPaySuccess.js b/pages/orderPaySuccess/orderPaySuccess.js index ea3c5ff..6b8202e 100644 --- a/pages/orderPaySuccess/orderPaySuccess.js +++ b/pages/orderPaySuccess/orderPaySuccess.js @@ -1,4 +1,4 @@ -var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/slicedToArray"), t = require("../../@babel/runtime/helpers/asyncToGenerator"), i = (getApp(), +var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), r = require("../../@babel/runtime/helpers/slicedToArray"), t = require("../../@babel/runtime/helpers/asyncToGenerator"), i = (getApp(), require("../../utils/login.js")); require("../../utils/common.js"); @@ -22,7 +22,7 @@ Page({ return e.default.wrap(function(e) { for (;;) switch (e.prev = e.next) { case 0: - return n, e.prev = 1, a = n.data.orderid, e.next = 5, i.request(i.baseUrl + "shop/notify/paymentSuccessful", { + return n, e.prev = 1, a = n.data.orderid, e.next = 5, i.request("/shop/notify/paymentSuccessful", { orderid: a }, !0); diff --git a/pages/refund/refund.js b/pages/refund/refund.js index 03ceb56..c377a87 100644 --- a/pages/refund/refund.js +++ b/pages/refund/refund.js @@ -36,7 +36,7 @@ Page({ title: '查询中...' }) - t.request('/v2/miniprogram/refund/query', { mobile }, !0).then((res) => { + t.request('/miniprogram/refund/query', { mobile }, !0).then((res) => { wx.hideLoading() if (res.code == 200) { this.setData({ @@ -70,7 +70,7 @@ Page({ }) return } - t.request('/v2/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => { + t.request('/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => { wx.hideLoading() if (res.code == 200) { wx.showToast({ @@ -117,7 +117,7 @@ Page({ }) return } - t.request('/v2/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => { + t.request('/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => { wx.hideLoading() if (res.code == 200) { wx.showToast({ diff --git a/pages/substituteWash/substituteWash.js b/pages/substituteWash/substituteWash.js index 229136a..f7321b1 100644 --- a/pages/substituteWash/substituteWash.js +++ b/pages/substituteWash/substituteWash.js @@ -34,7 +34,7 @@ Page({ loading: true }); - e.request('/v2/miniprogram/substituteWash/index', {}, true).then(function (res) { + e.request('/miniprogram/substituteWash/index', {}, true).then(function (res) { a.setData({ loading: false }); @@ -93,7 +93,7 @@ Page({ mask: true }); - e.request('/v2/miniprogram/substituteWash/pay', { token: a.data.token }, true).then(function (res) { + e.request('/miniprogram/substituteWash/pay', { token: a.data.token }, true).then(function (res) { wx.hideLoading(); if (res.code === 200) { diff --git a/pages/user/user.js b/pages/user/user.js index 19302c0..d52140a 100644 --- a/pages/user/user.js +++ b/pages/user/user.js @@ -21,7 +21,7 @@ Page({ var n = this; wx.showLoading({ title: "" - }), e.request('/v2/miniprogram/user', {}, !0).then(function (t) { + }), e.request('/miniprogram/user', {}, !0).then(function (t) { if (wx.hideLoading(), 200 != t.code) return wx.showModal({ title: "提示", content: t.message @@ -65,13 +65,13 @@ Page({ sourceType: ['album', 'camera'], success: function (res) { wx.uploadFile({ - url: 'https://t-jm.v0750.com/miniprogram/upload', + url: 'https://t-jm.v0750.com/miniprogram/user/upload', filePath: res.tempFiles[0].tempFilePath, name: 'file', success: function (uploadRes) { var data = JSON.parse(uploadRes.data); if (data.code == 200) { - e.request('/v2/miniprogram/user/update', { + e.request('/miniprogram/user/update', { avatar: data.data.url }, true).then(function (res) { if (res.code == 200) { @@ -102,7 +102,7 @@ Page({ success: function (res) { if (res.confirm && res.content) { // 发送请求到后端,更新用户昵称 - e.request('/v2/miniprogram/user/update', { + e.request('/miniprogram/user/update', { nickname: res.content }, true).then(function (res) { if (res.code == 200) { diff --git a/pages/user/user.wxml b/pages/user/user.wxml index 284784b..9649b07 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -11,8 +11,8 @@ {{user.mobile}} - - + + diff --git a/pages/wangdian/wangdian.js b/pages/wangdian/wangdian.js index 3979f7d..34f74fe 100644 --- a/pages/wangdian/wangdian.js +++ b/pages/wangdian/wangdian.js @@ -100,7 +100,7 @@ Page({ }, // 获取网点详情信息 getBranchDetail() { - t.request('/v2/miniprogram/branch/detail', { + t.request('/miniprogram/branch/detail', { number: this.data.number, latitude: wx.getStorageSync('latitude'), longitude: wx.getStorageSync('longitude'), @@ -118,7 +118,7 @@ Page({ // 获取机器列表 getMachineList() { - t.request('/v2/miniprogram/branch/machine', { + t.request('/miniprogram/branch/machine', { number: this.data.number, }).then((res) => { if (res.code == 200) { diff --git a/pages/washCodeDetail/washCodeDetail.js b/pages/washCodeDetail/washCodeDetail.js index fb22a6d..86d1b44 100644 --- a/pages/washCodeDetail/washCodeDetail.js +++ b/pages/washCodeDetail/washCodeDetail.js @@ -20,7 +20,7 @@ Page({ var o = this; wx.showLoading({ title: "" - }), i.request('/v2/miniprogram/coupons/details', { + }), i.request('/miniprogram/coupons/details', { id: this.data.id }, !0).then(function (e) { if (wx.hideLoading(), 200 != e.code) return wx.showModal({ @@ -40,7 +40,7 @@ Page({ received: function () { if (this.isSubmit) return !1; var t = this; - this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/v2/miniprogram/coupons/receive', { + this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/miniprogram/coupons/receive', { id: t.data.id, token: t.data.info.token }, !0).then(function (e) { diff --git a/pages/washCodeList/washCodeList.js b/pages/washCodeList/washCodeList.js index 9834efb..924e070 100644 --- a/pages/washCodeList/washCodeList.js +++ b/pages/washCodeList/washCodeList.js @@ -59,7 +59,7 @@ Page({ if (this.isloading) return !1; wx.showLoading(), this.setData({ loading: !0 - }), this.isloading = !0, e.request('/v2/miniprogram/coupons/lists', { devicecode: t.globalData.devicecode }, !0).then(function (t) { + }), this.isloading = !0, e.request('/miniprogram/coupons/lists', { devicecode: t.globalData.devicecode }, !0).then(function (t) { if (o.isloading = !1, o.setData({ loading: !1 }), wx.hideLoading(), 200 != t.code) return wx.showModal({ @@ -86,7 +86,7 @@ Page({ success: function (i) { wx.showLoading({ title: "" - }), t.globalData.qrcode = i.result, e.request("/v2/miniprogram/identify/index", i, !0).then(function (e) { + }), t.globalData.qrcode = i.result, e.request("/miniprogram/identify/index", i, !0).then(function (e) { if (wx.hideLoading(), 200 != e.code) return wx.showModal({ title: "提示", content: e.message @@ -128,7 +128,7 @@ Page({ i.confirm && (a.isSubmit = !0, wx.showLoading({ title: "正在启动" - }), e.request('/v2/miniprogram/' + t.globalData.deviceData.type + '/carwashcodestartup', params, !0).then(function (t) { + }), e.request('/miniprogram/' + t.globalData.deviceData.type + '/carwashcodestartup', params, !0).then(function (t) { // 成功后返回提示 wx.showToast({ title: t.message || '启动成功', icon: 'success' }); // 成功后跳转 diff --git a/pages/washing/washing.js b/pages/washing/washing.js index 2373d54..bc2266c 100644 --- a/pages/washing/washing.js +++ b/pages/washing/washing.js @@ -19,7 +19,7 @@ Page({ */ onLoad(options) { var a = this; - e.request('/v2/miniprogram/index/balance', getApp().globalData.deviceData, !0).then(function (res) { + e.request('/miniprogram/index/balance', getApp().globalData.deviceData, !0).then(function (res) { if (!res.data || !res.data.progressorder) { wx.showToast({ title: '没有进行中的订单', @@ -117,7 +117,7 @@ Page({ content: '确定要结算此次洗车订单吗?', success: (res) => { if (res.confirm) { - e.request('/v2/miniprogram/' + getApp().globalData.deviceData.type + '/shutdown', { + e.request('/miniprogram/' + getApp().globalData.deviceData.type + '/shutdown', { orderid: this.data.orderid }, true).then((res) => { if (res.code === 200) { diff --git a/utils/login.js b/utils/login.js index 6e64184..eef1bb5 100644 --- a/utils/login.js +++ b/utils/login.js @@ -11,11 +11,14 @@ function t() { } function n(a) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + + var baseUrl = "https://t-jm.v0750.com/v3"; + + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; // a 是否 https, 如果不是自动补全 if (!/^https/.test(a)) { - a = 'https://t-jm.v0750.com' + a; + a = baseUrl + a; } // method 默认为 GET @@ -92,7 +95,7 @@ function n(a) { } function c(e, a) { - console.log("appstart", e), o = a, n("https://t-jm.v0750.com/v2/miniprogram/index", { + console.log("appstart", e), o = a, n("/miniprogram/index", { code: e }, !0).then(function (e) { var o = e.data; @@ -103,7 +106,6 @@ function c(e, a) { } module.exports = { - initial_url: "https://t-jm.v0750.com/miniprogram", login: t, request: n, pageStart: function (e) { @@ -120,9 +122,8 @@ module.exports = { c(res.code, e); }); }, - baseUrl: "https://t-jm.v0750.com/", getDevicecode: function (e, a) { - o = e, n("https://t-jm.v0750.com/v2/miniprogram/identify/reload", a, !0).then(function (e) { + o = e, n("/miniprogram/identify/reload", a, !0).then(function (e) { var a = e.data; if (e.code == 200) { o.globalData.deviceData = a || {};