@mpxjs/api-proxy
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "@mpxjs/api-proxy", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "convert miniprogram API at each end", | ||
@@ -5,0 +5,0 @@ "module": "src/index.js", |
@@ -14,3 +14,3 @@ import { changeOpts, handleSuccess, getEnvObj, error, warn, noop } from '../utils' | ||
getSystemInfo (options) { | ||
getSystemInfo (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -33,3 +33,3 @@ | ||
getSystemInfoSync () { | ||
let res = ALI_OBJ.getSystemInfoSync() | ||
let res = ALI_OBJ.getSystemInfoSync() || {} | ||
@@ -50,3 +50,3 @@ res.system = `${res.platform} ${res.system}` | ||
showToast (options) { | ||
showToast (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -59,4 +59,4 @@ title: 'content', | ||
hideToast (options) { | ||
if (options && (options.success || options.fail || options.complete)) { | ||
hideToast (options = {}) { | ||
if (options.success || options.fail || options.complete) { | ||
warn(`${TIPS_NAME}.hideToast 不支持 success/fail/complete 参数`) | ||
@@ -67,3 +67,3 @@ } | ||
showModal (options) { | ||
showModal (options = {}) { | ||
let opts | ||
@@ -91,3 +91,3 @@ | ||
showLoading (options) { | ||
showLoading (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -99,3 +99,3 @@ title: 'content' | ||
hideLoading (options) { | ||
hideLoading (options = {}) { | ||
if (options.success || options.fail || options.complete) { | ||
@@ -107,3 +107,3 @@ warn(`${TIPS_NAME}.hideLoading 不支持 success/fail/complete 参数`) | ||
showActionSheet (options) { | ||
showActionSheet (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -132,3 +132,3 @@ itemList: 'items' | ||
showNavigationBarLoading (options) { | ||
showNavigationBarLoading (options = {}) { | ||
if (options.success || options.fail || options.complete) { | ||
@@ -140,3 +140,3 @@ warn(`${TIPS_NAME}.showNavigationBarLoading 不支持 success/fail/complete 参数`) | ||
hideNavigationBarLoading (options) { | ||
hideNavigationBarLoading (options = {}) { | ||
if (options.success || options.fail || options.complete) { | ||
@@ -148,7 +148,7 @@ warn(`${TIPS_NAME}.hideNavigationBarLoading 不支持 success/fail/complete 参数`) | ||
setNavigationBarTitle (options) { | ||
setNavigationBarTitle (options = {}) { | ||
ALI_OBJ.setNavigationBar(options) | ||
}, | ||
setNavigationBarColor (options) { | ||
setNavigationBarColor (options = {}) { | ||
ALI_OBJ.setNavigationBar(options) | ||
@@ -161,3 +161,3 @@ }, | ||
request (options) { | ||
request (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -183,3 +183,3 @@ header: 'headers' | ||
downloadFile (options) { | ||
downloadFile (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -194,3 +194,3 @@ | ||
uploadFile (options) { | ||
uploadFile (options = {}) { | ||
const opts = changeOpts(options, { name: 'fileName' }) | ||
@@ -232,3 +232,3 @@ | ||
previewImage (options) { | ||
previewImage (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -244,3 +244,3 @@ | ||
compressImage (options) { | ||
compressImage (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -264,3 +264,3 @@ quality: '' | ||
chooseImage (options) { | ||
chooseImage (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -279,3 +279,3 @@ | ||
getLocation (options) { | ||
getLocation (options = {}) { | ||
if (options.aliType === undefined && options.type) { | ||
@@ -301,3 +301,3 @@ warn(`如果要针对支付宝设置 ${TIPS_NAME}.getLocation 中的 type 参数,请使用 aliType, 取值为 0~3`) | ||
saveFile (options) { | ||
saveFile (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -314,3 +314,3 @@ tempFilePath: 'apFilePath' | ||
removeSavedFile (options) { | ||
removeSavedFile (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -327,3 +327,3 @@ filePath: 'apFilePath' | ||
getSavedFileList (options) { | ||
getSavedFileList (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -348,3 +348,3 @@ filePath: 'apFilePath' | ||
getSavedFileInfo (options) { | ||
getSavedFileInfo (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -357,3 +357,3 @@ filePath: 'apFilePath' | ||
getFileInfo (options) { | ||
getFileInfo (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -370,3 +370,3 @@ filePath: 'apFilePath' | ||
addPhoneContact (options) { | ||
addPhoneContact (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -379,3 +379,3 @@ weChatNumber: 'alipayAccount' | ||
setClipboardData (options) { | ||
setClipboardData (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -388,3 +388,3 @@ data: 'text' | ||
getClipboardData (options) { | ||
getClipboardData (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -399,3 +399,3 @@ | ||
setScreenBrightness (options) { | ||
setScreenBrightness (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -408,3 +408,3 @@ value: 'brightness' | ||
getScreenBrightness (options) { | ||
getScreenBrightness (options = {}) { | ||
const opts = changeOpts(options) | ||
@@ -419,3 +419,3 @@ | ||
makePhoneCall (options) { | ||
makePhoneCall (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -428,3 +428,3 @@ phoneNumber: 'number' | ||
stopAccelerometer (options) { | ||
stopAccelerometer (options = {}) { | ||
ALI_OBJ.offAccelerometerChange(options) | ||
@@ -437,3 +437,3 @@ }, | ||
stopCompass (options) { | ||
stopCompass (options = {}) { | ||
ALI_OBJ.offCompassChange(options) | ||
@@ -446,3 +446,3 @@ }, | ||
stopGyroscope (options) { | ||
stopGyroscope (options = {}) { | ||
ALI_OBJ.offGyroscopeChange(options) | ||
@@ -455,3 +455,3 @@ }, | ||
scanCode (options) { | ||
scanCode (options = {}) { | ||
const opts = changeOpts(options, { | ||
@@ -488,3 +488,3 @@ onlyFromCamera: 'hideAlbum', | ||
login (options) { | ||
login (options = {}) { | ||
let opts | ||
@@ -509,3 +509,3 @@ | ||
getUserInfo (options) { | ||
getUserInfo (options = {}) { | ||
if (options.withCredentials === true) { | ||
@@ -541,3 +541,3 @@ warn(`支付宝不支持在 ${TIPS_NAME}.getUserInfo 使用 withCredentials 参数中获取等敏感信息`) | ||
requestPayment (options) { | ||
requestPayment (options = {}) { | ||
if (!options.tradeNO) { | ||
@@ -573,3 +573,3 @@ error(`请在支付函数 ${TIPS_NAME}.requestPayment 中添加 tradeNO 参数用于支付宝支付`) | ||
createCanvasContext (canvasId) { | ||
createCanvasContext (canvasId = {}) { | ||
let ctx = ALI_OBJ.createCanvasContext(canvasId) | ||
@@ -582,3 +582,3 @@ | ||
canvasToTempFilePath (options) { | ||
canvasToTempFilePath (options = {}) { | ||
if (!CANVAS_MAP[options.canvasId]) { | ||
@@ -603,3 +603,3 @@ error(`支付宝调用 ${TIPS_NAME}.toTempFilePath 方法之前需要先调用 ${TIPS_NAME}.createCanvasContext 创建 context`) | ||
canvasPutImageData (options) { | ||
canvasPutImageData (options = {}) { | ||
if (!CANVAS_MAP[options.canvasId]) { | ||
@@ -622,3 +622,3 @@ error(`支付宝调用 ${TIPS_NAME}.putImageData 方法之前需要先调用 ${TIPS_NAME}.createCanvasContext 创建 context`) | ||
canvasGetImageData (options) { | ||
canvasGetImageData (options = {}) { | ||
if (!CANVAS_MAP[options.canvasId]) { | ||
@@ -642,3 +642,3 @@ error(`支付宝调用 ${TIPS_NAME}.getImageData 方法之前需要先调用 ${TIPS_NAME}.createCanvasContext 创建 context`) | ||
createSelectorQuery (options) { | ||
createSelectorQuery (options = {}) { | ||
let query = ALI_OBJ.createSelectorQuery(options) | ||
@@ -645,0 +645,0 @@ let cbs = [] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28029