Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

vue二维码扫描把当前用户数据传给注册页面

这种写法,我扫描直接undefined,也许是因为我还没有上传服务器,所以扫不出来。手机扫出来是这样的:
http://192.168.3.159:8877/register?name=undefined&code=undefined
我二维码页面写的是这样子,name和code是接收接口传过来当前用户的值,我这些的有问题吗?我要怎么处理才能把这个链接上的数据放在我注册页面上?有大佬会吗?
image.png

注册页:
获取url的方法:

getUrlKey: function (name) {
        return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [,''])[1].replace(/+/g, '%20')) || null
    },
    这里|| [,'']),我复制过来前面就是空的,然后eslint貌似会直接报错

image.png
获取url地址。
image.png

这三个有个是固定的,另外的就是我要接收这个二维码用户的数据。
image.png
接口代理过去的。
image.png

////////////////////////////////////////////////
[凯迪Wen]说的写法,用上后就只会放大了。
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

那你应该要点注册的时候再生出二维码,不要一开始就把二维码初始化出来?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.6k users

...