调整接口地址

This commit is contained in:
qiaomu 2024-11-26 09:41:22 +08:00
parent 883461c852
commit cfad35ec52
2 changed files with 17 additions and 15 deletions

View File

@ -59,12 +59,13 @@ Page({
// 开发版
case 'develop':
// api = `http://localhost:9001`;
// api = `https://zgd.hbhcbn.com/recharge-print-api`;
api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
// api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
break;
// 体验版
case 'trial':
api = `https://zgd.hbhcbn.com/recharge-print-api-test`;
// api = `https://zgd.hbhcbn.com/recharge-print-api`;
break;
// 正式版
case 'release':
@ -84,14 +85,14 @@ Page({
alertInfo("下载文件失败")
return;
}
const fs = wx.getFileSystemManager()
const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf`
fs.rename({
oldPath: res.tempFilePath,
newPath: newPath,
success(r) {
// const fs = wx.getFileSystemManager()
// const newPath = `${wx.env.USER_DATA_PATH}/收据-${detail.time.slice(0, 10)}.pdf`
// fs.rename({
// oldPath: res.tempFilePath,
// newPath: newPath,
// success(r) {
wx.openDocument({
filePath: newPath,
filePath: res.tempFilePath,
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了
success: function (res) {
resolve()
@ -101,13 +102,13 @@ Page({
console.log('打开失败错误为', e)
rej()
}
});
},
fail(res) {
console.error(res)
alertInfo("下载失败")
rej()
}
// });
// },
// fail(res) {
// console.error(res)
// alertInfo("下载失败")
// rej()
// }
})

View File

@ -54,6 +54,7 @@ export function getConfigByEnv() {
// 体验版
case 'trial':
api = "https://zgd.hbhcbn.com/wxApi"
// api = "https://zgd.hbhcbn.com/api3"
break;
// 正式版
case 'release':