调整接口地址

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

View File

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