doum
2025-09-11 7298d5354963a88643a543b51b90192dc9fc934c
h5_meeting/utils/service.js
@@ -2,29 +2,31 @@
export const http = function (options) {
   {
      return new Promise((resolve, reject) => {
         let token = uni.getStorageSync('token') || ''
         // let token = uni.getStorageSync('token') || ''
         // 在登录的时候需要储存 token uni.setStorageSync("authorization","这里是登录获取的token值")
         // uni.showLoading({
         //    title:"加载中..."
         // })
         uni.showLoading({
            title: '加载中',
            mask: true
         })
         // uni.showLoading({
         //    title: '加载中',
         //    mask: true
         // })
         const param = uni.getStorageSync('param') || {}
         uni.request({
            url: baseUrl + options.url,
            url: (param.baseUrl || baseUrl) + options.url,
            // url: baseUrl + options.url,
            data: options.data || {},
            method: options.method || 'GET',
            header: options.header || {
               // 根据实际接口设计 key 取 token 或者 authorization
               dm_user_token: token,
               // dm_user_token: token,
               "content-type": 'application/json;charset=UTF-8'
            },
            success: (res) => {
               let data = res.data
               // 控制台显示数据信息
               uni.hideLoading()
               // uni.hideLoading()
               // 登录过期
               if (data.code === 5112) {
                  setTimeout(() => {
@@ -62,7 +64,7 @@
               console.log('msg', baseUrl + options.url)
               // 返回错误消息
               reject(err)
               uni.hideLoading()
               // uni.hideLoading()
            },
            catch: (e) => {
               console.log(e)