diff --git a/src/components/sp-login/index.weapp.js b/src/components/sp-login/index.weapp.js index 0ddefbb63..6a9f2ae9f 100644 --- a/src/components/sp-login/index.weapp.js +++ b/src/components/sp-login/index.weapp.js @@ -86,6 +86,7 @@ function SpLogin(props, ref) { // const { uid } = entryLaunch.getLaunchParams() const { uid, dtid } = Taro.getStorageSync(SG_ROUTER_PARAMS) const { gu_user_id, gu } = Taro.getStorageSync(SG_GUIDE_PARAMS) + const { source_id, monitor_id, latest_source_id, latest_monitor_id } = Taro.getStorageSync('sourceInfo') // 千人千码参数 if (uid) { // 分销绑定 params['uid'] = uid @@ -110,6 +111,19 @@ function SpLogin(props, ref) { params['work_userid'] = work_userid } + if (source_id) { + params['source_id'] = source_id + } + if (monitor_id) { + params['monitor_id'] = monitor_id + } + if (latest_source_id) { + params['latest_source_id'] = latest_source_id + } + if (latest_monitor_id) { + params['latest_monitor_id'] = latest_monitor_id + } + try { const { token, is_new } = await api.wx.newlogin(params) if (token) { diff --git a/src/subpages/auth/login.js b/src/subpages/auth/login.js index 5eccd98a0..b233940df 100644 --- a/src/subpages/auth/login.js +++ b/src/subpages/auth/login.js @@ -110,6 +110,7 @@ export default class Login extends Component { } async handleSubmit() { + const { source_id, monitor_id, latest_source_id, latest_monitor_id } = Taro.getStorageSync('sourceInfo') // 千人千码参数 const { redirect } = this.$instance.router.params const { loginType } = this.state const { mobile, password, vcode } = this.state.info @@ -145,6 +146,19 @@ export default class Login extends Component { params['auth_type'] = 'local' + if (source_id) { + params['source_id'] = source_id + } + if (monitor_id) { + params['monitor_id'] = monitor_id + } + if (latest_source_id) { + params['latest_source_id'] = latest_source_id + } + if (latest_monitor_id) { + params['latest_monitor_id'] = latest_monitor_id + } + try { const { token, error_message } = await api.wx.newloginh5(params)