const BASE_URL = '/baoxiu/repairApi'
export const myRequest = (options) => {
  return new Promise((resolve, reject) => {
    uni.request({
      url: BASE_URL + options.url,
      method: options.method || 'GET',
      data: options.data || {},
      header: { token: uni.getStorageSync('token') } || options.header,
      // header: {
      //   token:
      //     'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM4OTQ1MzAsInVzZXJJZCI6IjIwMTkwMjEwMjMwMTMyIn0.m36xA71_0kEpvNIF1qETH0s9c1IwYLGi1LmWARUAP8M',
      // },
      success: (res) => {
        // if (res.data.status !== "200") {
        // 	return uni.showToast({
        // 		title: "获取数据失败"
        // 	})
        // }
        resolve(res.data)
      },
      fail: (err) => {
        uni.showToast({
          title: '请求接口失败',
        })
        reject(err)
      },
    })
  })
}
