c5_labsci/fapp/ciyon_ap/pages/demo/comview/auth.vue

96 lines
2.6 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ciy-header ref="header" title="ciy-auth组件"></ciy-header>
<view>
<view class="ciy-card">
<view class="title">注册登录</view>
<view class="content">
<view class="tip">
实现登录注册找回密码功能<br />
微信小程序下自动注册登录<br />
H5/APP下手机号密码手动注册<br />
协议链接一般在lang中配置login.xieyi<br />
</view>
<view class="txt-wb">原理</view>
<view class="tip">
通用组件每个页面在vite阶段自动补全<br />
用户信息保存到localstorage的me中<br />
登录后其他信息包括字典积分埋点等<br />
在app.globalData中配置:<br />
 1是否支持微信快捷登录/注册功能<br />
 2顶部装饰图和高度<br />
</view>
<view>
</view>
</view>
</view>
<view class="ciy-card">
<view class="title">属性</view>
<view class="content">
</view>
</view>
<view class="ciy-card">
<view class="title">方法</view>
<view class="content">
<view class="fun">Open</view>
<view class="tip">
已被getauth封装<br />
自动微信登录注册未登录则打开界面
</view>
<view class="hr"></view>
<view class="fun">this.getauth(type)</view>
<view class="tip">
调取登录状态<br />
type: 静默登录(默认)
type: relogin 强制打开登录界面(换号登录)
type: info 需填写个人信息
type: real 需实名认证前提info
type: bank 需填写银行前提real
type: cciy 需有全球众识码前提real
</view>
<button class="btn sm" @tap="demo">调用</button>
<button class="btn sm def" @tap="logout">登出</button>
</view>
</view>
<view class="ciy-card">
<view class="title">事件</view>
<view class="content">
<!-- <view class="evt">@change</view> -->
<view class="log" v-for="(item, index) in eventlog" :key="index">
<text class="code">{{eventlog.length - index}}</text>
{{item}}
</view>
</view>
</view>
<view class="hr"></view>
</view>
</template>
<style>
@import '@/pages/demo/zdemo.css';
</style>
<script>
import zmixin from '@/pages/demo/zmixin.js';
export default {
mixins: [zmixin],
data() {
return {}
},
onLoad() {},
methods: {
async demo(b) {
var auth = await this.getauth();
if (auth.me.id == 0)
return this.toast('尚未登录');
console.log(auth);
this.toast('已登录');
},
logout(b) {
this.removestorage('me');
}
}
}
</script>