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