You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< script setup >
import DraggableButton from "@/pages/components/goHome.vue" ;
/**
* name:
* user: sa0ChunLuyu
* date: 2024年8月12日 19:47:35
*/
import {
ref
} from 'vue'
import {
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
const $props = defineProps ( {
openid : {
type : String ,
default : ''
} ,
path : {
type : String ,
default : ''
} ,
orderid : {
type : String ,
default : ''
}
} ) ;
const tip _str = ref ( '授权登录中,请稍候...' )
const checkOpenid = ( ) => {
let openid = ''
let path = ''
let param = ''
if ( ! ! $props . openid ) {
openid = decodeURIComponent ( $props . openid )
}
if ( ! ! $props . path ) {
path = decodeURIComponent ( $props . path )
const index = path . indexOf ( '#' ) ;
if ( index !== - 1 ) {
path = path . substring ( 0 , index ) ; // 包含 # 时,返回 # 前面的部分
}
param = param + "?path=" + path
}
if ( ! ! $props . orderid ) {
path = decodeURIComponent ( $props . orderid )
const index = path . indexOf ( '#' ) ;
if ( index !== - 1 ) {
path = path . substring ( 0 , index ) ; // 包含 # 时,返回 # 前面的部分
}
param = param + "&orderid=" + path
}
if ( ! ! openid ) {
const index = openid . indexOf ( '#' ) ;
if ( index !== - 1 ) {
openid = openid . substring ( 0 , index ) ; // 包含 # 时,返回 # 前面的部分
}
uni . setStorageSync ( 'OPENID' , openid )
uni . redirectTo ( {
url : "/pages/main/index/index" + param
} )
} else {
tip _str . value = '未获取到授权信息,请从小程序进入'
}
}
onShow ( ( ) => {
checkOpenid ( )
} )
< / script >
< template >
< view class = "tip_wrapper" >
{ { tip _str } }
< / view >
< / template >
< style scoped >
. tip _wrapper {
height : 100 vh ;
width : 100 % ;
display : flex ;
align - items : center ;
justify - content : center ;
}
< / style >