add app_id and auth_token to employee

This commit is contained in:
Zin Moe
2020-01-14 14:58:23 +06:30
parent 48e6afa505
commit c5eb5d6678
7 changed files with 71 additions and 26 deletions

View File

@@ -4,28 +4,28 @@ class ActionController::Base
private
def lookup_domain
if request.subdomains.last && request.subdomains.last != "www" && ENV["SERVER_CODE"] = "cloud"
from = request.host
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
if (!@license.nil?)
logger.info "Location - " + @license.dbschema
ActiveRecord::Base.establish_connection(website_connection(@license))
# authenticate_session_token
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
else
# reconnect_default_db
logger.info 'License is nil'
# redirect_to root_url(:host => request.domain) + "store_error"
render :json => [{ status: false, message: 'Invalid Access!'}]
end
else
# check for license file
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
end
# if request.subdomains.last && request.subdomains.last != "www" && ENV["SERVER_CODE"] = "cloud"
# from = request.host
# @license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
# if (!@license.nil?)
# logger.info "Location - " + @license.dbschema
# ActiveRecord::Base.establish_connection(website_connection(@license))
# # authenticate_session_token
# # logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
# else
# # reconnect_default_db
# logger.info 'License is nil'
# # redirect_to root_url(:host => request.domain) + "store_error"
# render :json => [{ status: false, message: 'Invalid Access!'}]
# end
# else
# # check for license file
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
# end
end

View File

@@ -112,6 +112,7 @@ en:
del: "DEL"
clr: "CLR"
assign: "ASSIGN"
change_auth_token: "Change Auth Token"
print_order_summary: "Print Order Summary"
memeber_card: "Member Card"
@@ -678,6 +679,8 @@ en:
edit_btn_txt: "to edit "
delete_btn_txt: "to delete "
update_btn_txt: "to update "
employee_app_id: "App ID"
employee_auth_token: "Auth Token"
helpers:
page_entries_info:

View File

@@ -432,7 +432,9 @@ scope "(:locale)", locale: /en|mm/ do
resources :display_images
end
#employees
resources :employees
resources :employees
get '/:id/change_auth_token' => 'employees#change_auth_token', as: 'change_auth_token'
#menu
resources :menus do
collection do