Commit e23a80b2 by yuzhenWang

Merge branch 'feature-20260203-解决外部跳转页面登录问题' into 'dev'

加启动页逻辑发布测试

See merge request !76
parents c9fc0671 721bc2e5
......@@ -10,7 +10,7 @@
/>
<image
class="imgbox"
:src="baseURL + `/${imgType}/static/images/applyBg.png`"
src="../assets/images/applyBg.png"
mode="widthFix"
></image>
<view class="wapper">
......@@ -135,8 +135,7 @@
data() {
return {
companyInfo:environment.companyInfo,
imgType:environment.companyInfo.imgType,
baseURL:environment.baseURL,
shareURL:environment.shareURL,
form:{
mobile:'',
nickName:'',
......
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
......@@ -496,6 +497,13 @@
"webviewDebug": true
}
}
},
{
"path": "pages/lanch/index",
"style": {
"topWindow": false,
"navigationBarTitleText": "启动页"
}
}
],
......
<template>
<view class="loadTxt">Loading...</view>
</template>
<script setup >
import { ref } from "vue";
import api from '@/api/api';
import { onLaunch, onLoad } from '@dcloudio/uni-app'
import * as environment from '@/environments/environment'
let dataToken = ref()
onLoad((options) => {
// 参数带token了重新登录
if (options.dataToken) {
// uni.clearStorageSync();
dataToken.value = options.dataToken
reLogin(options.landingPage)
}
})
const reLogin = (landingPage) => {
uni.showLoading({
title: '加载中...'
});
// 添加iOS平台检测
const isIOS = navigator.platform.match(/(iPhone|iPod|iPad)/i);
const params = {
loginType: '5',
authToken: dataToken.value
}
api.loginVerification(params).then((res) => {
if (res['success']) {
uni.setStorageSync('isLogin', '1');
uni.setStorageSync('loginType', 'codelogin');
uni.setStorageSync('cffp_userId', res.data.userId);
uni.setStorageSync('uni-token', res.data['token']);
dataToken.value = ''
uni.removeStorageSync('dataToken')
if (landingPage == 'sfpHousePurchase') {
uni.reLaunch({ url: `/sfp/housePurchase/housePurchase` })
}else if(landingPage == 'sfpIndex'){
uni.reLaunch({ url: `/sfp/index/index` })
}
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
uni.hideLoading()
}
</script>
<style lang="scss" scoped>
.loadTxt {
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment