Browse Source

Merge branch 'module1' of http://120.79.166.78:19005/zhongzheng-edu/saas_miniprogram into huang

Tang 1 năm trước cách đây
mục cha
commit
22a722c83c
1 tập tin đã thay đổi với 11 bổ sung14 xóa
  1. 11 14
      common/request.js

+ 11 - 14
common/request.js

@@ -31,15 +31,13 @@ export const myRequest = (options) => {
 			url: BASE_URL + options.url,
 			method: options.method || "GET",
 			data: options.data,
-			header: options.noToken ?
-				{
-					TenantId: tenantId,
-				} :
-				{
-					AuthorizationToken: "WX " + (token ? token : uni.getStorageSync(
-						"token_temp")),
-					TenantId: tenantId,
-				},
+			header: options.noToken ? {
+				TenantId: tenantId,
+			} : {
+				AuthorizationToken: "WX " + (token ? token : uni.getStorageSync(
+					"token_temp")),
+				TenantId: tenantId,
+			},
 			success: async (res) => {
 				if (!options.compleLoading) {
 					// 请求的接口有带compleLoading 就不隐藏加载中
@@ -93,15 +91,14 @@ export const myRequest = (options) => {
 					});
 					reject();
 				} else if (res.data.code == 601) {
+					uni.switchTab({
+						url: "/pages/learn/index",
+					});
 					uni.showModal({
 						content: res.data.msg,
 						showCancel: false,
 						success: (k) => {
-							if (k.confirm) {
-								uni.switchTab({
-									url: "/pages/index/index",
-								});
-							}
+							if (k.confirm) {}
 						},
 					});
 					reject();