董国庆
昨天 df64b8405927e7fe3f9cfbae1f628b2d3b7a0f64
luyin
3个文件已修改
50 ■■■■ 已修改文件
H5/config/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/Appeal/Appeal.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/config/index.js
@@ -1,5 +1,5 @@
export default {
    // BASE_URL: 'https://huacheng.psciio.com',
    BASE_URL: 'http://192.168.110.188:6194',
    BASE_URL: 'https://3z8tsrt8s2uq.ngrok.xiaomiqiu123.top',
    imageUrl: 'https://huacheng.psciio.com/api/huacheng-applets/common/uploadimages',
}
H5/pages/Appeal/Appeal.vue
@@ -174,13 +174,13 @@
            problemType: '',
            name: '',
            contactNumber: '',
            location: '',
            detailedAddress: '',
            descriptionTitle: '',
            descriptionContent: '',
            videoContent: [],
            latitude: '',
            longitude: '',
                latitude: '30.5061493',
                longitude: '105.574542',
                location: '测试地址',
            images: [],
            videos: [],
            voiceFile: '',//语音文件多个逗号拼接
@@ -223,7 +223,11 @@
        },
        submitVoiceInput(e) {
            console.log('eeeeeeeeeeeeeeeeeee', e)
            this.videoContent.push({ url: e.url, data: e.data, playing: false });
                this.videoContent.push({
                    url: e.url,
                    data: e.data,
                    playing: false
                });
            this.voiceInputShow = false;
        },
        previewImage(index) {
@@ -270,16 +274,38 @@
                const uploadPromises = this.videoContent.map(item => {
                    return new Promise((resolve, reject) => {
                        console.log('item.data', item.data)
                            // uni.chooseAudio({
                            //     success:  (res)=> {
                            //         console.log(res.tempFilePaths[0]);
                            //         uni.uploadFile({
                            //             url: config.imageUrl,
                            //             filePath: res.tempFilePaths[0],  // 使用 Blob 数据
                            //             name: 'file',
                            //             header: {
                            //                 // 'Content-Type': 'multipart/form-data',
                            //                 'Authorization': uni.getStorageSync('token')
                            //             },
                            //             success: (uploadFileRes) => {
                            //                 const response = JSON.parse(uploadFileRes.data);
                            //                 if (response.code === 200) {
                            //                     resolve(response.data);
                            //                 } else {
                            //                     reject(new Error('上传失败'));
                            //                 }
                            //             },
                            //             fail: (error) => {
                            //                 reject(error);
                            //             }
                            //         });
                            //     }
                            // });
                        uni.uploadFile({
                            url: config.imageUrl,
                            file: item.data,
                                file: item.data, // 使用 Blob 数据
                            name: 'file',
                            // fileType: 'audio/mpeg',
                            // filePath: item.url,
                            // name: 'file',
                            header: {
                                'Content-Type': 'multipart/form-data',
                                'Authorization': uni.getStorageSync('token')
                                    // 'Content-Type': 'multipart/form-data',
                                    'Authorization': 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTU1MjI1Nzk1MDcwODEyMTgsInR5cGUiOjEsImV4cCI6MTc0Nzk4MzIyMiwiY3JlYXRlZCI6MTc0NjY4NzIyMjAxMX0.pmUfTkxkbBirDMbnMR1IaLsbSiiwHc366_yyAetCzTOWYxTNgmQlmvw26_W62NHLOebB_ZAEgZsPvkJcaLOoPg'
                            },
                            success: (uploadFileRes) => {
                                const response = JSON.parse(uploadFileRes.data);
H5/utils/request.js
@@ -20,7 +20,7 @@
    return new Promise(function(resolve, reject) {
        let token = uni.getStorageSync('token')
        token =
            'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTU1MjI1Nzk1MDcwODEyMTgsInR5cGUiOjEsImV4cCI6MTc0Nzk4MzIyMiwiY3JlYXRlZCI6MTc0NjY4NzIyMjAxMX0.pmUfTkxkbBirDMbnMR1IaLsbSiiwHc366_yyAetCzTOWYxTNgmQlmvw26_W62NHLOebB_ZAEgZsPvkJcaLOoPg'
            'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0OTAxMjMwMSwiY3JlYXRlZCI6MTc0NzcxNjMwMTM0OH0.8C2x0xHFW45XbehroA1uWziKsUdVHFck8VpIOVkS_s0KvAeTbFG7nIeEQEjGq0a8bn6kHIF3q58mJi4H34Q0Cg'
        uni.setStorageSync('token', token)
        let header = {
            'content-type': type ? 'application/x-www-form-urlencoded;charset=UTF-8' : 'application/json',