60 lines
1.1 KiB
Vue
60 lines
1.1 KiB
Vue
<template>
|
|
<view class="authorization">
|
|
<h2>授权登录</h2>
|
|
<button type="primary" @click="AuthorizationLogin">授权Web登录</button>
|
|
<p class="tips">{{tips}}</p>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
tips: null
|
|
}
|
|
},
|
|
methods: {
|
|
AuthorizationLogin() {
|
|
console.log("授权Web登录");
|
|
uni.request({
|
|
url: `${this.$config.baseUrl}/AuthorizedWeb`,
|
|
method: 'GET',
|
|
data: {
|
|
uid: uni.getStorageSync('userinfo').id
|
|
},
|
|
success: (res) => {
|
|
if (res.data.status == 404) {
|
|
uni.showToast({
|
|
title: res.data.msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
});
|
|
} else {
|
|
uni.showToast({
|
|
title: res.data.msg,
|
|
icon: 'none',
|
|
duration: 3000
|
|
});
|
|
this.tips = res.data.msg
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.authorization {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 20% 0;
|
|
text-align: center;
|
|
flex-direction: column;
|
|
}
|
|
h2 {
|
|
margin-bottom: 20px;
|
|
}
|
|
</style>
|