Minor - format code, update lang

pull/3989/head
Julio 3 years ago
parent 31c10a2486
commit e55b7a421a
  1. 14
      assets/vue/components/Login.vue
  2. 4
      assets/vue/pages/Home.vue
  3. 2
      assets/vue/pages/Login.vue

@ -13,7 +13,8 @@
<input id="password" v-model="password" name="password" type="password" autocomplete="current-password"
required=""
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
placeholder="Password"/>
placeholder="Password"
/>
</div>
</div>
@ -22,20 +23,19 @@
<input id="remember_me" name="remember_me" type="checkbox"
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"/>
<label for="remember_me" class="ml-2 block text-sm text-gray-900">
Remember me
{{ $t('Remember me') }}
</label>
</div>
<div class="text-sm">
<a href="/main/auth/lostPassword.php" id="forgot" class="font-medium text-blue-600 hover:text-blue-500">
Forgot your password?
{{ $t('Forgot your password?') }}
</a>
</div>
</div>
<div>
<!-- class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"-->
<button
type="submit"
class="btn btn-primary group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium text-white"
@ -51,15 +51,13 @@
class="h-5 w-5 text-blue-500 group-hover:text-blue-400" aria-hidden="true"
/>
</span>
Sign in
{{ $t('Sign in') }}
</button>
</div>
</form>
</template>
<script>
import {mapGetters, useStore} from 'vuex';
import { LockClosedIcon } from '@heroicons/vue/solid'
import useState from "../hooks/useState";
@ -83,7 +81,6 @@ export default {
let redirect = route.query.redirect;
if (store.getters["security/isAuthenticated"]) {
console.log(redirect);
if (typeof redirect !== "undefined") {
router.push({path: redirect});
} else {
@ -99,7 +96,6 @@ export default {
}
async function performLogin() {
console.log('performLogin');
let payload = {login: login.value, password: password.value};
let redirect = route.query.redirect;
await store.dispatch("security/login", payload);

@ -24,15 +24,11 @@ import {ENTRYPOINT} from "../config/entrypoint";
export default {
name: "Home",
setup() {
const router = useRouter();
const store = useStore();
const state = reactive({
announcements: [],
});
axios.get('/news/list').then(response => {
console.log(response.data);
console.log(response);
if (Array.isArray(response.data)) {
state.announcements = response.data;
}

@ -3,7 +3,7 @@
<div class="max-w-md w-full space-y-8">
<div>
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
Sign in
{{ $t('Sign in') }}
</h2>
</div>
<Login />

Loading…
Cancel
Save