This commit is contained in:
2025-11-20 18:39:26 +08:00
256 changed files with 14256 additions and 2795091 deletions

View File

@@ -0,0 +1,13 @@
let baseUrl = ""
// #ifdef MP-WEIXIN
// 编译项目因为使用插件lime-echartechart文件过大需要非压缩代码方式编译不然会很慢发布的时候才压缩代码方式编译
if (wx.getAccountInfoSync().miniProgram.envVersion === 'develop') {
baseUrl = 'https://localhost:7026' // 开发环境
} else {
baseUrl = 'https://yanxueapi.51xuanxiao.com' // 生产环境
}
// #endif
export {
baseUrl
}

1
packageCa/utilCa/echarts.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
// 公共图片基地址
const BASE_IMAGE_URL = 'https://51xuanxiao.oss-cn-hangzhou.aliyuncs.com/Resource/xcx_sygh';
/**
* 图片地址拼接方法
* @param {string} path - 图片路径(相对于基地址的路径)
* @param {string} [process] - OSS图片处理参数例如'image/resize,m_fixed,w_348/quality,q_80'
* @returns {string} 完整的图片URL
*/
export function ossImageUrl(path, process) {
// 如果有处理参数,拼接处理参数
if (process) {
return `${BASE_IMAGE_URL}/${path}?x-oss-process=${process}`;
}
// 没有处理参数时,直接返回原始路径
return `${BASE_IMAGE_URL}/${path}`;
}

View File

@@ -0,0 +1,48 @@
import { baseUrl} from './config.js'
const request = {}
const headers = {}
request.globalRequest = (url, method, data, power, type) => {
// 权限判断 因为有的接口请求头可能需要添加的参数不一样,所以这里做了区分
// 1 == 不通过access_token校验的接口
// 2 == 文件下载接口列表
const userInfo = uni.getStorageSync('CAuserInfo')
headers['Token'] = userInfo.token
return uni.request({
timeout: 60000,
url: baseUrl + url,
method,
data: data,
dataType: 'json',
header: headers
}).then(res => {
if (res.data.Result) {
return res.data
} else {
throw res.data
}
}).catch(parmas => {
switch (parmas.status) {
case 401:
uni.showToast({
title: parmas.msg,
icon: 'none',
duration: 3500
})
uni.removeStorageSync("CAuserInfo");
setTimeout(() => {
uni.reLaunch({
url: "/pages/index/index"
})
}, 2800)
break
default:
console.error(parmas);
return Promise.reject()
break
}
})
}
export default request