|
@@ -113,7 +113,6 @@ export default {
|
|
|
},
|
|
|
//微信授权登录
|
|
|
wechat_login($userinfo) {
|
|
|
- console.log('登录')
|
|
|
Toast.loading({
|
|
|
duration: 0, // 持续展示 toast
|
|
|
forbidClick: true,
|
|
@@ -127,33 +126,40 @@ export default {
|
|
|
invite: $this.invite,
|
|
|
}
|
|
|
// if ($this._userinfo) {
|
|
|
- $params['user_name'] = $this._userinfo.nickName
|
|
|
- $params['portrait'] = $this._userinfo.avatarUrl
|
|
|
- $params['sex'] = $this._userinfo.gender
|
|
|
+ $params['user_name'] = $this._userinfo.nickName
|
|
|
+ $params['portrait'] = $this._userinfo.avatarUrl
|
|
|
+ $params['sex'] = $this._userinfo.gender
|
|
|
// }
|
|
|
|
|
|
if ($this.title == "注册") {
|
|
|
userRegister($params).then((res) => {
|
|
|
- console.log(res)
|
|
|
- let $data = res.data
|
|
|
- if (!$data['code']) {
|
|
|
- Toast.clear()
|
|
|
- $this.login_success($data)
|
|
|
- } else {
|
|
|
- Toast.fail($data['errmsg'])
|
|
|
+ console.log(res)
|
|
|
+ let $data = res.data
|
|
|
+ if (!$data['code']) {
|
|
|
+ Toast.clear()
|
|
|
+ $this.login_success($data)
|
|
|
+ } else {
|
|
|
+ Toast.fail($data['errmsg'])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err)
|
|
|
}
|
|
|
- })
|
|
|
+ )
|
|
|
} else if ($this.title == "登录") {
|
|
|
userLogin($params).then((res) => {
|
|
|
- console.log(res)
|
|
|
- let $data = res.data
|
|
|
- Toast.clear()
|
|
|
- if (!$data['code']) {
|
|
|
- $this.login_success($data)
|
|
|
- } else {
|
|
|
- Toast.fail($data['errmsg'])
|
|
|
- }
|
|
|
- })
|
|
|
+ console.log(res)
|
|
|
+ let $data = res.data
|
|
|
+ Toast.clear()
|
|
|
+ if (!$data['code']) {
|
|
|
+ $this.login_success($data)
|
|
|
+ } else {
|
|
|
+ Toast.fail($data['errmsg'])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -191,8 +197,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // $this.invite = $this.$store.getters.get_invite_code ? $this.$store.getters.get_invite_code : wx.getStorageSync('code')
|
|
|
- $this.invite = 3
|
|
|
+ $this.invite = $this.$store.getters.get_invite_code ? $this.$store.getters.get_invite_code : wx.getStorageSync('code')
|
|
|
+ // $this.invite = 3
|
|
|
console.log('regist-invite', $this.invite)
|
|
|
mpvue.login({
|
|
|
success($res) {
|