Преглед на файлове

feat: 渠道绑定成功后展示 toast 提示

Developer преди 1 ден
родител
ревизия
57de603733
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      pages/home.vue

+ 5 - 1
pages/home.vue

@@ -101,7 +101,11 @@
 			if (!token) return
 			proxy.$api.post(`/channel/bind?channelId=${channelId}`, {}).then(({ data: res }) => {
 				console.log('[onLoad] bind 结果:', JSON.stringify(res))
-				if (res.code !== 0) console.error('渠道绑定失败:', res.msg)
+				if (res.code === 0) {
+					uni.showToast({ title: '渠道加入成功', icon: 'success', duration: 2000 })
+				} else {
+					console.error('渠道绑定失败:', res.msg)
+				}
 			})
 		}
 	})