When you first write a small program, you can always report pad block error or error when you click on it. When you click on it again, you can see the error and then click on it again. Wx. login to get the code in the getPhoneNumber method. The correct procedure is: Go to the page and get the code and then get the session_key with the code and pass the session_key and the encryption argument to the back end and get the decrypted data

onLoad() {
    let that = this
    uni.login({
            success(res) {
                    if(res.errMsg == "login:ok") {
                            that.code = res.code
                    } else {
                            uni.showToast({
                                    title: "System exception, please contact administrator!"})}}})}Copy the code

Get the code and assign it to getPhonenumber and get the session_key.