login: use fetchRemoteSources
This commit is contained in:
parent
62c7881f2f
commit
fb3509fc9d
|
@ -108,3 +108,9 @@ export async function approveTask(runid, taskid) {
|
||||||
let res = await fetch(apiurl(path), init)
|
let res = await fetch(apiurl(path), init)
|
||||||
return res.json();
|
return res.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function fetchRemoteSources() {
|
||||||
|
let path = "/remotesources"
|
||||||
|
let res = await fetch(apiurl(path));
|
||||||
|
return res.json();
|
||||||
|
}
|
|
@ -19,8 +19,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { fetchRemoteSources } from "@/util/data";
|
||||||
|
import { loginurl, fetch, login, logout } from "@/util/auth";
|
||||||
|
|
||||||
import LoginForm from "@/components/loginform";
|
import LoginForm from "@/components/loginform";
|
||||||
import { apiurl, loginurl, fetch, login, logout } from "@/util/auth";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Login",
|
name: "Login",
|
||||||
|
@ -34,8 +36,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getRemoteSources() {
|
async getRemoteSources() {
|
||||||
let res = await (await fetch(apiurl("/remotesources"))).json();
|
this.remotesources = await fetchRemoteSources();
|
||||||
this.remotesources = res;
|
|
||||||
},
|
},
|
||||||
async doLogin(rsName, username, password) {
|
async doLogin(rsName, username, password) {
|
||||||
let u = loginurl();
|
let u = loginurl();
|
||||||
|
|
Loading…
Reference in New Issue