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.
39 lines
595 B
Vue
39 lines
595 B
Vue
<template>
|
|
<view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
ref
|
|
} from "vue"
|
|
|
|
import {
|
|
WXGetOpenid
|
|
} from "@/api"
|
|
import {
|
|
onLoad
|
|
} from "@dcloudio/uni-app"
|
|
let code=ref('')
|
|
const WXGetOpenidFuc = () => {
|
|
WXGetOpenid({code:code.value}).then(res => {
|
|
if (res.status) {
|
|
sessionStorage.setItem("access_token", res.data.token)
|
|
sessionStorage.setItem("refresh_token", res.data.refresh_token)
|
|
uni.reLaunch({
|
|
url:'/pages/user/list'
|
|
})
|
|
}
|
|
})
|
|
}
|
|
onLoad((option) => {
|
|
code.value=option.code
|
|
WXGetOpenidFuc()
|
|
})
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|