123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <view>
- <headContent borderBottom>
- <template #left>
- <reverse-back />
- </template>
- <template #content>
- <view class="haed-title">
- 绑定谷歌验证
- </view>
- </template>
- </headContent>
- <view class="content-box">
- <text class="lable-text">1. 安装谷歌验证器</text>
- <text class="lable-hint">首先您需要在手机上安装谷歌验证器</text>
- <text class="lable-hint">(GoogleAuthenticator)</text>
- <view class="app-box">
- <image class="app-icon" src="@/static/images/google.png" mode="aspectFit"></image>
- <text class="app-btn" @click.stop="openUrl">立即安装</text>
- </view>
- <text class="lable-text">2. 绑定谷歌验证器</text>
- <text class="lable-hint">使用谷歌验证器App扫描该二维码或输入密钥</text>
- <text class="lable-hint">(GoogleAuthenticator)</text>
- <view class="qrcode">
- <tki-qrcode ref="qrcodeRef" :size="100" :showLoading="false" :val="codeurl" />
- </view>
- <view class="copy-box">
- <text class="copy-num">{{secret}}</text>
- <text v-show="secret" class="copy-icon iconfont" @click.stop="copySecret(secret)"></text>
- </view>
- <view class="copy-hint">
- 请将16位密钥记录在纸上,并保存在安全的地方,如果遇到手机丢失,您可以通过密钥恢复您的谷歌验证。
- </view>
- <text class="bind-btn" @click.stop="bind">绑定</text>
- </view>
- </view>
- </template>
- <script>
- import {
- Api_getGoogle
- } from "@/api/index.js"
- export default {
- name: 'Google',
- data() {
- return {
- val: '',
- account: '',
- secret: "", // 密钥
- codeurl: ""
- };
- },
- onLoad(opt) {
- this.account = opt?.account
- this.getGoogle()
- },
- mounted() {
-
- },
- methods: {
- getGoogle() {
- Api_getGoogle().then(res => {
- this.secret = res.secret
- this.codeurl = res.codeurl
- this.$nextTick(() => {
- if (this.codeurl) {
- this.$refs.qrcodeRef._makeCode()
- }
- })
- })
- },
- openUrl() {
- // const url = 'https://m.torrent.org.cn/soft/2703.html'
- const url = 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=zh&gl=US'
- plus.runtime.openWeb(url);
- },
- copySecret(secret) {
- uni.setClipboardData({
- data: secret,
- success: res => {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- })
- }
- });
- },
- bind() {
- // this.type = opt?.type;
- // this.account = opt?.account;
- uni.navigateTo({
- url: `/pages/login/safety-verification?type=2&account=${this.account}`
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content-box {
- width: 100%;
- padding: 20rpx $pages-padding;
- display: flex;
- flex-direction: column;
- .lable-text {
- font-size: 32rpx;
- font-weight: bold;
- line-height: 1.6;
- }
- .lable-hint {
- font-size: 28rpx;
- line-height: 1.4;
- color: $SizeColor3;
- }
- .app-box {
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 50rpx 0;
- .app-icon {
- width: 100rpx;
- height: 100rpx;
- }
- .app-btn {
- background-color: $Theme-Color;
- width: 200rpx;
- height: 70rpx;
- text-align: center;
- line-height: 70rpx;
- font-size: 28rpx;
- color: #fff;
- border-radius: 10rpx;
- margin-top: 40rpx;
- }
- }
- .qrcode {
- text-align: center;
- padding: 60rpx 0;
- }
- .copy-box {
- width: 100%;
- background-color: $bg_02;
- height: 80rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- .copy-num {
- font-size: 26rpx;
- font-weight: bold;
- }
- .copy-icon {
- font-size: 28rpx;
- color: $Theme-Color;
- padding-left: 30rpx;
- }
- }
- .copy-hint {
- padding: 10rpx 0;
- font-size: 26rpx;
- color: $Theme-Color;
- }
- .bind-btn {
- font-size: 28rpx;
- width: 100%;
- height: 80rpx;
- background-color: $Theme-Color;
- border-radius: 10rpx;
- text-align: center;
- line-height: 80rpx;
- color: #fff;
- margin-top: 20rpx;
- }
- }
- </style>
|