Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uni.request中dataType为text,百度和其他小程序返回结果不一致 #558

Closed
bluestrings opened this issue Jul 16, 2019 · 1 comment
Assignees

Comments

@bluestrings
Copy link

uni.request({
	url: requestUrl,
	dataType: 'text',
	data: {
		noncestr: Date.now()
	},
	success: (res) => {
		this.result = typeof res.data;
	}
});

uni.request, 当我将dataType设置为text,百度小程序环境下typeof res.data是一个object,可是其他小程序(微信/支付宝)返回的是一个字符串,这个不一致问题需要业务代码进行额外处理了。
如果dataType是json,各个小程序环境是一致的。

@zhetengbiji
Copy link
Collaborator

百度小程序需要将值设置为“string”,后续框架将自动处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants