|
@@ -95,7 +95,7 @@ export const useSync = () => {
|
|
|
const dataSyncFetch = async () => {
|
|
const dataSyncFetch = async () => {
|
|
|
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START)
|
|
chartEditStore.setEditCanvas(EditCanvasTypeEnum.SAVE_STATUS, SyncEnum.START)
|
|
|
try {
|
|
try {
|
|
|
- const res: any = await fetchProjectApi({ projectId: fetchRouteParamsLocation() })
|
|
|
|
|
|
|
+ const res = await fetchProjectApi({ projectId: fetchRouteParamsLocation() }) as unknown as MyResponseType
|
|
|
if (res.code === ResultEnum.SUCCESS) {
|
|
if (res.code === ResultEnum.SUCCESS) {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
updateStoreInfo(res.data)
|
|
updateStoreInfo(res.data)
|
|
@@ -135,7 +135,7 @@ export const useSync = () => {
|
|
|
// 上传预览图
|
|
// 上传预览图
|
|
|
let uploadParams = new FormData()
|
|
let uploadParams = new FormData()
|
|
|
uploadParams.append('object', base64toFile(canvasImage.toDataURL(), `${fetchRouteParamsLocation()}_index_preview.png`))
|
|
uploadParams.append('object', base64toFile(canvasImage.toDataURL(), `${fetchRouteParamsLocation()}_index_preview.png`))
|
|
|
- const uploadRes:any = await uploadFile(systemStore.getFetchInfo.OSSUrl, uploadParams)
|
|
|
|
|
|
|
+ const uploadRes = await uploadFile(systemStore.getFetchInfo.OSSUrl, uploadParams) as unknown as MyResponseType
|
|
|
// 保存预览图
|
|
// 保存预览图
|
|
|
if(uploadRes.code === ResultEnum.SUCCESS) {
|
|
if(uploadRes.code === ResultEnum.SUCCESS) {
|
|
|
await updateProjectApi({
|
|
await updateProjectApi({
|
|
@@ -148,7 +148,7 @@ export const useSync = () => {
|
|
|
let params = new FormData()
|
|
let params = new FormData()
|
|
|
params.append('projectId', fetchRouteParamsLocation())
|
|
params.append('projectId', fetchRouteParamsLocation())
|
|
|
params.append('content', JSON.stringify(chartEditStore.getStorageInfo || {}))
|
|
params.append('content', JSON.stringify(chartEditStore.getStorageInfo || {}))
|
|
|
- const res: any = await saveProjectApi(params)
|
|
|
|
|
|
|
+ const res= await saveProjectApi(params) as unknown as MyResponseType
|
|
|
|
|
|
|
|
if (res.code === ResultEnum.SUCCESS) {
|
|
if (res.code === ResultEnum.SUCCESS) {
|
|
|
// 成功状态
|
|
// 成功状态
|