ZaiZai 1 year ago
parent
commit
951ad7fa17

+ 3 - 3
httpApi/modules/upload.js

@@ -5,10 +5,10 @@ import {getAppApiUrl} from "@/config/envApi";
 export const getUploadApi = () => {
     let url = '';
     //#ifdef H5
-        url = '/api/blade-resource/oss/endpoint/upload-file';
+        url = '/api/';
     //#endif
     //#ifdef APP-PLUS
-        url = getAppApiUrl() + 'blade-resource/oss/endpoint/upload-file'
+        url = getAppApiUrl()
     //#endif
     return url
 }
@@ -16,7 +16,7 @@ export const getUploadApi = () => {
 export const uploadApi = async (file, form= {}) => {
     return new Promise((resolve) => {
         uni.uploadFile({
-            url: getUploadApi(),
+            url: getUploadApi() + 'blade-resource/oss/endpoint/upload-file',
             name: 'file',
             formData: form,
             header: getTokenHeader(),

+ 4 - 3
pages/data-fill/fileUp.vue

@@ -28,6 +28,7 @@ import wbsApi from '~api/data-fill/wbs';
 import {errorToast, openDocFile, successToast, toPdfPreview} from "@/utils/tools";
 import {getArrValue, getObjValue} from "js-fast-way";
 import {getTokenHeader} from "@/httpApi/request/header";
+import {getUploadApi} from "@/httpApi/modules/upload";
 
 const store = useAppStore()
 
@@ -90,7 +91,7 @@ const selectFileChange = ({file, path}) => {
     if(file) {
         uni.showLoading({title: '上传文件中...', mask: true})
         uni.uploadFile({
-            url: '/api/blade-manager/exceltab/add-buss-file',
+            url: getUploadApi() + 'blade-manager/exceltab/add-buss-file',
             name: 'file',
             file: file,
             filePath: path,
@@ -124,7 +125,7 @@ const setUploadFile = async (arr) => {
 const uploadFileApi = async (file) => {
     return new Promise((resolve) => {
         uni.uploadFile({
-            url: '/api/blade-manager/exceltab/add-buss-file',
+            url: getUploadApi() + 'blade-manager/exceltab/add-buss-file',
             name: 'file',
             filePath: file,
             formData: pageNode.value,
@@ -161,7 +162,7 @@ const fileTap = async({url, extension}) => {
     const img = ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp']
     if(word.indexOf(extension) !== -1) {
         if(extension === 'pdf') {
-            toPdfPreview(url)
+            toPdfPreview(url).then()
         } else {
             openDocFile(url, extension)
         }

+ 1 - 1
pages/image/form.vue

@@ -85,11 +85,11 @@
 
 <script setup>
 import {ref} from "vue";
+import {onLoad, onReady} from '@dcloudio/uni-app'
 import mainApi from '~api/image/index';
 import {uploadApi} from '~api/upload';
 import {getObjValue, isString} from "js-fast-way";
 import {errorToast, formValidate, successToast} from "@/utils/tools";
-import {onLoad, onReady} from '@dcloudio/uni-app'
 import {chooseImage, chooseVideo} from "@/utils/utils";
 import {useAppStore} from "@/store";
 import dayjs from "dayjs";

+ 1 - 1
pages/image/position.vue

@@ -35,7 +35,7 @@
 
 <script setup>
 import {ref} from "vue";
-import {onLoad, onShow} from '@dcloudio/uni-app'
+import {onLoad} from '@dcloudio/uni-app'
 import treeApi from '~api/ledger/index';
 import {useAppStore} from "@/store";
 import {getArrValue, getObjValue} from "js-fast-way";

+ 2 - 2
pages/ledger/linkTab.vue

@@ -31,8 +31,8 @@
 </template>
 
 <script setup>
-import {ref, onMounted, nextTick, getCurrentInstance} from "vue";
-import {onLoad, onShow, onUnload} from '@dcloudio/uni-app'
+import {ref, nextTick, getCurrentInstance} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
 import {getArrValue, getObjValue} from "js-fast-way";
 import wbsApi from '~api/data-fill/wbs';
 import mainApi from '~api/ledger/index';

+ 2 - 1
pages/my/index.vue

@@ -131,6 +131,7 @@ import {onShow, onHide, onPageScroll} from '@dcloudio/uni-app'
 import {errorToast, successToast} from "@/utils/tools";
 import {getTokenHeader} from "@/httpApi/request/header";
 import {getObjValue} from "js-fast-way";
+import {getUploadApi} from "@/httpApi/modules/upload";
 import {useAppStore} from "@/store";
 
 //初始变量
@@ -201,7 +202,7 @@ const uploadAvatarFile = async (file) => {
 const uploadFile = async (file) => {
     return new Promise((resolve) => {
         uni.uploadFile({
-            url: '/api/blade-resource/oss/endpoint/put-file',
+            url: getUploadApi() + 'blade-resource/oss/endpoint/put-file',
             name: 'file',
             filePath: file,
             header: getTokenHeader(),

+ 3 - 2
pages/my/info.vue

@@ -40,7 +40,8 @@
 </template>
 
 <script setup>
-import {ref, onMounted} from "vue";
+import {ref} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
 import {errorToast, formValidate, successToast} from "@/utils/tools";
 import mainApi from '~api/user/index';
 import {getObjValue} from "js-fast-way";
@@ -51,7 +52,7 @@ const formRef = ref(null)
 const userInfo = ref({});
 
 //渲染完成
-onMounted(() => {
+onLoad(() => {
     getUserData()
     formRef.value?.setRules(formRules.value)
 })

+ 3 - 2
pages/my/project.vue

@@ -49,7 +49,8 @@
 </template>
 
 <script setup>
-import {ref, onMounted, nextTick} from "vue";
+import {ref, nextTick} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
 import {useAppStore} from "@/store";
 import mainApi from "~api/user/project";
 import {errorToast, successToast} from "@/utils/tools";
@@ -64,7 +65,7 @@ const projectId = ref('');
 const contractId = ref('');
 
 //渲染完成
-onMounted(() => {
+onLoad(() => {
     projectInfo.value = deepClone({
         pid: store.projectId,
         cid: store.contractId

+ 3 - 2
pages/my/record.vue

@@ -73,7 +73,8 @@
 </template>
 
 <script setup>
-import {ref, onMounted} from "vue";
+import {ref} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
 import {useAppStore} from "@/store";
 import {errorToast} from "@/utils/tools";
 
@@ -84,7 +85,7 @@ const projectId = ref(store.projectId);
 const contractId = ref(store.contractId);
 
 //渲染完成
-onMounted(() => {
+onLoad(() => {
 
 })
 

+ 4 - 3
pages/report/report.vue

@@ -47,8 +47,9 @@
 </template>
 
 <script setup>
-import {ref, onMounted, nextTick, getCurrentInstance} from "vue";
-import { ApprovalApi, queryFixedFlow } from '~api/other/index'
+import {ref, nextTick, getCurrentInstance} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
+import {ApprovalApi, queryFixedFlow} from '~api/other/index'
 import {arrIndex, getArrValue, getObjValue} from "js-fast-way";
 import {errorToast, successToast, formValidate} from "@/utils/tools";
 import flowApi from '~api/tasks/flow'
@@ -58,7 +59,7 @@ const instance = getCurrentInstance().proxy
 const props = ref({})
 
 //渲染完成
-onMounted(async () => {
+onLoad(async () => {
     await getEventChannel();
     getFixedFlowDataApi().then();
     // 设置自定义表单校验规则,必须在节点渲染完毕后执行

+ 4 - 3
pages/report/tasks-user.vue

@@ -23,8 +23,9 @@
 </template>
 
 <script setup>
-import {ref, onMounted, nextTick, getCurrentInstance} from "vue";
-import { checkFlowUser, checkFlowUserQuery } from '~api/other/index'
+import {ref, nextTick, getCurrentInstance} from "vue";
+import {onLoad} from '@dcloudio/uni-app'
+import {checkFlowUser, checkFlowUserQuery} from '~api/other/index'
 import {getArrValue, getObjValue} from "js-fast-way";
 import {errorToast} from "@/utils/tools";
 import flowApi from '~api/tasks/flow'
@@ -34,7 +35,7 @@ const instance = getCurrentInstance().proxy
 const props = ref({})
 
 //渲染完成
-onMounted(async () => {
+onLoad(async () => {
     await getEventChannel();
     queryAllRoleList().then()
 })

+ 1 - 1
pages/task/index.vue

@@ -91,8 +91,8 @@
 
 <script setup>
 import {nextTick, ref, watch} from "vue";
-import mainApi from '~api/tasks/data';
 import {onLoad} from '@dcloudio/uni-app'
+import mainApi from '~api/tasks/data';
 import {errorToast, successToast} from "@/utils/tools";
 import {arrToKey, getArrValue, getObjValue} from "js-fast-way";
 import {useAppStore} from "@/store";