From fea8e0742ee241a94c5bbd4f452d6ad82cf4dd9c Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 06 二月 2026 10:58:26 +0800
Subject: [PATCH] 功能开发

---
 mini-program/App.vue |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/mini-program/App.vue b/mini-program/App.vue
index ab5c777..4ca0850 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -2,24 +2,32 @@
 	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(href)
+				let corpId = href.substring(href.lastIndexOf('?corpid=') + 8, href.lastIndexOf('#'))
+				console.log(corpId)
 				this.$dd.requestAuthCode({
-					corpId: 'dingulzemj5bynjciapg',
+					corpId: corpId,
 					clientId: 'dingulzemj5bynjciapg',
 					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) {
+				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