Commit 000c56e8 by huangzhi

feat: 扫描二维码 未登陆 不给登录参数到页面地址

parent e70786d8
...@@ -57,9 +57,7 @@ export default { ...@@ -57,9 +57,7 @@ export default {
setCommonUrlParams(pageUrl, urlParmas) { setCommonUrlParams(pageUrl, urlParmas) {
let url = decodeURIComponent(pageUrl) let url = decodeURIComponent(pageUrl)
const query = { let query = {
uid: this.$store.state.user.uid || '',
accessToken: this.$store.state.user.accessToken || '',
appId: uni.getAccountInfoSync().miniProgram.appId, appId: uni.getAccountInfoSync().miniProgram.appId,
isFromMin: 'weapp', isFromMin: 'weapp',
miniType: 'groupActivity', miniType: 'groupActivity',
...@@ -67,6 +65,14 @@ export default { ...@@ -67,6 +65,14 @@ export default {
timestamp: +new Date(), timestamp: +new Date(),
...urlParmas, ...urlParmas,
} }
// 如果登录了,就注入登录参数
if (this.$store.getters.isLogin) {
query = {
...query,
uid: this.$store.state.user.uid || '',
accessToken: this.$store.state.user.accessToken || '',
}
}
// 更新 url 中的参数 // 更新 url 中的参数
Object.keys(query).forEach(prop => { Object.keys(query).forEach(prop => {
url = this.changeURLArg(url, prop, query[prop]) url = this.changeURLArg(url, prop, query[prop])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment