在validate校驗函數內,使用async異步函數 async handleLogin() { this.$refs.form.validate(async (valid) => { if (valid) { // 獲取公鑰 await this.getEncrypte() } }) },