吉安感知网项目-前端
张含笑
2026-01-13 9d664c63d42aa8b3ea1ef071629ee2183fd13497
feat:修改请求头
1 files modified
10 ■■■■■ changed files
applications/mobile-web-view/src/axios.js 10 ●●●●● patch | view | raw | blame | history
applications/mobile-web-view/src/axios.js
@@ -56,10 +56,12 @@
        //安全请求header
        config.headers['Blade-Requested-With'] = 'BladeHttpRequest'
        //headers判断是否需要
        const authorization = config.authorization === false
        if (!authorization) {
            config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`
        }
        // const authorization = config.authorization === false
        // if (!authorization) {
        //     config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`
        // }
        let authorization = store.state.user.token
        config.headers['Authorization'] = authorization
        // 根据后端要求,post的data为空的话传{}
        if (config.method === 'post') {
            config.data = config.data || {}