This commit is contained in:
2020-05-13 22:42:55 +00:00
parent 6e41dad1b0
commit 8c5d2f1e1d
6 changed files with 15 additions and 15 deletions

View File

@@ -261,15 +261,15 @@ export default {
return window.$gz.store.state.apiUrl + apiPath; return window.$gz.store.state.apiUrl + apiPath;
}, },
///////////////////////////// /////////////////////////////
// Attachment download URL // attachment download URL
// //
downloadUrl(fileId, ctype) { downloadUrl(fileId, ctype) {
//http://localhost:7575/api/v8/Attachment/download/100?t=sssss //http://localhost:7575/api/v8/attachment/download/100?t=sssss
//Ctype is optional and is the MIME content type, used to detect image urls at client for drag and drop ops //Ctype is optional and is the MIME content type, used to detect image urls at client for drag and drop ops
//in wiki but ignored by server //in wiki but ignored by server
let url = let url =
"Attachment/download/" + "attachment/download/" +
fileId + fileId +
"?t=" + "?t=" +
window.$gz.store.state.downloadToken; window.$gz.store.state.downloadToken;
@@ -445,7 +445,7 @@ export default {
body: data body: data
}; };
fetch(that.APIUrl("Attachment"), fetchOptions) fetch(that.APIUrl("attachment"), fetchOptions)
.then(that.status) .then(that.status)
.then(that.json) .then(that.json)
// eslint-disable-next-line // eslint-disable-next-line

View File

@@ -229,7 +229,7 @@ export default {
window.$gz.dialog.confirmDelete().then(dialogResult => { window.$gz.dialog.confirmDelete().then(dialogResult => {
if (dialogResult == true) { if (dialogResult == true) {
window.$gz.api window.$gz.api
.remove("Attachment/" + vm.editId) .remove("attachment/" + vm.editId)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
window.$gz.errorHandler.handleFormError(res.error); window.$gz.errorHandler.handleFormError(res.error);
@@ -250,7 +250,7 @@ export default {
getList() { getList() {
let vm = this; let vm = this;
window.$gz.api window.$gz.api
.get("Attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId) .get("attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
window.$gz.errorHandler.handleFormError(res.error); window.$gz.errorHandler.handleFormError(res.error);
@@ -274,7 +274,7 @@ export default {
let ret = []; let ret = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let o = data[i]; let o = data[i];
//http://localhost:7575/api/v8/Attachment/download/100?t=sssss //http://localhost:7575/api/v8/attachment/download/100?t=sssss
ret.push({ ret.push({
id: o.id, id: o.id,
concurrency: o.concurrency, concurrency: o.concurrency,
@@ -340,7 +340,7 @@ export default {
}; };
window.$gz.api window.$gz.api
.upsert("Attachment/" + vm.editId, p) .upsert("attachment/" + vm.editId, p)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
window.$gz.errorHandler.handleFormError(res.error); window.$gz.errorHandler.handleFormError(res.error);

View File

@@ -821,7 +821,7 @@ export default {
let vm = this; let vm = this;
vm.attachments = []; vm.attachments = [];
window.$gz.api window.$gz.api
.get("Attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId) .get("attachment/list?ayatype=" + vm.ayaType + "&ayaid=" + vm.ayaId)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
window.$gz.errorHandler.handleFormError(res.error); window.$gz.errorHandler.handleFormError(res.error);
@@ -929,12 +929,12 @@ export default {
insertUrl(url, name) { insertUrl(url, name) {
if (url) { if (url) {
let isImageUrl = false; let isImageUrl = false;
//Attachment? //attachment?
if (url.includes("Attachment/download/")) { if (url.includes("attachment/download/")) {
//it's an attachment url so fixup accordingly //it's an attachment url so fixup accordingly
//i paramter added by gzapi::downloadUrl function //i paramter added by gzapi::downloadUrl function
isImageUrl = url.includes("&i="); isImageUrl = url.includes("&i=");
let m = url.match(/Attachment\/download\/(.*)\?t=/); let m = url.match(/attachment\/download\/(.*)\?t=/);
if (m.length > 1) { if (m.length > 1) {
url = "[ATTACH:" + m[1] + "]"; url = "[ATTACH:" + m[1] + "]";
} else { } else {

View File

@@ -88,7 +88,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
const FORM_KEY = "home-password"; const FORM_KEY = "home-password";
const API_BASE_URL = "Auth/ChangePassword"; const API_BASE_URL = "auth/changepassword";
export default { export default {
created() { created() {

View File

@@ -467,7 +467,7 @@ export default {
let vm = this; let vm = this;
if (vm.canSave) { if (vm.canSave) {
vm.formState.loading = true; vm.formState.loading = true;
let url = API_BASE_URL + vm.$route.params.recordid; let url = API_BASE_URL;// + vm.$route.params.recordid;
//clear any errors vm might be around from previous submit //clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(vm); window.$gz.form.deleteAllErrorBoxErrors(vm);

View File

@@ -2,7 +2,7 @@
// let user; // let user;
// before(function fetchUser() { // before(function fetchUser() {
// cy.request("POST", "http://localhost:7575/api/v8/Auth", { // cy.request("POST", "http://localhost:7575/api/v8/auth", {
// username: Cypress.env("adminusername"), // username: Cypress.env("adminusername"),
// password: Cypress.env("adminpassword") // password: Cypress.env("adminpassword")
// }) // })