From 3845c70bd7ce578b65522ad020a8dc524316b4d4 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 02 二月 2026 15:52:18 +0800
Subject: [PATCH] 优化
---
mini-program/App.vue | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/mini-program/App.vue b/mini-program/App.vue
index ab5c777..a425727 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -2,24 +2,30 @@
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;
+ let corpId = href.substring(href.lastIndexOf('?corpid=') + 8, href.length)
this.$dd.requestAuthCode({
corpId: 'dingulzemj5bynjciapg',
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)
+ this.$isResolve()
+ }
})
- },
- onFail: function(err) {
- console.log(err)
}
});
+ } else if (href.indexOf('?token') !== -1) {
+ let token = href.substring(href.lastIndexOf('?token=') + 7, href.length)
+ that.$store.commit('setToken', token)
+ this.$isResolve()
+ } else {
+ this.$isResolve()
}
},
onShow: function() {
--
Gitblit v1.9.3