Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

club #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions login/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ axios.get(getUrl(`/login/list`)).then((response) => {
option.appendChild(textNode);
document.querySelector("#club").insertBefore(option, document.querySelector("#admin-option"));
console.log("append:", option);
$('select').material_select();
});
console.log(map);
}).catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion src/js/backend.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const backendUrl = "127.0.0.1:9090";
const backendUrl = "127.0.0.1:8083";
const getUrl = (x) => { console.log(`http://${backendUrl}${x}`); return `http://${backendUrl}${x}` };
10 changes: 5 additions & 5 deletions superAdmin/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Vue.component('club-item', {
template: '<tr class="row"><td class="col l1 m2">{{ name }}</td><td class="col l1 m1">{{ id }}</td><td class="col l2 m2">{{ username }}</td><td class="col l1 m1"><img :src=logo style="height: 18px;"></td><td class="col l5 m3">{{ intro }}</td><td class="col l2 m3"><a class="reset-pwd" href="#!" :data-id=id>重置密码</a><a href="#!" :data-id=id class="delete-club">删除社团</a></td></tr>'
});
let data;
axios.get(getUrl(`/community/list`))
axios.get(getUrl(`/club/list`))
.then((response) => {
console.log(response);
if (response.status != 200) {
Expand Down Expand Up @@ -94,14 +94,14 @@ const postData = (dom, url, data, confirmTitle, confirmContent) => {
}
document.querySelector("#add-btn").addEventListener("click", () => {
let dom = document.querySelector("#add-input");
postData(dom, "/community/add", {
postData(dom, "/club/add", {
username: dom.value,
password: "12345678"
}, "添加成功", `已添加用户${dom.value},默认登录密码为:12345678。`);
});
document.querySelector("#undo-btn").addEventListener("click", () => {
let dom = document.querySelector("#undo-input");
postData(dom, "/community/undo", {
postData(dom, "/club/add", {
id: dom.value
}, "找回成功", `已找回社团:${dom.value}(id)。`);
});
Expand All @@ -115,7 +115,7 @@ document.querySelector("#reset-btn").addEventListener("click", () => {
});
document.querySelector("#delete-btn").addEventListener("click", () => {
let dom = document.querySelector("#delete-input");
postData(dom, "/community/delete", {
postData(dom, "/club/delete", {
id: dom.value
}, "删除成功", `已删除社团:${dom.value}(id)。`);
});
Expand All @@ -129,7 +129,7 @@ document.querySelector("#search-btn").addEventListener("click", () => {
let dom = document.querySelector("#search-input");
if (!check(dom)) return;
$('#loading').modal('open');
axios.get(getUrl('/community/search'), {
axios.get(getUrl('/club/search'), {
comName: dom.value
}).then((response) => {
console.log(response);
Expand Down