build for master branch: localhost changed to domain

This commit is contained in:
saparatayev 2022-01-26 16:29:37 +05:00
parent d9d9ce84ea
commit dd1f187118
9 changed files with 578 additions and 24 deletions

View File

@ -59,7 +59,7 @@ class RequestController extends Controller
], 400);
}
$loginResponse = Http::post('http://127.0.0.1:8000/api/login', [
$loginResponse = Http::post('https://tmex.gov.tm/api/login', [
'username' => $input['phone'],
'password' => $input['password'],
'dial_code' => '+' . $input['dial_code']
@ -91,7 +91,7 @@ class RequestController extends Controller
}
// try to withdraw fee from the balance for creating a request
$balanceResponse = Http::post('http://127.0.0.1:8000/api/v1/withdraw-from-balance?token=' . $loginResponse['token'], [
$balanceResponse = Http::post('https://tmex.gov.tm/api/v1/withdraw-from-balance?token=' . $loginResponse['token'], [
// 'token' => $loginResponse['token'],
'total_price' => $input['totalPrice'], // USD or TMT
'currency' => $input['currency'],

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -892,6 +892,56 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// import GoogleReCaptchaV3 from "./GoogleReCaptchaV3";
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
props: {
@ -907,11 +957,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// },
data: function data() {
return {
warningMessages: {
notRegistered: true,
lowBalance: false
},
visible: true,
type: "local",
form: this.$inertia.form({
phone: undefined,
password: undefined,
first_name: undefined,
last_name: undefined,
email: undefined,
org_type: undefined,
// captcha: undefined,
items: [{
id: undefined,
@ -961,9 +1019,22 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
console.log(name, iso2, dialCode);
this.countryCode = dialCode;
},
deleteDangerClass: function deleteDangerClass() {
var warningParagraphs = document.querySelectorAll('.warning-text');
warningParagraphs.forEach(function (elem) {
return elem.classList.remove('danger-color');
});
},
addDangerClass: function addDangerClass() {
var warningParagraphs = document.querySelectorAll('.warning-text');
warningParagraphs.forEach(function (elem) {
return elem.classList.add('danger-color');
});
},
submit: function submit() {
var _this = this;
this.deleteDangerClass();
this.loader = true;
this.form.totalPrice = this.totalPrice;
this.form.currency = this.currency;
@ -980,12 +1051,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
return res.json();
}).then(function (res) {
alert('we are in success section');
_this.validationErrorsObj = {};
switch (res.status) {
case 400:
// validation failed
_this.validationErrorsObj = {}; // this.errorsArr = []
var errorValidation = res.validationErrors;
for (var key in errorValidation) {
@ -1001,7 +1071,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
case 401:
// not registered yet or invalid credentials
_this.$message.error('Unauthorized');
_this.$message.error('Unauthorized'); // Show a warning text in red! Add a class.
_this.warningMessages.notRegistered = true;
_this.warningMessages.lowBalance = false;
_this.addDangerClass();
break;
@ -1020,7 +1096,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
case 300:
// not enough money on a balance
_this.$message.error(res.message);
_this.$message.error(res.message); // Show a warning text in red! Add a class & show low balance paragraph
_this.warningMessages.lowBalance = true;
_this.warningMessages.notRegistered = false;
_this.addDangerClass();
break;
@ -1033,6 +1115,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
_this.loader = false;
})["catch"](function (err) {
alert('we are in errors section');
_this.validationErrorsObj = {};
console.log(err);
_this.$message.error('Internal Server Error');
@ -1617,7 +1700,7 @@ __webpack_require__.r(__webpack_exports__);
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.id, "\n.validation-error {\n color: rgb(255, 0, 0);\n}\n.vue-country-select {\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown {\n padding: 0 0.3em 0 0!important;\n}\n.vue-country-select .dropdown-list {\n z-index: 2 !important;\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown-item.last-preferred {\n border-bottom: 1px solid #004691 !important;\n}\n", ""]);
___CSS_LOADER_EXPORT___.push([module.id, "\n.validation-error {\n color: rgb(255, 0, 0);\n}\n.vue-country-select {\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown {\n padding: 0 0.3em 0 0!important;\n}\n.vue-country-select .dropdown-list {\n z-index: 2 !important;\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown-item.last-preferred {\n border-bottom: 1px solid #004691 !important;\n}\n.ant-form-item label {\n white-space: pre-wrap;\n}\n.warning-text.danger-color * {\n color: rgb(255, 0, 0);\n}\n", ""]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
@ -2013,7 +2096,8 @@ var render = function() {
"a-modal",
{
attrs: {
title: _vm.trans("Create request"),
title:
_vm.trans("Create request") + " (Enter your account credentials)",
"after-close": function() {
return _vm.$emit("close")
},
@ -2152,9 +2236,202 @@ var render = function() {
1
),
_vm._v(" "),
_c("div", { staticClass: "w-2/12" })
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.warningMessages.notRegistered,
expression: "warningMessages.notRegistered"
}
],
staticClass: "w-4/12 warning-text not-registered"
},
[
_c("p", [
_vm._v(
"You have to be resgistered and have enough money on your balance to make a request."
)
]),
_vm._v(" "),
_c("p", [
_vm._v("Not Registered? "),
_c(
"a",
{
staticClass: "font-bold text-primary",
attrs: { href: "http://birzha#register" }
},
[_vm._v("Click here")]
)
])
]
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.warningMessages.lowBalance,
expression: "warningMessages.lowBalance"
}
],
staticClass: "w-4/12 warning-text low-balance"
},
[
_c("p", [_vm._v("Low balance. Please fill up your balance.")]),
_vm._v(" "),
_c("p", [
_vm._v("Not Registered? "),
_c(
"a",
{
staticClass: "font-bold text-primary",
attrs: { href: "http://birzha/tm/balance" }
},
[_vm._v("Click here")]
)
])
]
)
]),
_vm._v(" "),
_c(
"div",
{ staticClass: "flex space-x-3 border-t pt-4 border-gray-300" },
[
_c(
"div",
{ staticClass: "w-8/12" },
[
_c(
"a-form-item",
{ attrs: { label: "First name" } },
[
_c("a-input", {
attrs: { placeholder: "First name" },
model: {
value: _vm.form.first_name,
callback: function($$v) {
_vm.$set(_vm.form, "first_name", $$v)
},
expression: "form.first_name"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.first_name
? _vm._l(_vm.validationErrorsObj.first_name, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: "Last name" } },
[
_c("a-input", {
attrs: { placeholder: "Last name" },
model: {
value: _vm.form.last_name,
callback: function($$v) {
_vm.$set(_vm.form, "last_name", $$v)
},
expression: "form.last_name"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.last_name
? _vm._l(_vm.validationErrorsObj.last_name, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: _vm.trans("Email") } },
[
_c("a-input", {
attrs: { placeholder: _vm.trans("Email") },
model: {
value: _vm.form.email,
callback: function($$v) {
_vm.$set(_vm.form, "email", $$v)
},
expression: "form.email"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.email
? _vm._l(_vm.validationErrorsObj.email, function(item) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: "Organization type" } },
[
_c("a-input", {
attrs: { placeholder: "Organization type" },
model: {
value: _vm.form.org_type,
callback: function($$v) {
_vm.$set(_vm.form, "org_type", $$v)
},
expression: "form.org_type"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.org_type
? _vm._l(_vm.validationErrorsObj.org_type, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
)
],
1
)
]
),
_vm._v(" "),
_vm._l(_vm.form.items, function(item, index) {
return _c(
"div",

View File

@ -892,6 +892,56 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// import GoogleReCaptchaV3 from "./GoogleReCaptchaV3";
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
props: {
@ -907,11 +957,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// },
data: function data() {
return {
warningMessages: {
notRegistered: true,
lowBalance: false
},
visible: true,
type: "local",
form: this.$inertia.form({
phone: undefined,
password: undefined,
first_name: undefined,
last_name: undefined,
email: undefined,
org_type: undefined,
// captcha: undefined,
items: [{
id: undefined,
@ -961,9 +1019,22 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
console.log(name, iso2, dialCode);
this.countryCode = dialCode;
},
deleteDangerClass: function deleteDangerClass() {
var warningParagraphs = document.querySelectorAll('.warning-text');
warningParagraphs.forEach(function (elem) {
return elem.classList.remove('danger-color');
});
},
addDangerClass: function addDangerClass() {
var warningParagraphs = document.querySelectorAll('.warning-text');
warningParagraphs.forEach(function (elem) {
return elem.classList.add('danger-color');
});
},
submit: function submit() {
var _this = this;
this.deleteDangerClass();
this.loader = true;
this.form.totalPrice = this.totalPrice;
this.form.currency = this.currency;
@ -980,12 +1051,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
return res.json();
}).then(function (res) {
alert('we are in success section');
_this.validationErrorsObj = {};
switch (res.status) {
case 400:
// validation failed
_this.validationErrorsObj = {}; // this.errorsArr = []
var errorValidation = res.validationErrors;
for (var key in errorValidation) {
@ -1001,7 +1071,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
case 401:
// not registered yet or invalid credentials
_this.$message.error('Unauthorized');
_this.$message.error('Unauthorized'); // Show a warning text in red! Add a class.
_this.warningMessages.notRegistered = true;
_this.warningMessages.lowBalance = false;
_this.addDangerClass();
break;
@ -1020,7 +1096,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
case 300:
// not enough money on a balance
_this.$message.error(res.message);
_this.$message.error(res.message); // Show a warning text in red! Add a class & show low balance paragraph
_this.warningMessages.lowBalance = true;
_this.warningMessages.notRegistered = false;
_this.addDangerClass();
break;
@ -1033,6 +1115,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
_this.loader = false;
})["catch"](function (err) {
alert('we are in errors section');
_this.validationErrorsObj = {};
console.log(err);
_this.$message.error('Internal Server Error');
@ -1502,7 +1585,7 @@ __webpack_require__.r(__webpack_exports__);
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.id, "\n.validation-error {\n color: rgb(255, 0, 0);\n}\n.vue-country-select {\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown {\n padding: 0 0.3em 0 0!important;\n}\n.vue-country-select .dropdown-list {\n z-index: 2 !important;\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown-item.last-preferred {\n border-bottom: 1px solid #004691 !important;\n}\n", ""]);
___CSS_LOADER_EXPORT___.push([module.id, "\n.validation-error {\n color: rgb(255, 0, 0);\n}\n.vue-country-select {\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown {\n padding: 0 0.3em 0 0!important;\n}\n.vue-country-select .dropdown-list {\n z-index: 2 !important;\n border-color: #004691 !important;\n}\n.vue-country-select .dropdown-item.last-preferred {\n border-bottom: 1px solid #004691 !important;\n}\n.ant-form-item label {\n white-space: pre-wrap;\n}\n.warning-text.danger-color * {\n color: rgb(255, 0, 0);\n}\n", ""]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
@ -1898,7 +1981,8 @@ var render = function() {
"a-modal",
{
attrs: {
title: _vm.trans("Create request"),
title:
_vm.trans("Create request") + " (Enter your account credentials)",
"after-close": function() {
return _vm.$emit("close")
},
@ -2037,9 +2121,202 @@ var render = function() {
1
),
_vm._v(" "),
_c("div", { staticClass: "w-2/12" })
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.warningMessages.notRegistered,
expression: "warningMessages.notRegistered"
}
],
staticClass: "w-4/12 warning-text not-registered"
},
[
_c("p", [
_vm._v(
"You have to be resgistered and have enough money on your balance to make a request."
)
]),
_vm._v(" "),
_c("p", [
_vm._v("Not Registered? "),
_c(
"a",
{
staticClass: "font-bold text-primary",
attrs: { href: "http://birzha#register" }
},
[_vm._v("Click here")]
)
])
]
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.warningMessages.lowBalance,
expression: "warningMessages.lowBalance"
}
],
staticClass: "w-4/12 warning-text low-balance"
},
[
_c("p", [_vm._v("Low balance. Please fill up your balance.")]),
_vm._v(" "),
_c("p", [
_vm._v("Not Registered? "),
_c(
"a",
{
staticClass: "font-bold text-primary",
attrs: { href: "http://birzha/tm/balance" }
},
[_vm._v("Click here")]
)
])
]
)
]),
_vm._v(" "),
_c(
"div",
{ staticClass: "flex space-x-3 border-t pt-4 border-gray-300" },
[
_c(
"div",
{ staticClass: "w-8/12" },
[
_c(
"a-form-item",
{ attrs: { label: "First name" } },
[
_c("a-input", {
attrs: { placeholder: "First name" },
model: {
value: _vm.form.first_name,
callback: function($$v) {
_vm.$set(_vm.form, "first_name", $$v)
},
expression: "form.first_name"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.first_name
? _vm._l(_vm.validationErrorsObj.first_name, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: "Last name" } },
[
_c("a-input", {
attrs: { placeholder: "Last name" },
model: {
value: _vm.form.last_name,
callback: function($$v) {
_vm.$set(_vm.form, "last_name", $$v)
},
expression: "form.last_name"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.last_name
? _vm._l(_vm.validationErrorsObj.last_name, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: _vm.trans("Email") } },
[
_c("a-input", {
attrs: { placeholder: _vm.trans("Email") },
model: {
value: _vm.form.email,
callback: function($$v) {
_vm.$set(_vm.form, "email", $$v)
},
expression: "form.email"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.email
? _vm._l(_vm.validationErrorsObj.email, function(item) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
),
_vm._v(" "),
_c(
"a-form-item",
{ attrs: { label: "Organization type" } },
[
_c("a-input", {
attrs: { placeholder: "Organization type" },
model: {
value: _vm.form.org_type,
callback: function($$v) {
_vm.$set(_vm.form, "org_type", $$v)
},
expression: "form.org_type"
}
}),
_vm._v(" "),
_vm.validationErrorsObj.org_type
? _vm._l(_vm.validationErrorsObj.org_type, function(
item
) {
return _c(
"span",
{ key: item, staticClass: "validation-error" },
[_vm._v(_vm._s(item))]
)
})
: _vm._e()
],
2
)
],
1
)
]
),
_vm._v(" "),
_vm._l(_vm.form.items, function(item, index) {
return _c(
"div",

View File

@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=0ce11a59915c749db8a7",
"/css/app.css": "/css/app.css?id=caf652cb6ab408823924",
"/js/app.js": "/js/app.js?id=9b3e2b4a91df67c5c81a",
"/css/app.css": "/css/app.css?id=325e37fae0fdf8bf428a",
"/css/antd.css": "/css/antd.css?id=f9f05916bb7adbb86b7d"
}

View File

@ -49,11 +49,11 @@
<!-- Warning text -->
<div class="w-4/12 warning-text not-registered" v-show="warningMessages.notRegistered">
<p>You have to be resgistered and have enough money on your balance to make a request.</p>
<p>Not Registered? <a href="http://birzha#register" class="font-bold text-primary">Click here</a></p>
<p>Not Registered? <a href="https://tmex.gov.tm#register" class="font-bold text-primary">Click here</a></p>
</div>
<div class="w-4/12 warning-text low-balance" v-show="warningMessages.lowBalance">
<p>Low balance. Please fill up your balance.</p>
<p>Not Registered? <a href="http://birzha/tm/balance" class="font-bold text-primary">Click here</a></p>
<p>Not Registered? <a href="https://tmex.gov.tm/tm/balance" class="font-bold text-primary">Click here</a></p>
</div>
<!-- Warning text end -->
</div>