xbx #200
@ -1203,3 +1203,12 @@ export async function authLogin(id:number, type: number, img: string = "") {
|
|||||||
message.error(res.msg);
|
message.error(res.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function accessToken(code:string) {
|
||||||
|
const res = await get("accessToken", {code})
|
||||||
|
if(res.code == 0){
|
||||||
|
return res.data
|
||||||
|
}else{
|
||||||
|
message.error(res.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { accessToken } from "@/api";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
@ -12,8 +13,11 @@ import { useRoute } from "vue-router";
|
|||||||
|
|
||||||
export default defineComponent(({
|
export default defineComponent(({
|
||||||
setup(){
|
setup(){
|
||||||
const code = useRoute().query.code;
|
const code: any = useRoute().query.code;
|
||||||
window.location.href=`https://api.weibo.com/oauth2/access_token?client_id=2754574056&client_secret=2f16267634db2de14cda7891c49aa54a&grant_type=authorization_code&redirect_uri=https://beelink.theluyuan.com/wblogin&code=${code}`
|
accessToken(code).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
// window.location.href=`https://api.weibo.com/oauth2/access_token?client_id=2754574056&client_secret=2f16267634db2de14cda7891c49aa54a&grant_type=authorization_code&redirect_uri=https://beelink.theluyuan.com/wblogin&code=${code}`
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue
Block a user