api/global.js
@@ -1,5 +1,8 @@
// import request from '@/config/request';
import { BaseUrl } from '@/utils/request.js'
import {
   BaseUrl
} from '@/utils/request.js'
// import { resolve } from 'node:path/win32';
// let BaseUrl = "/";
// const CURRENT_KEY = 'CURRENT_KEY';
@@ -98,6 +101,52 @@
   })
}
function logout() {
   uni.request({
         url: `${BaseUrl}/auth/token/logout`,
         method: 'DELETE',
         header: {
            'TENANT-ID': 5,
            Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
            VERSION: 'zzl'
         }
      })
      .then(res => {
         console.log('缓存清理成功');
         uni.showToast({
            title: '到达登录页!'
         });
      })
      .catch(err => {
         uni.showToast({
            title: '缓存清理失败!'
         });
      });
}
// 删除撤回申请接口
function deleteWithDrawApplicationGlobal(id) {
   return new Promise((resolve, reject) => {
      uni.request({
         url: `${BaseUrl}/yunxiao/xswaybill/${id}`,
         method: 'DELETE',
         header: {
            'TENANT-ID': 5,
            Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
            VERSION: 'zzl'
         },
         success: (res) => {
            resolve(res.data);
         },
         fail:(err) => {
            uni.showToast({
               title: '删除出错',
               icon: 'none'
            });
         }
      })
   })
}
@@ -109,5 +158,7 @@
export default {
   apiLogin,
   wxSmallLogin
   wxSmallLogin,
   logout,
   deleteWithDrawApplicationGlobal
}