From 38d111cb6defedff3bf06314ca30d22a01faae22 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 09 二月 2026 16:30:36 +0800
Subject: [PATCH] 功能开发

---
 mini-program/App.vue |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/mini-program/App.vue b/mini-program/App.vue
index ab5c777..751f532 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -2,24 +2,34 @@
 	export default {
 		onLaunch: function() {
 			var that = this
-			console.log('App Launch')
-			console.log(this.$dd)
-			console.log(this.$dd.env.platform)
+			let href = window.location.href;
 			if (this.$dd.env.platform !== 'notInDingTalk') {
-				let href = window.location.href;
+				console.log('閽夐拤鎺堟潈鐧诲綍')
+				let corpId = href.substring(href.lastIndexOf('?corpid=') + 8, href.lastIndexOf('#'))
+				// dingy7xdyzffnegiaszo 姝e紡
+				// dingulzemj5bynjciapg 娴嬭瘯
 				this.$dd.requestAuthCode({
-					corpId: 'dingulzemj5bynjciapg',
-					clientId: 'dingulzemj5bynjciapg',
+					corpId: corpId,
+					clientId: 'dingy7xdyzffnegiaszo',
 					onSuccess: function(result) {
 						that.$u.api.ddLogin({
-							code: '',
-							corpId: ''
+							code: result.code,
+							corpId: corpId
+						}).then(res => {
+							if (res.code === 200) {
+								that.$store.commit('setToken', res.data.token)
+								that.$isResolve()
+							}
 						})
-					},
-					onFail: function(err) {
-						console.log(err)
 					}
 				});
+			} else if (href.indexOf('?token') !== -1) {
+				console.log('token鍏嶇櫥')
+				let token = href.substring(href.lastIndexOf('?token=') + 7, href.lastIndexOf('#'))
+				that.$store.commit('setToken', token)
+				that.$isResolve()
+			} else {
+				that.$isResolve()
 			}
 		},
 		onShow: function() {

--
Gitblit v1.9.3