|
|
@@ -109,30 +109,39 @@ export const login = (isBack = true) => {
|
|
|
|
|
|
const after = async (fet: Promise<Response>) => {
|
|
|
let res: any;
|
|
|
- const response = await fet;
|
|
|
- if (response.status !== 200) {
|
|
|
- if (response.status === 404) {
|
|
|
- res = {
|
|
|
- code: 404,
|
|
|
- message: ui18n.t("res.code.404"),
|
|
|
- };
|
|
|
+ try {
|
|
|
+ const response = await fet;
|
|
|
+
|
|
|
+ if (response.status !== 200) {
|
|
|
+ console.log(response.status);
|
|
|
+ if (response.status === 404) {
|
|
|
+ res = {
|
|
|
+ code: 404,
|
|
|
+ message: ui18n.t("res.code.404"),
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ res = {
|
|
|
+ code: 500,
|
|
|
+ message: ui18n.t("res.code.500"),
|
|
|
+ };
|
|
|
+ }
|
|
|
} else {
|
|
|
- res = {
|
|
|
- code: 500,
|
|
|
- message: ui18n.t("res.code.500"),
|
|
|
- };
|
|
|
- }
|
|
|
- } else {
|
|
|
- try {
|
|
|
- res = await response.json();
|
|
|
- } catch {
|
|
|
- res = {
|
|
|
- code: 500,
|
|
|
- message: ui18n.t("res.code.500"),
|
|
|
- };
|
|
|
+ try {
|
|
|
+ res = await response.json();
|
|
|
+ } catch {
|
|
|
+ res = {
|
|
|
+ code: 500,
|
|
|
+ message: ui18n.t("res.code.500"),
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch {
|
|
|
+ res = {
|
|
|
+ code: 404,
|
|
|
+ message: ui18n.t("res.code.404"),
|
|
|
+ };
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (res.code === 8034) {
|
|
|
// if (!import.meta.env.DEV) {
|
|
|
// setTimeout(() => {
|
|
|
@@ -449,25 +458,25 @@ export let getTableTemp = async () => {
|
|
|
};
|
|
|
|
|
|
// if (window.platform.num) {
|
|
|
- const item = await get("fusion/caseOverview/settingInfo", {
|
|
|
- tabulationId: params.value.tabulationId,
|
|
|
- overviewId: params.value.overviewId,
|
|
|
- num: window.platform.num,
|
|
|
- });
|
|
|
- if (item) {
|
|
|
- table[ui18n.t("tableTemp.th1")] = item.crimeTimeBegin;
|
|
|
- table[ui18n.t("tableTemp.th2")] = item.caseLocation;
|
|
|
- table[ui18n.t("tableTemp.th3")] = item.orgName;
|
|
|
- table[ui18n.t("tableTemp.th4")] = item.investigatorName;
|
|
|
- table[ui18n.t("tableTemp.th5")] = formatDate(
|
|
|
- new Date(),
|
|
|
- ui18n.t("tableTemp.th5value"),
|
|
|
- );
|
|
|
- if (!title) {
|
|
|
- title = ui18n.t("tableTemp.title", item);
|
|
|
- }
|
|
|
- return (tempCache = { table, title });
|
|
|
+ const item = await get("fusion/caseOverview/settingInfo", {
|
|
|
+ tabulationId: params.value.tabulationId,
|
|
|
+ overviewId: params.value.overviewId,
|
|
|
+ num: window.platform.num,
|
|
|
+ });
|
|
|
+ if (item) {
|
|
|
+ table[ui18n.t("tableTemp.th1")] = item.crimeTimeBegin;
|
|
|
+ table[ui18n.t("tableTemp.th2")] = item.caseLocation;
|
|
|
+ table[ui18n.t("tableTemp.th3")] = item.orgName;
|
|
|
+ table[ui18n.t("tableTemp.th4")] = item.investigatorName;
|
|
|
+ table[ui18n.t("tableTemp.th5")] = formatDate(
|
|
|
+ new Date(),
|
|
|
+ ui18n.t("tableTemp.th5value"),
|
|
|
+ );
|
|
|
+ if (!title) {
|
|
|
+ title = ui18n.t("tableTemp.title", item);
|
|
|
}
|
|
|
+ return (tempCache = { table, title });
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
if (!title) {
|