马宇豪
2024-08-29 893ff90c6e21fa3a5241a8ae9b33836037cd5912
common/request.js
@@ -3,7 +3,6 @@
let server_url = VUE_APP_BASE_URL;
let token = uni.getStorageSync('tk');
export function service(options = {}) {
   console.log(("option",options))
   options.url = `${server_url}${options.url}`;
   //配置请求头
   if(uni.getStorageSync('tk')){
@@ -23,7 +22,7 @@
      //成功
      options.success = (res) => {
         // if (Number(res.data.code) == 100) {
         if(Number(res.data.code) == 403){
         if(Number(res.data.code) == 403 || Number(res.data.code) == 401){
            uni.showToast({
               icon: 'none',
               duration: 2000,
@@ -70,8 +69,8 @@
            icon: "none",
            title: '服务响应失败'
         });
         uni.clearStorageSync();
         uni.clearStorage();
         uni.clearStorageSync()
         uni.clearStorage()
         uni.navigateTo({
            url: '/pages/index/index'
         })