mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
feat: support storage provider to terms of use file (#221)
Signed-off-by: WindSpiritSR <simon343riley@gmail.com>
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
import * as Setting from "../Setting";
|
||||
import * as AuthBackend from "../auth/AuthBackend";
|
||||
|
||||
export function getApplications(owner) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-applications?owner=${owner}`, {
|
||||
|
@ -79,18 +79,11 @@ export function getAffiliationOptions(url, code) {
|
||||
export function uploadFile(folder, subFolder, file) {
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
fetch(`${Setting.ServerUrl}/api/upload-file?folder=${encodeURIComponent(folder)}&subFolder=${encodeURIComponent(subFolder)}`, {
|
||||
return fetch(`${Setting.ServerUrl}/api/upload-file?folder=${encodeURIComponent(folder)}&subFolder=${encodeURIComponent(subFolder)}`, {
|
||||
body: formData,
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
}).then(res => res.json())
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
window.location.href = "/account";
|
||||
} else {
|
||||
Setting.showMessage("error", res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function setPassword(userOwner, userName, oldPassword, newPassword) {
|
||||
|
Reference in New Issue
Block a user