Committed by
shuaiguo
ssr log & auth loading
Showing
2 changed files
with
25 additions
and
1 deletions
@@ -154,12 +154,21 @@ export default { | @@ -154,12 +154,21 @@ export default { | ||
154 | this.toast('上传失败'); | 154 | this.toast('上传失败'); |
155 | }, | 155 | }, |
156 | submitCert() { | 156 | submitCert() { |
157 | + if (this.$createToast) { | ||
158 | + this.submiting = this.$createToast({ | ||
159 | + txt: '认证中', | ||
160 | + mask: true | ||
161 | + }).show(); | ||
162 | + } | ||
163 | + | ||
157 | this.userRealCertification({ | 164 | this.userRealCertification({ |
158 | certName: this.name, | 165 | certName: this.name, |
159 | certNo: this.idCode, | 166 | certNo: this.idCode, |
160 | frontImageUrl: this.idCardFront, | 167 | frontImageUrl: this.idCardFront, |
161 | backImageUrl: this.idCardBack | 168 | backImageUrl: this.idCardBack |
162 | }).then(res => { | 169 | }).then(res => { |
170 | + this.submiting && this.submiting.hide(); | ||
171 | + | ||
163 | if (res.code === 200) { | 172 | if (res.code === 200) { |
164 | if (this.$route.query.refer) { | 173 | if (this.$route.query.refer) { |
165 | this.$router.push({ | 174 | this.$router.push({ |
@@ -175,6 +184,13 @@ export default { | @@ -175,6 +184,13 @@ export default { | ||
175 | time: 1000 | 184 | time: 1000 |
176 | }).show(); | 185 | }).show(); |
177 | } | 186 | } |
187 | + }).catch(e => { | ||
188 | + this.submiting && this.submiting.hide(); | ||
189 | + this.$createToast && this.$createToast({ | ||
190 | + txt: '网络异常,请稍后重试', | ||
191 | + type: 'txt', | ||
192 | + time: 1000 | ||
193 | + }).show(); | ||
178 | }); | 194 | }); |
179 | } | 195 | } |
180 | }, | 196 | }, |
@@ -135,7 +135,15 @@ const render = (route) => { | @@ -135,7 +135,15 @@ const render = (route) => { | ||
135 | 135 | ||
136 | const isDegrade = _.get(req.app.locals.wap, 'webapp.degrade', false); | 136 | const isDegrade = _.get(req.app.locals.wap, 'webapp.degrade', false); |
137 | 137 | ||
138 | - logger.info(`${req.yoho.clientIp} | ${req.url} | uid:${req.user.uid} | ua:${req.get('user-agent')} | ${new Date()}`); | 138 | + logger.info(JSON.stringify({ |
139 | + type: 'ssr_page_access', | ||
140 | + app: config.appName, | ||
141 | + ip: req.yoho.clientIp, | ||
142 | + path: req.url, | ||
143 | + uid: req.user.uid, | ||
144 | + ua: req.get('user-agent'), | ||
145 | + time: new Date() | ||
146 | + })); | ||
139 | 147 | ||
140 | if (isDegrade) { | 148 | if (isDegrade) { |
141 | return res.send(degradeHtml); | 149 | return res.send(degradeHtml); |
-
Please register or login to post a comment