<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script><script>// 1. new一个promise对象var promiseObj = new Promise(function(resolve, reject) {$.ajax({url: 'http://huruqing.cn:3000/api/film/getList',data: {},type: 'get',success: function(res) {resolve(res);},error: function(err) {reject(err);}})})// 2. 获取数据promiseObj.then(function(res) {console.log(res);}).catch(function(err) {console.log(err);})</script>
