showToast_fail parameter error_ parameter.title should be String instead of undefined

I encountered the following error in the uniapp project:

Please add image description

analyze:

The parameter title of showToast should be a string, but no value was found.

solve:

  1. First find the showToast in the page and know that the parameter title is the data returned by the backend (as shown below)
uni.showToast({
    
    
	icon: 'none',
	title: res.data.msg,
	mask: true,
	duration: 2000
})
  1. Then check the data returned by the backend and find that there is no msg field, but message. Just modify it.

Insert image description here

Guess you like

Origin blog.csdn.net/Joye_7y/article/details/125957877