
function base64src(data, fileName) {
	const fsm = wx.getFileSystemManager()
	if (!data) return
	fsm.writeFile({
		filePath: `wx.env.USER_DATA_PATH+'/${fileName}.png'`,
		data: data.slice(22),
		encoding:'base64',
		success: res => {
			wx.saveImageToPhotosAlbum({
				filePath: `wx.env.USER_DATA_PATH + '/${fileName}.png'`,
				success: function (res) {
					wx.showToast({
						title: '保存成功',
					})
				},
				fail: function (err) {
					console.log(err)
				}
			})
			// console.log(res)
		}, fail: err => {
			console.log(err)
		}
	})
}

export { base64src };