1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| <script>
| export default {
| onLaunch: function() {
| var that = this
| let href = window.location.href;
| if (this.$dd.env.platform !== 'notInDingTalk') {
| console.log(href)
| let corpId = href.substring(href.lastIndexOf('?corpid=') + 8, href.lastIndexOf('#'))
| console.log(corpId)
| this.$dd.requestAuthCode({
| corpId: corpId,
| 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)
| that.$isResolve()
| }
| })
| }
| });
| } else if (href.indexOf('?token') !== -1) {
| let token = href.substring(href.lastIndexOf('?token=') + 7, href.length)
| that.$store.commit('setToken', token)
| that.$isResolve()
| } else {
| that.$isResolve()
| }
| },
| onShow: function() {
| console.log('App Show')
| },
| onHide: function() {
| console.log('App Hide')
| }
| }
| </script>
|
| <style lang="scss">
| @import "uview-ui/index.scss";
| </style>
|
|