refactor: 统一API路径前缀并更新静态资源域名
- 将所有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配置项
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user