|
@@ -0,0 +1,22 @@
|
|
|
|
+import { baseURL } from './base,js'
|
|
|
|
+
|
|
|
|
+export const request = (option)=>{
|
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
|
+ uni.request({
|
|
|
|
+ url::baseURL+option.url,
|
|
|
|
+ method:option.method,
|
|
|
|
+ data:option.data,
|
|
|
|
+ Headers:{
|
|
|
|
+ // "Authorization":window.localStorage.getItem('token')
|
|
|
|
+ },
|
|
|
|
+ success:(res)=>{
|
|
|
|
+ console.log(res )
|
|
|
|
+ resolve(res)
|
|
|
|
+ },
|
|
|
|
+ fail:(error)=>{
|
|
|
|
+ console.log(error)
|
|
|
|
+ reject(error)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+}
|