优化
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
const runtimeEnvironment = import.meta.env || {}
|
||||
const configuredAuthApiRoot = runtimeEnvironment.VITE_AUTH_API_BASE_URL || ''
|
||||
const configuredOverseasApiRoot = runtimeEnvironment.VITE_OVERSEAS_API_BASE_URL || ''
|
||||
const development = Boolean(runtimeEnvironment.DEV)
|
||||
|
||||
export const API_ROOT = String(configuredAuthApiRoot || '/api').replace(/\/$/, '')
|
||||
export const OVERSEAS_API_ROOT = String(configuredOverseasApiRoot || '/api/overseas').replace(/\/$/, '')
|
||||
export const DEV_LOGIN = Object.freeze({
|
||||
username: development ? String(runtimeEnvironment.VITE_PDA_DEV_USERNAME || '') : '',
|
||||
password: development ? String(runtimeEnvironment.VITE_PDA_DEV_PASSWORD || '') : ''
|
||||
})
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
|
||||
<script>
|
||||
import { login as loginRequest } from '@/api/auth.js'
|
||||
import { DEV_LOGIN } from '@/config/runtime.js'
|
||||
import { session, restoreSession, signInWithTokens } from '@/stores/session.js'
|
||||
import { requireOnline } from '@/utils/network.js'
|
||||
export default {
|
||||
data() { return { form: { userId: '', password: '' }, error: '', submitting: false } },
|
||||
data() { return { form: { userId: DEV_LOGIN.username, password: DEV_LOGIN.password }, error: '', submitting: false } },
|
||||
onLoad() { if (session.currentUser || restoreSession()) uni.reLaunch({ url: '/pages/home/home' }) },
|
||||
methods: {
|
||||
async login() {
|
||||
|
||||
Reference in New Issue
Block a user