From c0f0e756e9d61c27e358c798c91042e35711028b Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 02 二月 2026 15:52:36 +0800
Subject: [PATCH] 优化
---
mini-program/App.vue | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/mini-program/App.vue b/mini-program/App.vue
index 233a4bb..a425727 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -1,7 +1,32 @@
<script>
export default {
onLaunch: function() {
- console.log('App Launch')
+ var that = this
+ let href = window.location.href;
+ if (this.$dd.env.platform !== 'notInDingTalk') {
+ 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: result.code,
+ corpId: corpId
+ }).then(res => {
+ if (res.code === 200) {
+ that.$store.commit('setToken', res.data.token)
+ this.$isResolve()
+ }
+ })
+ }
+ });
+ } 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() {
console.log('App Show')
@@ -14,4 +39,4 @@
<style lang="scss">
@import "uview-ui/index.scss";
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3