增加APP下载
Showing
5 changed files
with
34 additions
and
24 deletions
... | @@ -16,54 +16,54 @@ | ... | @@ -16,54 +16,54 @@ |
16 | } | 16 | } |
17 | 17 | ||
18 | .icon-female:before { | 18 | .icon-female:before { |
19 | content: "\e649"; | 19 | content: "\e649"; |
20 | } | 20 | } |
21 | 21 | ||
22 | .icon-blacklist:before { | 22 | .icon-blacklist:before { |
23 | content: "\e66a"; | 23 | content: "\e66a"; |
24 | } | 24 | } |
25 | 25 | ||
26 | .icon-tupian:before { | 26 | .icon-tupian:before { |
27 | content: "\e64a"; | 27 | content: "\e64a"; |
28 | } | 28 | } |
29 | 29 | ||
30 | .icon-diaocha:before { | 30 | .icon-diaocha:before { |
31 | content: "\e605"; | 31 | content: "\e605"; |
32 | } | 32 | } |
33 | 33 | ||
34 | .icon-voice:before { | 34 | .icon-voice:before { |
35 | content: "\e667"; | 35 | content: "\e667"; |
36 | } | 36 | } |
37 | 37 | ||
38 | .icon-group:before { | 38 | .icon-group:before { |
39 | content: "\e696"; | 39 | content: "\e696"; |
40 | } | 40 | } |
41 | 41 | ||
42 | .icon-contact:before { | 42 | .icon-contact:before { |
43 | content: "\e61f"; | 43 | content: "\e61f"; |
44 | } | 44 | } |
45 | 45 | ||
46 | .icon-wenjian:before { | 46 | .icon-wenjian:before { |
47 | content: "\e601"; | 47 | content: "\e601"; |
48 | } | 48 | } |
49 | 49 | ||
50 | .icon-male:before { | 50 | .icon-male:before { |
51 | content: "\e832"; | 51 | content: "\e832"; |
52 | } | 52 | } |
53 | 53 | ||
54 | .icon-zidingyi:before { | 54 | .icon-zidingyi:before { |
55 | content: "\e633"; | 55 | content: "\e633"; |
56 | } | 56 | } |
57 | 57 | ||
58 | .icon-conversation:before { | 58 | .icon-conversation:before { |
59 | content: "\e663"; | 59 | content: "\e663"; |
60 | } | 60 | } |
61 | 61 | ||
62 | .icon-tuichu:before { | 62 | .icon-tuichu:before { |
63 | content: "\e74d"; | 63 | content: "\e74d"; |
64 | } | 64 | } |
65 | 65 | ||
66 | .icon-smile:before { | 66 | .icon-smile:before { |
67 | content: "\e6d6"; | 67 | content: "\e6d6"; |
68 | } | 68 | } |
69 | 69 | ... | ... |
... | @@ -4,9 +4,11 @@ | ... | @@ -4,9 +4,11 @@ |
4 | <button title="刷新列表" @click="handleRefresh"> | 4 | <button title="刷新列表" @click="handleRefresh"> |
5 | <i class="tim-icon-refresh"></i> | 5 | <i class="tim-icon-refresh"></i> |
6 | </button> | 6 | </button> |
7 | <!-- <button title="创建会话" @click="handleAddButtonClick">--> | 7 | <el-button icon="el-icon-mobile-phone" :round="true" title="下载APP" @click="handleDownload"/> |
8 | <!-- <i class="tim-icon-add"></i>--> | 8 | |
9 | <!-- </button>--> | 9 | <!-- <button title="创建会话" @click="handleAddButtonClick">--> |
10 | <!-- <i class="tim-icon-add"></i>--> | ||
11 | <!-- </button>--> | ||
10 | </div> | 12 | </div> |
11 | <div class="scroll-container"> | 13 | <div class="scroll-container"> |
12 | <conversation-item | 14 | <conversation-item |
... | @@ -139,6 +141,9 @@ export default { | ... | @@ -139,6 +141,9 @@ export default { |
139 | .catch(() => { | 141 | .catch(() => { |
140 | this.isCheckouting = false | 142 | this.isCheckouting = false |
141 | }) | 143 | }) |
144 | }, | ||
145 | handleDownload() { | ||
146 | window.open('https://www.pgyer.com/5CqL', 'target') | ||
142 | } | 147 | } |
143 | } | 148 | } |
144 | } | 149 | } | ... | ... |
... | @@ -59,6 +59,9 @@ export default { | ... | @@ -59,6 +59,9 @@ export default { |
59 | // ElAutocomplete: Autocomplete | 59 | // ElAutocomplete: Autocomplete |
60 | }, | 60 | }, |
61 | computed: { | 61 | computed: { |
62 | isLogin: function () { | ||
63 | return this.$store.state.user.isLogin | ||
64 | }, | ||
62 | groupList: function () { | 65 | groupList: function () { |
63 | return this.$store.state.group.groupList | 66 | return this.$store.state.group.groupList |
64 | }, | 67 | }, |
... | @@ -68,8 +71,10 @@ export default { | ... | @@ -68,8 +71,10 @@ export default { |
68 | } | 71 | } |
69 | }) | 72 | }) |
70 | }, | 73 | }, |
71 | created() { | 74 | mounted() { |
72 | this.fetch() | 75 | if (this.isLogin) { |
76 | this.fetch() | ||
77 | } | ||
73 | }, | 78 | }, |
74 | methods: { | 79 | methods: { |
75 | fetch() { | 80 | fetch() { | ... | ... |
... | @@ -68,6 +68,7 @@ export default { | ... | @@ -68,6 +68,7 @@ export default { |
68 | created() { | 68 | created() { |
69 | Helper.verifyToken().then(user => this.tim.login({userID: user.id, userSig: user.sign}) | 69 | Helper.verifyToken().then(user => this.tim.login({userID: user.id, userSig: user.sign}) |
70 | .then(() => { | 70 | .then(() => { |
71 | console.log('gooo') | ||
71 | this.loading = false | 72 | this.loading = false |
72 | this.$store.commit('toggleIsLogin', true) | 73 | this.$store.commit('toggleIsLogin', true) |
73 | this.$store.commit('startComputeCurrent') | 74 | this.$store.commit('startComputeCurrent') |
... | @@ -82,6 +83,7 @@ export default { | ... | @@ -82,6 +83,7 @@ export default { |
82 | // this.$store.commit('showMessage', {type: 'success', message: '登录成功'}) | 83 | // this.$store.commit('showMessage', {type: 'success', message: '登录成功'}) |
83 | }) | 84 | }) |
84 | .catch(error => { | 85 | .catch(error => { |
86 | console.log(1111) | ||
85 | this.loading = false | 87 | this.loading = false |
86 | this.$store.commit('showMessage', {message: '登录失败:' + error.message, type: 'error'}) | 88 | this.$store.commit('showMessage', {message: '登录失败:' + error.message, type: 'error'}) |
87 | })) | 89 | })) | ... | ... |
1 | import Store from '../store/index' | ||
2 | import request from './request' | 1 | import request from './request' |
3 | 2 | ||
4 | export default class Helper { | 3 | export default class Helper { |
... | @@ -13,12 +12,11 @@ export default class Helper { | ... | @@ -13,12 +12,11 @@ export default class Helper { |
13 | return this.getUrlKey('token') | 12 | return this.getUrlKey('token') |
14 | } | 13 | } |
15 | 14 | ||
15 | /** | ||
16 | * | ||
17 | * @returns {Promise<never>|Promise<{sign, id}>} | ||
18 | */ | ||
16 | static verifyToken() { | 19 | static verifyToken() { |
17 | const token = this.getToken() | ||
18 | if (!token) { | ||
19 | return Store.commit('showMessage', {type: 'error', message: '非法访问'}) | ||
20 | } | ||
21 | |||
22 | return request.get('auth').then(res => { | 20 | return request.get('auth').then(res => { |
23 | const {esm_id} = res.data | 21 | const {esm_id} = res.data |
24 | return Promise.resolve({id: esm_id, sign: window.genTestUserSig(esm_id).userSig}) | 22 | return Promise.resolve({id: esm_id, sign: window.genTestUserSig(esm_id).userSig}) | ... | ... |
-
Please register or sign in to post a comment