Commit 6d2de307 authored by guozhipeng's avatar guozhipeng

正常部署

parent 921247f4
{
"sql": {
"native_hana_associations": false
},
"build": {
"target": "."
},
......
# Generated with Cloud MTA Build Tool version 1.2.33
version=0.0.1
MBT=C:/Users/admin/AppData/Roaming/npm/node_modules/mbt/unpacked_bin/mbt.exe
ifndef p
$(error platform flag is expected. e.g. use make -f makefile.mta p=cf)
endif
target_provided=true
ifndef t
t="$(CURDIR)"
target_provided=false
endif
ifndef strict
strict=true
endif
ifndef mtar
mtar="*"
endif
modules := $(shell $(MBT) provide modules -d=dev)
modules := $(subst ],,$(subst [,,$(modules)))
# List of all the recipes to be executed during the build process
.PHONY: all pre_validate pre_build validate $(modules) post_build meta mtar cleanup
# Default target compile all
all: pre_validate pre_build validate $(modules) post_build meta mtar cleanup
# Validate mta.yaml
pre_validate:
@$(MBT) validate -r=${strict} -x="paths"
pre_build: pre_validate
@$(MBT) project build -p=pre
# Execute module build
define build_rule
$(1): validate
@$(MBT) module build -m=$(1) -p=${p} -t=${t}
endef
$(foreach mod,$(modules),$(eval $(call build_rule,$(mod))))# Create META-INF folder with MANIFEST.MF & mtad.yaml
meta: $(modules) post_build
@$(MBT) gen meta -p=${p} -t=${t}
post_build: $(modules)
@$(MBT) project build -p=post -t=${t}
# Validate mta.yaml
validate: pre_build
@$(MBT) validate -r=${strict}
# Pack as MTAR artifact
mtar: $(modules) meta
@$(MBT) gen mtar --mtar=${mtar} --target_provided=${target_provided} -t=${t}
cleanup: mtar
# Remove tmp folder
@$(MBT) clean -t=${t}
\ No newline at end of file
......@@ -123,6 +123,39 @@ sap.ui.define([
// return !!(sap.ui.Device.os.android || sap.ui.Device.os.ios || sap.ui.Device.os.windows.phone || sap.ui.Device.os.blackberry);
return !!(sap.ui.Device.os.android || sap.ui.Device.os.ios || sap.ui.Device.os.blackberry);
},
/**
* 获取token
* @param completeCallback
*/
getCsrfToken(completeCallback) {
let that = this
jQuery.ajax({
method: "GET",
url: this.baseUrl + "odata/v4/orderService/OrderHeader",
headers: {
'x-csrf-token': 'fetch'
},
contentType: 'application/json',
dataType: 'json',
crossDomain: true,
async: true,
success: function (response) {
//console.log('success', response)
},
error: function (jqXHR, textStatus, errorThrown) {
//console.log('error', jqXHR, textStatus, errorThrown)
},
complete:function(xhr,status){
// 在 complete 回调中获取响应头中的 x-csrf-token
var csrfToken = xhr.getResponseHeader('x-csrf-token');
that.getStorage().put("csrfToken", csrfToken);
//console.log('获取到的 CSRF Token: ', csrfToken);
if (completeCallback && typeof completeCallback === 'function') {
completeCallback(csrfToken);
}
}
})
},
// 登录
onLogin: function(oEvent) {
// this.getRouter().navTo("menu", {}, true);
......@@ -138,11 +171,20 @@ sap.ui.define([
return;
}
console.log("onLoginUrl=", that.baseUrl+"login/login");
that.getCsrfToken(csrfToken => {
console.log('【获取到的 CSRF Token】 ', csrfToken);
var csrfTokenStorage = that.getStorage().get("csrfToken")
console.log('【获取到的 CSRF Token】 ', csrfToken);
console.log('【获取到的 CSRF csrfTokenStorage】 ', csrfTokenStorage);
let busyDialog = new sap.m.BusyDialog();
busyDialog.open();
jQuery.ajax({
method: "POST",
headers: {
'x-csrf-token': that.getStorage().get("csrfToken"),
'Content-Type': 'application/json'
},
data: JSON.stringify(param),
url: that.baseUrl+"login/login",
contentType: 'application/json',
......@@ -198,6 +240,7 @@ sap.ui.define([
}
}
});
})
},
onSelectDialogPress: function (oEvent) {
var oView = this.getView();
......
......@@ -364,6 +364,7 @@ sap.ui.define(
contentType: 'application/json',
dataType: 'json',
headers: {
'x-csrf-token': that.getStorage().get("csrfToken"),
language:that.language
},
success: function (res) {
......
......@@ -388,6 +388,7 @@ sap.ui.define(
contentType: 'application/json',
dataType: 'json',
headers: {
'x-csrf-token': that.getStorage().get("csrfToken"),
language:that.language
},
success: function (data) {
......
......@@ -631,6 +631,7 @@ sap.ui.define(
contentType: 'application/json',
dataType: 'json',
headers: {
'x-csrf-token': that.getStorage().get("csrfToken"),
language:that.language
},
success: function (data) {
......
......@@ -331,6 +331,7 @@ sap.ui.define(
contentType: 'application/json',
dataType: 'json',
headers: {
'x-csrf-token': that.getStorage().get("csrfToken"),
language:that.language
},
success: function (res) {
......
{
"welcomeFile": "/main/webapp/index.html",
"routes": [
{
"source": "^/index.html(#.*)?$",
"target": "/main/webapp/index.html$1",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/odata/(.*)",
"target": "/odata/$1",
"destination": "srv-api"
},
{
"source": "^/logs/(.*)",
"target": "/logs/$1",
"destination": "srv-api"
},
{
"source": "^([^.]*)$",
"target": "$1",
"destination": "srv-api"
},
{
"source": "^/main/(.*)",
"target": "/$1",
......
{
"name": "deploy",
"dependencies": {
"hdb": "^0",
"@sap/hdi-deploy": "^4"
},
"engines": {
......
......@@ -19,7 +19,7 @@ modules:
readiness-health-check-type: http
readiness-health-check-http-endpoint: /actuator/health/readiness
routes:
- route: lianchuangjie-tes-srv.unibetter-ic.com
- route: lianchuangjie-test-srv.unibetter-ic.com
properties:
SPRING_PROFILES_ACTIVE: cloud,sandbox
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
......@@ -56,6 +56,9 @@ modules:
type: html5
path: app/main
build-parameters:
builder: custom
commands:
- npm run build
supported-platforms:
[]
build-result: .
......
......@@ -323,6 +323,11 @@
<groupId>com.sap.cds</groupId>
<artifactId>cds-starter-cloudfoundry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -25,6 +25,7 @@ public class HttpFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
log.info("[HttpFilter]doFilter");
HttpServletRequest request = (HttpServletRequest) servletRequest;
ThreadLocalManagerUtil.HeaderInfo headerInfo = new ThreadLocalManagerUtil.HeaderInfo();
headerInfo.setLanguage(request.getHeader(SystemConstants.LANGUAGE));
......
......@@ -5,6 +5,7 @@ import customer.lianchuangjie.common.util.StringUtil;
import customer.lianchuangjie.common.util.ThreadLocalManagerUtil;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
......@@ -13,11 +14,12 @@ import org.springframework.web.servlet.ModelAndView;
* @Description 需要注册到 webmvc中
* @CreateTime 2022/12/8 17:59
**/
@Slf4j
public class HttpInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response, java.lang.Object handler) throws java.lang.Exception {
log.info("[HttpInterceptor]preHandle");
//成功登录后,获取请求头中appKey,通过其从内存中获取userLoginId 存入ThreadLocal中
if(!"/login/login".equals(request.getRequestURI()) && StringUtil.isNotEmpty(request.getHeader("appKey"))
&& CommonConstant.userAuthenticationMap.containsKey(request.getHeader("appKey"))) {
......
......@@ -56,6 +56,7 @@ public class OperateAuthFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
log.info("[OperateAuthFilter]doFilter");
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String appKey = request.getHeader("appKey"); //用户appKey
......
......@@ -20,7 +20,7 @@
],
"role-collections": [
{
"name": "lianchuangjie_Administrators",
"name": "Lianchuangjie_Administrators",
"description": "Lianchuangjie Administrators",
"role-template-references": [
"$XSAPPNAME.Administrators"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment