@@ -2,16 +2,16 @@ import { AxiosPromise } from "axios";
import request from "../request";
const login = {
//公众号登陆
- logingzhcode(data: {
+ loginGzhcode(params: {
authorizationCode: string
- }): AxiosPromise<login.logingzhcode> {
+ }): AxiosPromise<login.loginGzhcode> {
return request({
url: 'login/gzhcode',
headers: {
isToken: "0",
},
method: 'post',
- params: data
+ params: params
})
}
@@ -3,7 +3,7 @@ declare namespace login {
code: number,
msg: string
- interface logingzhcode extends response {
+ interface loginGzhcode extends response {
data: {
thirdResult: {
city: string
@@ -1,5 +1,6 @@
import { RouteRecordRaw, createRouter, createWebHashHistory,createWebHistory } from 'vue-router';
import guard from './guard';
+
// 导入views文件夹下的所有组件
const modules = import.meta.glob("../views/**/index.vue");
console.log(modules)
@@ -54,7 +55,7 @@ for (const path in modules) {
const routes: RouteRecordRaw[] = [
{
path:'/',
- redirect:'/home'
+ component:()=>import('./../views/home/index.vue')
path: '/about',
@@ -98,7 +98,7 @@ export default defineComponent({
onMounted(async () => {
if (route.query.state === 'LOGIN') {
- await api.login.logingzhcode({
+ await api.login.loginGzhcode({
authorizationCode: route.query.code as string
}).then(res => {
Toast.success({
@@ -106,7 +106,7 @@ export default defineComponent({
forbidClick: true
window.localStorage.setItem("token", res.data.data.token)
- router.push('./')
+ router.replace('./')
}).catch(err => {