add alias @ as path

This commit is contained in:
simple321vip
2023-01-28 17:19:05 +08:00
parent e7cf872567
commit 67eaa3ad40
6 changed files with 46 additions and 7 deletions
+23 -1
View File
@@ -1,3 +1,5 @@
import { Tenant } from '@/entity';
import { tenantStore } from '@/store/modules/tenant';
import router from '../router'
import { setToken, setTenant } from '../utils/auth'
@@ -41,7 +43,27 @@ const scan_method: any = {
production: (qrcode: string) => {
window.location.href = qrcode
},
development: () => {
development: async () => {
const useTenantStore = tenantStore()
const tenant: Tenant = {
tenant_id: '7788',
account: '小小的测试账户'
}
let token = 'ABCDEFG'
await useTenantStore.login(tenant, token).then(() => {
const { href } = router.resolve({
path: '/'
})
window.open(href, '_self')
}).catch((error) => {
const { href } = router.resolve({
path: '/login'
})
window.open(href, '_self')
})
setToken("token")
setTenant(
{