This commit is contained in:
jianzhichu
2025-12-20 14:10:50 +08:00
parent 7666ab109d
commit 413f19c537
8 changed files with 54 additions and 38 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ const showVersionNotification = () => {
}
openVersionNotification();
} else {
message.error(res.msg);
message.error(res.message);
}
})
.catch((err) => {
+1 -1
View File
@@ -26,7 +26,7 @@ const getVersions = () => {
if (res.code == 1) {
dyVersions.value = res.data;
} else {
message.error(res.msg);
message.error(res.message);
}
});
};
+5 -5
View File
@@ -467,7 +467,7 @@ const handleSavePath = (item: FollowItem) => {
uploadSyncStatus(item);
};
// 上传同步状态
// 更新同步状态
const uploadSyncStatus = (item: FollowItem) => {
item.isSaving = true;
useApiStore()
@@ -483,7 +483,7 @@ const uploadSyncStatus = (item: FollowItem) => {
message.success(`保存成功,将在下次任务执行时生效`);
item.isEditing = false;
} else {
message.error('保存失败' + (res.msg || '未知错误'));
message.error('保存失败' + (res.message || '未知错误'));
}
})
.catch((err) => {
@@ -508,7 +508,7 @@ const handleSyncAll = () => {
if (res.code === 0) {
message.success('后台开始同步...根据您关注的数量,需要的时间不一定...请耐心等待');
} else {
message.error('同步失败:' + (res.msg || '未知错误'));
message.error('同步失败:' + (res.message || '未知错误'));
}
})
.catch((err) => {
@@ -609,7 +609,7 @@ const handleAddSubmit = () => {
tabList.value[tabIndex].total = (tabList.value[tabIndex].total || 0) + 1;
}
} else {
message.error('新增失败:' + (res.msg || '未知错误'));
message.error('新增失败:' + (res.message || '未知错误'));
}
})
.catch((err) => {
@@ -654,7 +654,7 @@ const handleDeleteItem = (item: FollowItem) => {
initData();
resolve(true);
} else {
message.error('删除失败:' + (res.msg || '未知错误'));
message.error('删除失败:' + (res.message || '未知错误'));
reject(false);
}
})
+17 -1
View File
@@ -12,8 +12,24 @@ import { message } from 'ant-design-vue';
const router = useRouter();
function onLoginSuccess() {
router.push('/dashboard');
if (isMobileBrowser()) router.push('/mobile');
else router.push('/dashboard');
}
// 精准判断移动端浏览器(复用之前的核心逻辑,简化版)
const isMobileBrowser = (): boolean => {
if (typeof navigator === 'undefined' || typeof window === 'undefined') {
return false;
}
const userAgent = navigator.userAgent.toLowerCase();
// 匹配手机UA(排除平板)
const mobileUA = /android|iphone|ipod|blackberry|windows phone|iemobile|opera mini/i.test(userAgent);
const isTablet = /ipad|tablet|playbook|kindle|android 3\.|android 4\.[0-3]/.test(userAgent);
// 触摸设备+小屏兜底
const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
const isMobileScreen = window.innerWidth <= 768 && window.innerHeight <= 1024;
return (mobileUA && !isTablet && isTouchDevice) || (isMobileScreen && isTouchDevice);
};
function onLoginFail(reason: string, fields: any) {
console.log('登录失败:', reason, fields);
+1 -1
View File
@@ -150,7 +150,7 @@ const onFinish = (values: PassFormState) => {
visible.value = false;
http.removeAuthorization();
} else {
message.error(res.erro, 8);
message.error(res.message, 8);
}
});
}
+2 -2
View File
@@ -358,7 +358,7 @@ const getConfig = () => {
tagData.value = JSON.parse(res.data.priorityLevel);
} else {
message.error(res.erro || '获取配置失败', 8);
message.error(res.message || '获取配置失败', 8);
}
})
.catch((error) => {
@@ -452,7 +452,7 @@ const onSubmit = () => {
message.success('修改成功,同步任务将在5-10秒按新配置运行...');
componentDisabled.value = true;
} else {
message.error(res.erro || '更新配置失败', 8);
message.error(res.message || '更新配置失败', 8);
}
})
.catch((error) => {
+26 -26
View File
@@ -37,7 +37,7 @@ export const useApiStore = defineStore('coreapi', () => {
.request<any, Response<any>>('/api/config/GetConfig', 'GET')
.then((res) => {
console.log(res)
return res.data;
return res;
})
.finally(() => {
@@ -49,7 +49,7 @@ export const useApiStore = defineStore('coreapi', () => {
.request<any, Response<any>>('/api/config/UpdateConfig', 'post_json', request)
.then((res) => {
console.log(res)
return res.data;
return res;
})
.finally(() => {
@@ -67,7 +67,7 @@ export const useApiStore = defineStore('coreapi', () => {
//用户信息-头像
async function apiUserInfo() {
return http.request<any, Response<any>>('/api/auth/GetUserAvatar', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -75,7 +75,7 @@ export const useApiStore = defineStore('coreapi', () => {
//密码修改
async function apiChangePwd(param: object) {
return http.request<any, Response<any>>('/api/auth/UpdatePwd', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -83,14 +83,14 @@ export const useApiStore = defineStore('coreapi', () => {
//StartJobNow
async function StartJobNow() {
return http.request<any, Response<any>>('/api/config/ExecuteJobNow', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
}
async function VideoStatics() {
return http.request<any, Response<any>>('/api/video/statics', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -99,7 +99,7 @@ export const useApiStore = defineStore('coreapi', () => {
//视频查询
async function VideoPageList(param: object) {
return http.request<any, Response<any>>('/api/video/paged', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -107,14 +107,14 @@ export const useApiStore = defineStore('coreapi', () => {
//cookies
async function CookiePageList(param: object) {
return http.request<any, Response<any>>('/api/config/paged', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
}
async function CookieList() {
return http.request<any, Response<any>>('/api/config/list', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -123,7 +123,7 @@ export const useApiStore = defineStore('coreapi', () => {
async function UpdateConfig(param: object) {
return http.request<any, Response<any>>('/api/config/update', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -131,7 +131,7 @@ export const useApiStore = defineStore('coreapi', () => {
async function deleteCookie(id: string) {
return http.request<any, Response<any>>('/api/config/delete?id=' + id, 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -139,7 +139,7 @@ export const useApiStore = defineStore('coreapi', () => {
//follows
async function FollowList(param: object) {
return http.request<any, Response<any>>('/api/follow/paged', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -147,7 +147,7 @@ export const useApiStore = defineStore('coreapi', () => {
//同步关注列表
async function SyncFollow() {
return http.request<any, Response<any>>('/api/follow/sync', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -155,7 +155,7 @@ export const useApiStore = defineStore('coreapi', () => {
//更新同步关注者状态
async function OpenOrCloseSync(param: object) {
return http.request<any, Response<any>>('/api/follow/openOrCloseSync', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -163,7 +163,7 @@ export const useApiStore = defineStore('coreapi', () => {
//更新同步关注者状态
async function OpenOrCloseFullSync(param: object) {
return http.request<any, Response<any>>('/api/follow/openOrCloseFullSync', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -171,7 +171,7 @@ export const useApiStore = defineStore('coreapi', () => {
//重新下载
async function ReDownViedos(param: object) {
return http.request<any, Response<any>>('/api/video/redown', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -179,7 +179,7 @@ export const useApiStore = defineStore('coreapi', () => {
//删除
async function DeleteVideo(param: string) {
return http.request<any, Response<any>>('/api/video/vdelete/' + param, 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -187,7 +187,7 @@ export const useApiStore = defineStore('coreapi', () => {
//删除
async function GetDeleteViedos() {
return http.request<any, Response<any>>('/api/video/vdelete/get', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -197,7 +197,7 @@ export const useApiStore = defineStore('coreapi', () => {
//检查版本
async function CheckTag() {
return http.request<any, Response<any>>('/api/config/checktag', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -206,7 +206,7 @@ export const useApiStore = defineStore('coreapi', () => {
//添加非关注的博主
async function AddFollow(param: object) {
return http.request<any, Response<any>>('/api/follow/add', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -214,7 +214,7 @@ export const useApiStore = defineStore('coreapi', () => {
//删除非关注的博主
async function DelFollow(param: object) {
return http.request<any, Response<any>>('/api/follow/delete', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -223,7 +223,7 @@ export const useApiStore = defineStore('coreapi', () => {
//导出配置
async function ExportConf() {
return http.request<any, Response<any>>('/api/config/exportConf', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -231,7 +231,7 @@ export const useApiStore = defineStore('coreapi', () => {
//导入配置
async function ImportConf(param: object) {
return http.request<any, Response<any>>('/api/config/importConf', 'post_json', param).then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -240,7 +240,7 @@ export const useApiStore = defineStore('coreapi', () => {
//移动端获取日志列表
async function MobileLogs() {
return http.request<any, Response<any>>('/api/logs/list', 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -249,7 +249,7 @@ export const useApiStore = defineStore('coreapi', () => {
//移动端获取日志详情
async function LogDetail(type: string, date: string) {
return http.request<any, Response<any>>('/api/logs/content?type=' + type + "&Date=" + date, 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});
@@ -258,7 +258,7 @@ export const useApiStore = defineStore('coreapi', () => {
//TOP
async function TopVideo(param: number) {
return http.request<any, Response<any>>('/api/Video/top' + param, 'get').then(r => {
return r.data;
return r;
}).finally(() => {
});