File tree 3 files changed +12
-10
lines changed
3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
import axios from '@/libs/api.request'
2
2
3
3
/**
4
- * ʹÓÃQQÊý¾ÝµÇ¼
4
+ * 使用QQ数据登录
5
5
* @param params
6
6
* @returns {wx.RequestTask | never | * }
7
7
*/
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class HttpRequest {
21
21
// 响应拦截
22
22
instance . interceptors . response . use ( res => {
23
23
const { data, status } = res
24
- if ( data . code !== 1 ) {
24
+ if ( data . code < 0 ) {
25
25
if ( data . code === - 14 ) {
26
26
setToken ( '' )
27
27
router . push ( { name : 'login' } )
Original file line number Diff line number Diff line change @@ -140,14 +140,16 @@ export default {
140
140
getQr ().then (function (response ) {
141
141
vm .wxQrUrl = response .data .data .qrUrl
142
142
let checkWx = setInterval (function () {
143
- checkWxLogin ({ state: response .data .data .state }).then (response => {
144
- vm .$store .commit (' setUserInfo' , response .data .data )
145
- vm .$store .commit (' setToken' , response .data .data .apiAuth )
146
- vm .$Message .success (response .data .msg )
147
- vm .$router .push ({
148
- name: ' home'
149
- })
150
- clearInterval (checkWx)
143
+ checkWxLogin ({ state: response .data .data .state }).then (res => {
144
+ if (res .data .code === 1 ) {
145
+ vm .$store .commit (' setUserInfo' , res .data .data )
146
+ vm .$store .commit (' setToken' , res .data .data .apiAuth )
147
+ vm .$Message .success (res .data .msg )
148
+ vm .$router .push ({
149
+ name: ' home'
150
+ })
151
+ clearInterval (checkWx)
152
+ }
151
153
}).catch (() => {
152
154
clearInterval (checkWx)
153
155
})
You can’t perform that action at this time.
0 commit comments