add ganti password pic / pat
This commit is contained in:
@@ -3,6 +3,7 @@ package corporate_services
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
"cpone/package/config"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -19,10 +20,10 @@ func NewAccountService(aStore db.AppStore) *AccountService {
|
||||
}
|
||||
}
|
||||
|
||||
func (as *AccountService) ChangePasswordPIC(token string, currPassword string, newPassword string) (models.ResponseStatus, error) {
|
||||
func (as *AccountService) ChangePasswordPIC(host string, token string, currPassword string, newPassword string) (models.ResponseStatus, error) {
|
||||
var ret models.ResponseStatus
|
||||
|
||||
uri := "/one-api/mockup/system/menu/change_password_pic"
|
||||
uri := "https://" + config.Data.Get("servername") + "/one-api/mockup/system/menu/change_password_pic"
|
||||
|
||||
params := url.Values{}
|
||||
params.Add("new", newPassword)
|
||||
@@ -63,7 +64,7 @@ func (as *AccountService) ChangePasswordPIC(token string, currPassword string, n
|
||||
func (as *AccountService) ChangePasswordPAT(token string, currPassword string, newPassword string) (models.ResponseStatus, error) {
|
||||
var ret models.ResponseStatus
|
||||
|
||||
uri := "/one-api/mockup/system/menu/change_password_pat"
|
||||
uri := "https://" + config.Data.Get("servername") + "/one-api/mockup/system/menu/change_password_pat"
|
||||
|
||||
params := url.Values{}
|
||||
params.Add("new", newPassword)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
"cpone/package/config"
|
||||
dbx "cpone/package/database"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -82,19 +83,9 @@ func (tdps *TabDaftarPesertaServices) GetListDaftarPesertaMCU(id string, current
|
||||
}
|
||||
|
||||
func (tdps *TabDaftarPesertaServices) GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error) {
|
||||
|
||||
// Generate email dan password utk seluruh peserta mgm mcu
|
||||
// https://devcpone.aplikasi.web.id/one-api/tools/auth_patient/generate/<XID>
|
||||
// <XID> : mgmMcuID
|
||||
|
||||
// if host == "localhost:5000" {
|
||||
// host = "https://devcpone.aplikasi.web.id"
|
||||
// }
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.GeneratePasswordResponse
|
||||
// uri := "https://cpone.aplikasi.web.id/one-api/tools/auth_patient/generate/" + mgmMCUID
|
||||
uri := "https://devcpone.aplikasi.web.id/one-api/tools/auth_patient/generate/" + mgmMCUID
|
||||
uri := "https://" + config.Data.Get("servername") + "/one-api/tools/auth_patient/generate/" + mgmMCUID
|
||||
|
||||
payload := []byte{}
|
||||
resp, err := http.Post(uri, "application/json", bytes.NewBuffer(payload))
|
||||
|
||||
@@ -3,6 +3,7 @@ package public_services
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
"cpone/package/config"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -26,12 +27,7 @@ func (ls *ServicesLogin) MultiSignIn(username string, password string, host stri
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.Response
|
||||
|
||||
// if host == "localhost:5000" {
|
||||
// host = "https://cpone.aplikasi.web.id"
|
||||
// }
|
||||
|
||||
// uri := "https://cpone.aplikasi.web.id/one-api/v1/system/auth/multi_login"
|
||||
uri := "https://devcpone.aplikasi.web.id/one-api/v1/system/auth/multi_login"
|
||||
uri := "https://" + config.Data.Get("servername") + "/one-api/v1/system/auth/multi_login"
|
||||
|
||||
params := url.Values{}
|
||||
params.Add("username", username)
|
||||
|
||||
Reference in New Issue
Block a user