This commit is contained in:
@@ -70,13 +70,24 @@
|
||||
import { useUserStore } from '@/store/index.js';
|
||||
import { initWxConfig, wxScan, isInWechat } from '@/utils/wxsdk.js';
|
||||
|
||||
const POST_BIND_RELOGIN_NOTICE_KEY = 'postBindReloginNotice';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const identifier = ref(uni.getStorageSync('identifier') || '');
|
||||
const loading = ref(false);
|
||||
const agreed = ref(true);
|
||||
const inputFocus = ref(false);
|
||||
const showError = ref(false);
|
||||
const wechatAppId = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
const token = uni.getStorageSync('token');
|
||||
if (token) {
|
||||
uni.reLaunch({ url: '/pages/index/index' });
|
||||
return;
|
||||
}
|
||||
|
||||
showPostBindReloginNotice();
|
||||
handleWechatCallback();
|
||||
getPathDeviceId();
|
||||
|
||||
@@ -93,12 +104,18 @@
|
||||
// #endif
|
||||
});
|
||||
|
||||
const identifier = ref('');
|
||||
const loading = ref(false);
|
||||
const agreed = ref(true);
|
||||
const inputFocus = ref(false);
|
||||
const showError = ref(false);
|
||||
const wechatAppId = ref('');
|
||||
const showPostBindReloginNotice = () => {
|
||||
if (uni.getStorageSync(POST_BIND_RELOGIN_NOTICE_KEY) !== '1') {
|
||||
return;
|
||||
}
|
||||
|
||||
uni.removeStorageSync(POST_BIND_RELOGIN_NOTICE_KEY);
|
||||
uni.showToast({
|
||||
title: '绑定手机号成功,请重新登录',
|
||||
icon: 'none',
|
||||
duration: 2500
|
||||
});
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
@@ -152,7 +169,7 @@
|
||||
doLogin();
|
||||
};
|
||||
|
||||
const handleScanLogin = async () => {
|
||||
const handleScanLogin = async () => {
|
||||
// #ifdef H5
|
||||
try {
|
||||
// 检查是否在微信环境
|
||||
@@ -218,7 +235,6 @@ const handleScanLogin = async () => {
|
||||
};
|
||||
|
||||
const handleWechatCallback = async () => {
|
||||
|
||||
const code = getCode();
|
||||
const assetToken = sessionStorage.getItem('assetToken');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user