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.

55 lines
1.2 KiB
Vue

This file contains ambiguous Unicode characters!

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.

<template>
<view>
登陆中...
</view>
</template>
<script setup>
import{ref} from "vue"
import {login} from "@/api"
import {onLoad} from "@dcloudio/uni-app"
const fetchData=(data,e)=> {
login(data).then(res => {
console.log(res)
if(res.status){
sessionStorage.setItem("access_token",res.data.token)
sessionStorage.setItem("refresh_token",res.data.refresh_token)
if(e.objtype && e.page){
uni.reLaunch({
url: '/pages/'+e.objtype+'/'+e.page+'?ordernum='+e.ordernum+'&price='+e.price
})
}else{
uni.showToast({
title: "缺失跳转路径",
icon: 'none'
});
}
}else{
uni.showToast({
title: res.msg,
icon: 'none'
});
}
})
}
onLoad((e)=>{
//获取url 应用编号appid 用户userid 跳转的项目类型objtype:发票invoice 工单chat 跳转页面page列表list 详情detail, 关联的订单号: ordernum ,详情的id,发票金额price
console.log(e)
if(e.userid && e.appid){
fetchData({appid:e.appid,openid:e.userid},e)
}else{
uni.showToast({
title: "缺失应用用户信息",
icon: 'none'
});
}
})
</script>
<style>
</style>