zhuangyunsheng před 1 rokem
rodič
revize
0307c1d98b

+ 2 - 2
src/App.vue

@@ -40,9 +40,9 @@
 			}
 		},
 		computed: {
-			locale(){
+			locale() {
 				return this.$i18n.messages[this.$i18n.locale].el
-			},
+			}
 		},
 		created() {
 			// 设置主题颜色

+ 6 - 8
src/components/scChengTou/purchase/tracking.vue

@@ -1,8 +1,10 @@
 <template>
-	<div v-loading="loading" class="tracking-iframe">
-		<template v-if="iframeUrl">
-			<iframe :src="iframeUrl" frameborder="0"></iframe>
-		</template>
+	<div class="tracking-iframe">
+		<el-skeleton :loading="!iframeUrl" animated :rows="5">
+			<template #default>
+				<iframe :src="iframeUrl" frameborder="0"></iframe>
+			</template>
+		</el-skeleton>
 	</div>
 </template>
 
@@ -14,7 +16,6 @@
 
 		data() {
 			return {
-				loading: false,
 				params: {
           			showContents: "showActivityList,showFlow", // 处理历史: showActivityList,流程图
 					source: "jsf",
@@ -38,15 +39,12 @@
 			async getToken() {
 				try {
 					if (!this.params.local_token || !this.params.tenantId) {
-						this.loading = true;
 						const res = await this.$API.auth.gldMaster.getToken();
-						this.loading = false;
 						this.params.local_token = res.token;
 						this.params.tenantId = res.tenantId;
 						this.iframeUrl = res.host + this.iframeParams();
 					}
 				} catch (error) {
-					this.loading = false;
 					this.params.local_token = null;
 					this.params.tenantId = null;
 					this.iframeUrl = null;

+ 6 - 10
src/utils/request.js

@@ -32,16 +32,7 @@ let MessageBox_401_show = false
 
 // HTTP response 拦截器
 axios.interceptors.response.use(
-	(response) => {
-		if (response.data.code == 400) {
-			ElNotification.error({
-				title: "请求错误",
-				message: response.data.message || "Code:400,未知错误!"
-			});
-			return Promise.reject(response.data);
-		}
-		return response;
-	},
+	(response) => response,
 	(error) => {
 		if (error.response) {
 			if (error.response.status == 404) {
@@ -54,6 +45,11 @@ axios.interceptors.response.use(
 					title: "请求错误",
 					message: error.response.data.message || "Status:500,服务器发生错误!"
 				});
+			} else if (error.response.status == 400) {
+				ElNotification.error({
+					title: "请求错误",
+					message: error.response.data || "Code:400,未知错误!"
+				});
 			} else if (error.response.status == 401) {
 				if (!MessageBox_401_show) {
 					MessageBox_401_show = true