修复谷歌登录、红绿图丢失、submit后颜色有问题
This commit is contained in:
@@ -298,7 +298,6 @@ export default defineComponent({
|
||||
// 0.35822305
|
||||
// ]
|
||||
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
||||
console.log(isCurrent,newData)
|
||||
let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)?
|
||||
(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
|
||||
(list[i].color?.rgba?.r?
|
||||
@@ -379,6 +378,7 @@ export default defineComponent({
|
||||
delete detailData.designDetail.newModel
|
||||
store.commit('DesignDetail/setPraeview',value)
|
||||
detailData.loadingShow = false
|
||||
canvasReload()
|
||||
// setRevocation()
|
||||
}).catch(res=>{
|
||||
detailData.loadingShow = false
|
||||
|
||||
@@ -193,7 +193,7 @@ export default defineComponent({
|
||||
let front = detailData.frontBack.front[detailData.imgDomIndex]
|
||||
let back = detailData.frontBack.back[detailData.imgDomIndex]
|
||||
if(!front?.oldImageUrl)front.oldImageUrl = front.imageUrl
|
||||
if(!front?.oldMaskUrl)front.oldMaskUrl = front.imageUrl
|
||||
if(!front?.oldMaskUrl)front.oldMaskUrl = front.maskUrl
|
||||
if(!back?.oldImageUrl)back.oldImageUrl = back.imageUrl
|
||||
if(!front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.oldMaskUrl})
|
||||
|
||||
@@ -218,7 +218,6 @@ export default defineComponent({
|
||||
detailData.isShowMark = true
|
||||
}
|
||||
const index = detailData.designDetail.clothes.findIndex(item => item.id === detailData.selectDetail.id);
|
||||
console.log(index,detailData.selectDetail.id)
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
if(!detailDom?.editCanvas)return resolve()
|
||||
let canvasJSON = detailDom?.editCanvas?.getJSON()
|
||||
@@ -261,7 +260,7 @@ export default defineComponent({
|
||||
if(front?.oldImageUrl)front.imageUrl = front.oldImageUrl
|
||||
if(front?.oldMaskUrl)front.maskUrl = front.oldMaskUrl
|
||||
if(back?.oldImageUrl)back.imageUrl = back.oldImageUrl
|
||||
if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.oldMaskUrl})
|
||||
if(front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.maskUrl})
|
||||
|
||||
sessionStorage.removeItem('frontBackEdit');
|
||||
sessionStorage.removeItem('sketchEdit');
|
||||
|
||||
@@ -74,29 +74,29 @@ export default defineComponent({
|
||||
},{immediate:true})
|
||||
const selectDetailItem = (item:any,index:number)=>{
|
||||
new Promise((resolve, reject) => {
|
||||
// if(detailData.isEditPattern.value &&
|
||||
// detailData.selectDetail?.id &&
|
||||
// detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0
|
||||
// ){
|
||||
// Modal.confirm({
|
||||
// title: t('collectionModal.jsContent2'),
|
||||
// icon: createVNode(ExclamationCircleOutlined),
|
||||
// okText: 'Yes',
|
||||
// cancelText: 'No',
|
||||
// mask:false,
|
||||
// centered:true,
|
||||
// onOk() {
|
||||
// resolve(true)
|
||||
// emit('canvasReload')
|
||||
// },
|
||||
// onCancel(){
|
||||
// resolve(false)
|
||||
// }
|
||||
// });
|
||||
// }else{
|
||||
if(detailData.isEditPattern.value &&
|
||||
detailData.selectDetail?.id &&
|
||||
detailData?.getCanvasIfEdit?.fun&&detailData?.getCanvasIfEdit?.fun() > 0
|
||||
){
|
||||
Modal.confirm({
|
||||
title: t('collectionModal.jsContent6'),
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
centered:true,
|
||||
onOk() {
|
||||
resolve(true)
|
||||
emit('canvasReload')
|
||||
},
|
||||
onCancel(){
|
||||
resolve(false)
|
||||
}
|
||||
});
|
||||
}else{
|
||||
resolve(true)
|
||||
emit('canvasReload')
|
||||
// }
|
||||
}
|
||||
}).then((rv)=>{
|
||||
if(rv)store.commit('DesignDetail/setDesignColthes',item.id)
|
||||
})
|
||||
|
||||
@@ -236,38 +236,41 @@ export default defineComponent({
|
||||
// }
|
||||
}
|
||||
const itemMoveMousedown = async (index:any,e:any)=>{
|
||||
if(detailData.selectDetail.id != detailData.frontBack.front[index].id)return
|
||||
let isOpen = false
|
||||
let isModal = false
|
||||
await new Promise((resolve, reject) => {
|
||||
if(
|
||||
detailData.isEditPattern.value &&
|
||||
selectItem.selectDetail?.id &&
|
||||
(detailData.frontBack.front[index].id != selectItem.selectDetail.id)
|
||||
){
|
||||
isModal = true
|
||||
Modal.confirm({
|
||||
title: t('collectionModal.jsContent2'),
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
centered:true,
|
||||
onOk() {
|
||||
resolve(true)
|
||||
isOpen = true
|
||||
},
|
||||
onCancel(){
|
||||
resolve(false)
|
||||
isOpen = false
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){
|
||||
isOpen = true
|
||||
}
|
||||
resolve(true)
|
||||
isModal = false
|
||||
}
|
||||
// if(
|
||||
// detailData.isEditPattern.value &&
|
||||
// selectItem.selectDetail?.id &&
|
||||
// (detailData.frontBack.front[index].id != selectItem.selectDetail.id)
|
||||
// ){
|
||||
// isModal = true
|
||||
// Modal.confirm({
|
||||
// title: t('collectionModal.jsContent2'),
|
||||
// icon: createVNode(ExclamationCircleOutlined),
|
||||
// okText: 'Yes',
|
||||
// cancelText: 'No',
|
||||
// mask:false,
|
||||
// centered:true,
|
||||
// onOk() {
|
||||
// resolve(true)
|
||||
// isOpen = true
|
||||
// },
|
||||
// onCancel(){
|
||||
// resolve(false)
|
||||
// isOpen = false
|
||||
// }
|
||||
// });
|
||||
// }else{
|
||||
// if(detailData.frontBack.front[index].id != selectItem.selectDetail.id){
|
||||
// isOpen = true
|
||||
// }
|
||||
// resolve(true)
|
||||
// isModal = false
|
||||
// }
|
||||
resolve(true)
|
||||
isOpen = true
|
||||
}).then((rv)=>{
|
||||
})
|
||||
if(isOpen){
|
||||
|
||||
@@ -583,6 +583,7 @@ export default {
|
||||
jsContent2: "上传的文件不会保存,是否继续? ",
|
||||
jsContent3: "您必须选择一种或多种颜色进行下一步。",
|
||||
jsContent5: "我们检测到您的({str})上的PIN数量超过了八个,这可能会导致一些已钉住的项目未被使用。您是否仍要继续?",
|
||||
jsContent6: "画布内容没有保存,请点击预保存后继续。",
|
||||
},
|
||||
DesignDetail: {
|
||||
Details: "详情",
|
||||
|
||||
@@ -585,6 +585,7 @@ export default {
|
||||
jsContent2: "The uploaded files will not be saved, being sure to continue? ",
|
||||
jsContent3: "You must choose one or more colors for further process.",
|
||||
jsContent5: "We've detected that the number of pins on your ({str}) exceeds eight, which may result in some pinned items not being used. Would you like to continue anyway?",
|
||||
jsContent6: 'The content on the canvas has not been saved. Please click "Preview" to continue.',
|
||||
},
|
||||
DesignDetail: {
|
||||
Details: "Details",
|
||||
|
||||
@@ -74,6 +74,7 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
state.frontBack.back = back
|
||||
},
|
||||
updataDetailItem(state,data){
|
||||
console.log(data)
|
||||
state.designDetail.clothes.forEach((item:any) => {
|
||||
if(item.id == state.selectDetail.id){
|
||||
for (const key in data) {
|
||||
@@ -230,7 +231,7 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
left:item.layersObject[i].position?.[1] * scale + 'px',
|
||||
width:item.layersObject[i].imageSize?.[0] * scale + 'px',
|
||||
height:item.layersObject[i].imageSize?.[1] * scale + 'px',
|
||||
zIndex:v?.style?.zIndex?v.style.zIndex:state.frontBack.front.length
|
||||
zIndex:v?.style?.zIndex?v.style.zIndex:v.priority?v.priority:state.frontBack.front.length
|
||||
}
|
||||
item.layersObject[i].centers={
|
||||
left:0,
|
||||
@@ -256,7 +257,7 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
})
|
||||
if(state.currentDetailType != 'models'){
|
||||
state.selectDetail.change = item.change
|
||||
if(state.selectDetail?.newDetail?.color){
|
||||
if(state.selectDetail?.newDetail?.color && currentType != 'color'){
|
||||
state.selectDetail.color = state.selectDetail?.newDetail?.color
|
||||
state.selectDetail.newDetail.color = null
|
||||
}
|
||||
@@ -273,12 +274,20 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
||||
state.selectDetail.printObject = item.printObject
|
||||
state.selectDetail.trims = item.trims
|
||||
state.selectDetail.type = item.type
|
||||
state.selectDetail.color = {
|
||||
...item.color,
|
||||
rgba:{
|
||||
r:item.color?.r,
|
||||
g:item.color?.g,
|
||||
b:item.color?.b,
|
||||
}
|
||||
}
|
||||
state.selectDetail.undividedLayer = item.undividedLayer
|
||||
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
|
||||
state.designDetail.clothes.push(state.selectDetail)
|
||||
}
|
||||
state.selectDetail.id = item.id
|
||||
if(currentType)if(state.selectDetail.newDetail?.[currentType])delete state.selectDetail.newDetail[currentType]
|
||||
if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
|
||||
}
|
||||
}
|
||||
if(value.fun)value.fun()
|
||||
|
||||
@@ -38,19 +38,7 @@ const CancelToken = axios.CancelToken;
|
||||
const source = CancelToken.source();
|
||||
// console.log(import.meta.env.VITE_APP_BASE_URL);
|
||||
let isLoginTime = false
|
||||
const filterHttpsUrl = [
|
||||
// '/api/portfolio/page',
|
||||
'/api/account/resetPwd',
|
||||
'/api/portfolio/detail',
|
||||
'/api/account/preLogin',
|
||||
'/api/account/designWorksRegister',
|
||||
'/api/account/schoolLogin',
|
||||
'/api/account/enterpriseLogin',
|
||||
'/api/account/login',
|
||||
'/api/account/organizationNameSearch',
|
||||
'/api/account/designWorksRegisterCode',
|
||||
'/api/third/party/parseWeChatCode',
|
||||
'/api/account/sendEmail']
|
||||
|
||||
//POST传参序列化(添加请求拦截器)
|
||||
axios.interceptors.request.use((config) => {
|
||||
//在发送请求之前做某件事
|
||||
@@ -63,23 +51,7 @@ axios.interceptors.request.use((config) => {
|
||||
// config.data = JSON.stringify(config.data);
|
||||
}
|
||||
// config.headers.Authorization = 'Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA';
|
||||
if(filterHttpsUrl.indexOf(config.url) == -1){
|
||||
if (!getCookie('token')) {
|
||||
console.log('无Token,取消请求');
|
||||
if(!isLoginTime){
|
||||
isLoginTime = true
|
||||
router.replace('/')
|
||||
message.warning('Please login and try again~')
|
||||
setTimeout(()=>[
|
||||
isLoginTime = false
|
||||
],2000)
|
||||
}
|
||||
return Promise.reject(new Error('缺少Token,请求被拦截')); // 阻止请求
|
||||
}
|
||||
config.headers.Authorization = getCookie('token');
|
||||
}else{
|
||||
config.headers.Authorization = '';
|
||||
}
|
||||
config.headers.Authorization = getCookie('token');
|
||||
return config;
|
||||
},(error) =>{
|
||||
return Promise.reject(error);
|
||||
|
||||
@@ -398,10 +398,10 @@ export default defineComponent({
|
||||
homeMainData.openType = Object.keys(query)[0]
|
||||
homeMainData.openTypeChild = query[Object.keys(query)[0]]
|
||||
}
|
||||
if((query?.id || query?.history) && !await getIdExistToHistory()){
|
||||
router.push('/home')
|
||||
return
|
||||
}
|
||||
// if((query?.id || query?.history) && !await getIdExistToHistory()){
|
||||
// router.push('/home')
|
||||
// return
|
||||
// }
|
||||
}else{
|
||||
homeMainData.openType = ''
|
||||
homeMainData.openTypeChild = ''
|
||||
|
||||
Reference in New Issue
Block a user