mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
feat(web): add lint (#875)
* feat: add lint * feat: fix lint error * chore: add ignore file * chore: close indent
This commit is contained in:
@ -45,18 +45,18 @@ export function getUserApplication(owner, name) {
|
||||
export function updateApplication(owner, name, application) {
|
||||
let newApplication = Setting.deepCopy(application);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-application?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newApplication),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function addApplication(application) {
|
||||
let newApplication = Setting.deepCopy(application);
|
||||
newApplication.organization = "built-in"
|
||||
newApplication.organization = "built-in";
|
||||
return fetch(`${Setting.ServerUrl}/api/add-application`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newApplication),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -64,8 +64,8 @@ export function addApplication(application) {
|
||||
export function deleteApplication(application) {
|
||||
let newApplication = Setting.deepCopy(application);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-application`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newApplication),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getCert(owner, name) {
|
||||
export function updateCert(owner, name, cert) {
|
||||
let newCert = Setting.deepCopy(cert);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-cert?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newCert),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateCert(owner, name, cert) {
|
||||
export function addCert(cert) {
|
||||
let newCert = Setting.deepCopy(cert);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-cert`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newCert),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addCert(cert) {
|
||||
export function deleteCert(cert) {
|
||||
let newCert = Setting.deepCopy(cert);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-cert`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newCert),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getModel(owner, name) {
|
||||
export function updateModel(owner, name, model) {
|
||||
let newModel = Setting.deepCopy(model);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-model?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newModel),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateModel(owner, name, model) {
|
||||
export function addModel(model) {
|
||||
let newModel = Setting.deepCopy(model);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-model`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newModel),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addModel(model) {
|
||||
export function deleteModel(model) {
|
||||
let newModel = Setting.deepCopy(model);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-model`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newModel),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getOrganization(owner, name) {
|
||||
export function updateOrganization(owner, name, organization) {
|
||||
let newOrganization = Setting.deepCopy(organization);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-organization?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newOrganization),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateOrganization(owner, name, organization) {
|
||||
export function addOrganization(organization) {
|
||||
let newOrganization = Setting.deepCopy(organization);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-organization`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newOrganization),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addOrganization(organization) {
|
||||
export function deleteOrganization(organization) {
|
||||
let newOrganization = Setting.deepCopy(organization);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-organization`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newOrganization),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getPayment(owner, name) {
|
||||
export function updatePayment(owner, name, payment) {
|
||||
let newPayment = Setting.deepCopy(payment);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-payment?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPayment),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updatePayment(owner, name, payment) {
|
||||
export function addPayment(payment) {
|
||||
let newPayment = Setting.deepCopy(payment);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-payment`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPayment),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addPayment(payment) {
|
||||
export function deletePayment(payment) {
|
||||
let newPayment = Setting.deepCopy(payment);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-payment`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPayment),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getPermission(owner, name) {
|
||||
export function updatePermission(owner, name, permission) {
|
||||
let newPermission = Setting.deepCopy(permission);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-permission?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPermission),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updatePermission(owner, name, permission) {
|
||||
export function addPermission(permission) {
|
||||
let newPermission = Setting.deepCopy(permission);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-permission`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPermission),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addPermission(permission) {
|
||||
export function deletePermission(permission) {
|
||||
let newPermission = Setting.deepCopy(permission);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-permission`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newPermission),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getProduct(owner, name) {
|
||||
export function updateProduct(owner, name, product) {
|
||||
let newProduct = Setting.deepCopy(product);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-product?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProduct),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateProduct(owner, name, product) {
|
||||
export function addProduct(product) {
|
||||
let newProduct = Setting.deepCopy(product);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-product`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProduct),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,15 +49,15 @@ export function addProduct(product) {
|
||||
export function deleteProduct(product) {
|
||||
let newProduct = Setting.deepCopy(product);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-product`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProduct),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function buyProduct(owner, name, providerId) {
|
||||
return fetch(`${Setting.ServerUrl}/api/buy-product?id=${owner}/${encodeURIComponent(name)}&providerName=${providerId}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getProvider(owner, name) {
|
||||
export function updateProvider(owner, name, provider) {
|
||||
let newProvider = Setting.deepCopy(provider);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-provider?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProvider),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateProvider(owner, name, provider) {
|
||||
export function addProvider(provider) {
|
||||
let newProvider = Setting.deepCopy(provider);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-provider`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProvider),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addProvider(provider) {
|
||||
export function deleteProvider(provider) {
|
||||
let newProvider = Setting.deepCopy(provider);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-provider`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newProvider),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getResource(owner, name) {
|
||||
export function updateResource(owner, name, resource) {
|
||||
let newResource = Setting.deepCopy(resource);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-resource?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newResource),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateResource(owner, name, resource) {
|
||||
export function addResource(resource) {
|
||||
let newResource = Setting.deepCopy(resource);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-resource`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newResource),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addResource(resource) {
|
||||
export function deleteResource(resource, provider="") {
|
||||
let newResource = Setting.deepCopy(resource);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-resource?provider=${provider}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newResource),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -61,7 +61,7 @@ export function uploadResource(owner, user, tag, parent, fullFilePath, file, pro
|
||||
formData.append("file", file);
|
||||
return fetch(`${Setting.ServerUrl}/api/upload-resource?owner=${owner}&user=${user}&application=${application}&tag=${tag}&parent=${parent}&fullFilePath=${encodeURIComponent(fullFilePath)}&provider=${provider}`, {
|
||||
body: formData,
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
}).then(res => res.json())
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getRole(owner, name) {
|
||||
export function updateRole(owner, name, role) {
|
||||
let newRole = Setting.deepCopy(role);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-role?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newRole),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateRole(owner, name, role) {
|
||||
export function addRole(role) {
|
||||
let newRole = Setting.deepCopy(role);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-role`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newRole),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addRole(role) {
|
||||
export function deleteRole(role) {
|
||||
let newRole = Setting.deepCopy(role);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-role`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newRole),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getSyncer(owner, name) {
|
||||
export function updateSyncer(owner, name, syncer) {
|
||||
let newSyncer = Setting.deepCopy(syncer);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-syncer?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSyncer),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateSyncer(owner, name, syncer) {
|
||||
export function addSyncer(syncer) {
|
||||
let newSyncer = Setting.deepCopy(syncer);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-syncer`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSyncer),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,15 +49,15 @@ export function addSyncer(syncer) {
|
||||
export function deleteSyncer(syncer) {
|
||||
let newSyncer = Setting.deepCopy(syncer);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-syncer`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newSyncer),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function runSyncer(owner, name) {
|
||||
return fetch(`${Setting.ServerUrl}/api/run-syncer?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
method: "GET",
|
||||
credentials: "include",
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getToken(owner, name) {
|
||||
export function updateToken(owner, name, token) {
|
||||
let newToken = Setting.deepCopy(token);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-token?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newToken),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateToken(owner, name, token) {
|
||||
export function addToken(token) {
|
||||
let newToken = Setting.deepCopy(token);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-token`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newToken),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addToken(token) {
|
||||
export function deleteToken(token) {
|
||||
let newToken = Setting.deepCopy(token);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-token`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newToken),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ export function getUser(owner, name) {
|
||||
export function updateUser(owner, name, user) {
|
||||
let newUser = Setting.deepCopy(user);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-user?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newUser),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -48,8 +48,8 @@ export function updateUser(owner, name, user) {
|
||||
export function addUser(user) {
|
||||
let newUser = Setting.deepCopy(user);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-user`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newUser),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -57,8 +57,8 @@ export function addUser(user) {
|
||||
export function deleteUser(user) {
|
||||
let newUser = Setting.deepCopy(user);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-user`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newUser),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ export function getWebhook(owner, name) {
|
||||
export function updateWebhook(owner, name, webhook) {
|
||||
let newWebhook = Setting.deepCopy(webhook);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-webhook?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newWebhook),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -40,8 +40,8 @@ export function updateWebhook(owner, name, webhook) {
|
||||
export function addWebhook(webhook) {
|
||||
let newWebhook = Setting.deepCopy(webhook);
|
||||
return fetch(`${Setting.ServerUrl}/api/add-webhook`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newWebhook),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
@ -49,8 +49,8 @@ export function addWebhook(webhook) {
|
||||
export function deleteWebhook(webhook) {
|
||||
let newWebhook = Setting.deepCopy(webhook);
|
||||
return fetch(`${Setting.ServerUrl}/api/delete-webhook`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newWebhook),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
Reference in New Issue
Block a user