|
@@ -39,11 +39,16 @@ const isLogout = ref(false)
|
|
|
const username = ref<string>('') // 用户名
|
|
const username = ref<string>('') // 用户名
|
|
|
const password = ref<string>('') // 密码
|
|
const password = ref<string>('') // 密码
|
|
|
const token = ref<string>('') // 令牌
|
|
const token = ref<string>('') // 令牌
|
|
|
|
|
+const qrToken = ref<string>('') // web端扫小程序码 登录带入的令牌
|
|
|
|
|
|
|
|
async function init() {
|
|
async function init() {
|
|
|
token.value = ""
|
|
token.value = ""
|
|
|
const code = await getLoginCode()
|
|
const code = await getLoginCode()
|
|
|
- loginByCode({ code }).then((res) => {
|
|
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ code,
|
|
|
|
|
+ qrToken: qrToken.value
|
|
|
|
|
+ }
|
|
|
|
|
+ loginByCode(params).then((res) => {
|
|
|
if (res.code == 0 ) {
|
|
if (res.code == 0 ) {
|
|
|
switch (res.body.res) {
|
|
switch (res.body.res) {
|
|
|
case "0":
|
|
case "0":
|
|
@@ -113,7 +118,8 @@ function onGetPhoneNumber(detail) {
|
|
|
function handlePhoneNumberLogin(code) {
|
|
function handlePhoneNumberLogin(code) {
|
|
|
let params = {
|
|
let params = {
|
|
|
code,
|
|
code,
|
|
|
- token: token.value || ''
|
|
|
|
|
|
|
+ token: token.value || '',
|
|
|
|
|
+ qrToken: qrToken.value || '',
|
|
|
}
|
|
}
|
|
|
bingPhoneByCode(params).then((res) => {
|
|
bingPhoneByCode(params).then((res) => {
|
|
|
if (res.code == 0 && res.body.res == 0) {
|
|
if (res.code == 0 && res.body.res == 0) {
|
|
@@ -128,6 +134,7 @@ function handlePhoneNumberLogin(code) {
|
|
|
|
|
|
|
|
onLoad((option: any) => {
|
|
onLoad((option: any) => {
|
|
|
isLogout.value = option.isLogout == "1"
|
|
isLogout.value = option.isLogout == "1"
|
|
|
|
|
+ qrToken.value = option.scene || ""
|
|
|
if(!isLogout.value) init()
|
|
if(!isLogout.value) init()
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
@@ -175,7 +182,6 @@ onLoad((option: any) => {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 300rpx;
|
|
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
line-height: 28rpx;
|
|
line-height: 28rpx;
|
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|