//hot vue
await getHotTabs()
/// request.js function request({url,data,method='get'}){ return new Promise((resolve,reject) =>{ uni.request({ url:BASE_URL+url, data, header: { icode:'2675B77047BD6659' }, method: method, success: ({ data, statusCode, header }) => { if(data.success){ resolve(data) }else{ uni.showToast({ title: data.message, icon: 'none', mask: true, duration:3000 }) reject(data.message) } }, fail: (error) => { reject(error) } }) }) } export default request
hot.js
import request from "../utils/requset"; export function getHotTabs () { return request({ url:'/hot/tabs', }) }
报错
12:18:31.134 项目 'mooc' 编译成功。前端运行日志,请另行在小程序开发工具的控制台查看。
13:49:42.488 正在差量编译...
13:49:43.175 Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):
13:49:43.175 语法错误: Unexpected token, expected ";" (32:10)
13:49:43.176 at pages\hot\hot.vue:32
13:50:25.262 正在差量编译...
13:50:25.262 Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):
13:50:25.262 语法错误: Unexpected token, expected ";" (32:10)
13:50:25.263 at pages\hot\hot.vue:32