You are not logged in.
Pages: 1
The background uses version 1.18, the post method, the front-end uses the page developed by vue, and the vue page is opened through the browser. Due to cross-domain, the browser will issue a pre-visit OPTIONS,
The background is set up like this:
if Ctxt.Method = 'OPTIONS' then
begin
try
Ctxt.OutCustomHeaders:='Access-Control-Allow-Origin:*'; //Allow cross-domain access
result := 200;
finally
end;
end
But on the browser side, this prompt keeps appearing: Access to XMLHttpRequest at 'http://localhost:8689/api/exampi/getexampersonbasicInfo/1.0' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
Please, how can I set the background to solve this problem?
Okay, keep going and look forward to the trial,very cool!
mORmot2 is very ambitious, the project catalog is relatively clear and reasonable, like it, I don’t know when it can be used in the production environment, wait for a try
@Administrator You can take a look at this framework. What is the difference from mORmot? The positioning of the two frameworks is different.
A framework in spring contains a comprehensive technology stack for microservices business, which is relatively comprehensive. In China, many large-scale projects basically use it. It is a household name in the Chinese technology circle.
URL: https://spring.io/projects/spring-cloud/
There is a situation that I forgot to mention. In fact, most of our delphi developers basically use one or more of java.net go. They like it and they use it for work.
It turns out that this is also the case in other countries in the world. I thought that only in the Chinese market is not good. In fact, delphi is indeed a good programming language, simple and efficient, but with the passage of time, the lack of ecology is getting worse and worse. When you find the resources that you can’t find, you go to the .net ecosystem and then encapsulate calls to delphi to indirectly solve the problem of insufficient resources. In the delphi field, there is a lack of a full set of solution frameworks like spingcloud. Currently, Internet projects are popular. There are almost no solutions for large-scale projects. It can only be said that it is gradually out of touch with the development of the times. At present, pascal teaching is no longer visible in Chinese schools. It will directly lead to no one using it later. No one uses it. Basically, it is game. Over, I don’t know what the official thinks. It’s too expensive to buy, there are no newcomers to use, resources are charged at every turn, and the concept of open source is deeply rooted in the hearts of the people. In such a closed era, it is really not far from game over. Hope someone can give feedback to the official
I am a delphi developer from China, thank you for providing such a good framework for the delphi field. The Internet in China is developing rapidly, and the mainstream technology stacks are all WEB. Without this framework to provide comprehensive web services, delphi basically I’ve been left behind, and I’ve already switched to other technology stacks. Delphi’s market share in China is almost negligible. Few people use it. They are all using java.net go, etc. I still insist on one of the few, mainly I like to use it, nothing else. Thanks again
Today I was pitted by the latest version of mORomt. The Trim in SysUtils conflicts with the Trim defined in SynCommons. How to solve it
[dcc32 Error] ServerMethod.pas(518): E2251 Ambiguous overloaded call to 'Trim'
System.SysUtils.pas(7475): Related method: function Trim(const string): string;
SynCommons.pas(34038): Related method: function Trim(const string): string;
The problem has been solved, it is indeed a matter of authority, thanks for your help
Thank you very much, and I look at the document again
The above log is the implementation of the post 1 server-side records
C:\Users\Admin\Desktop\EduCloudServer\PrjEduCloudServer.exe 1.0.0.6 (2017-04-25 13:24:41)
Host=ADMIN-PC User=Admin CPU=4*9-6-19971:FFFBEBBFBFFBFA7FAF679C0200 OS=11.1=6.1.7601 Wow64=1 Freq=2343828
Environment variables=#envTSLOGsss3464=46239888 ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Admin\AppData\Roaming asl.log=Destination=file CLASSPATH=.;C:\Program Files\Java\lib;C:\Program Files\Java\lib\tools.jar CommonProgramFiles=C:\Program Files (x86)\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=ADMIN-PC ComSpec=C:\Windows\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: HOMEPATH=\Users\Admin JAVA_HOME=C:\Program Files\Java LOCALAPPDATA=C:\Users\Admin\AppData\Local LOGONSERVER=\\ADMIN-PC NUMBER_OF_PROCESSORS=4 OS=Windows_NT Path=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\SVN\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\Java\bin;C:\Program Files\Java\jre\bin; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=x86 PROCESSOR_ARCHITEW6432=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=4e03 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files (x86) ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=C:\Users\Public SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows TEMP=C:\Users\Admin\AppData\Local\Temp TMP=C:\Users\Admin\AppData\Local\Temp USERDOMAIN=Admin-PC USERNAME=Admin USERPROFILE=C:\Users\Admin VS120COMNTOOLS=D:\VS2013\Common7\Tools\ windir=C:\Windows windows_tracing_flags=3 windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
TSynLog 1.18.3629 FTS3 2017-04-25T07:11:23
20170425 07112355 EXC EHttpApiServer ("HttpSetServiceConfiguration failed: 拒绝访问。 (5)") at 009B0BBA stack trace API 008D0777 008D07A0
20170425 07112355 OSERR mORMotHttpServer.TSQLHttpServer(03B87700) http.sys URI registration error #5 for http://+:8089/root (administrator rights needed, at least once to register the URI) stack trace API 008D27CE 009CE243 009CD46F 00B946A1 00B9448C 0062D258 0054FF0A 0063F3FA 0054F527 004D1EB6 75186238 751868EA 75187D31 75187DFA
20170425 07112355 EXC EHttpServerException {"Message":"TSQLHttpServer: http.sys URI registration error #5 for http://+:8089/root (administrator rights needed, at least once to register the URI)"} at 009CE281 stack trace API 008D0777 008D07A0
20170425 07112355 ERROR mORMotHttpServer.TSQLHttpServer(03B87700) {"EHttpServerException(03BDC428)":{"Message":"TSQLHttpServer: http.sys URI registration error #5 for http://+:8089/root (administrator rights needed, at least once to register the URI)"}} for {"THttpApiServer(03BB5290)":{"Cloned":false,"RegisteredUrl":"","HTTPQueueLength":1000,"MaxBandwidth":-1,"MaxConnections":-1,"APIVersion":"HTTP API 2.0","ServerName":"mORMot (Windows)","ProcessName":"root "}} at root -> fallback to socket-based server stack trace API 008D26DE 009CD54B 00B946A1 00B9448C 0062D258 0054FF0A 0063F3FA 0054F527 004D1EB6 75186238 751868EA 75187D31 75187DFA
Multi-batch data upload error, and then the computer on the normal, some abnormal, do not know why, the following is the wrong message:
Project PrjEduCloudClient.exe raised exception dass ElnterfaceFactoryException with message
TInterfecedObjectFakeClient.FakeCall〇RemoteSQL.MulExecSql) failed:'{
“errorCode”:406,
“errorText”:“sicCfientDriven execution failed (probably due to bad input parameters) for RemoteSQL.MulExecSql"
function MulExecSql(const QSQL: TRawUTF8DynArray;ArryCount: Integer; var Err: RawUTF8): Boolean;
SQLArryCount := 10;
if not fService.MulExecSql(SQLArry,SQLArryCount,ErrStr) then
begin
ShowMsgText('更新服务器数据错误,错误信息:'+UTF8ToString(ErrStr));
end;
First of all to thank you for your suggestions, using the http.sysconfig tool and found that there are a lot of used url, if you remove these URLs, IIS can use these ports, and there is no way out in the APP when removed These URLs, can give advice, very grateful
THttpApiServer monitor which port, which port IIS can not be used, I have tested the three ports, and do not know how to lift the restrictions, not been listening to the port THttpApiServer, are normal
I used examples 09 - HttpApi web server wrote a small application and found that as long as the use of the port, IIS can not be used, do not know why, please help me, thank you
constructor TPubRestServer.Create(const Path: TFileName;ListenPort: string);
begin
FListenPort := ListenPort;
fServer := THttpApiServer.Create(false);
fServer.AddUrl('',FListenPort,false,'+',true);
fServer.RegisterCompress(CompressGZip);
fServer.OnRequest := Process;
fPath := IncludeTrailingPathDelimiter(Path);
FIRSQL := TServiceRemoteSQL.Create;
FPostRequestCount := 0;
FGetRequestCount := 0;
end;
destructor TPubRestServer.Destroy;
begin
fServer.Free;
inherited;
end;
mORmot Framework Client Support FireMonkey Android Client?
How do I fail to compile,
As shown below:
[DCC Fatal Error] SynCommons.pas(773): F2613 Unit 'Contnrs' not found.
Example 14, often times out, the server and the client are on a computer, there will be, I do not know where to set bad,The following error message:
Server not available - {"EWinHTTP":"winhttp.dll error 12002 (timeout)"}
I do not know why the increase, really do not understand
Each time access to data, will increase the server's memory has been increased to go, if you do not query the data, the memory does not increase, please look at the help
function TServiceRemoteSQL.Execute(const aSQL: RawUTF8; aExpectResults, aExpanded: Boolean): RawJSON;
var
res: ISQLDBRows;
fProps: TSQLDBConnectionProperties;
begin
try
fProps := Pub_ConnDataSQL.GetDBConnectionProperties;
if fProps=nil then
begin
raise Exception.Create('Connect call required before Execute');
end;
res := fProps.ExecuteInlined(aSQL,aExpectResults);
if res=nil then
result := ''
else
result := res.FetchAllAsJSON(aExpanded);
finally
fProps := nil;
end;
end;
Client query data once, when the server is stopped, always suggested that such an error, the server database engine is used fProps: TSQLDBConnectionProperties;
assert(OleDBCoinitialized>0,'You should call TOleDBConnection.Free from the same '+
'thread which called its Create: i.e. call MyProps.EndCurrentThread from an '+
'THttpServerGeneric.OnHttpThreadTerminate event - see ticket 213544b2f5');
Allow raw SQL execution in batch mode,I think this feature is very easy to use, fully supports this feature
I write tested, but also can realize the function of things, do them right, as well, can not do what the Chinese version of the data, China's software developers, this framework is indeed too difficult to learn, hard to chew all the information
function TServiceRemoteSQL.MulExecute(const QSQL: TRawUTF8DynArray; aExpectResults: Boolean): Boolean;
var
res,i: Integer;
newCon: TSQLDBConnection;
begin
Result := True;
if fProps=nil then
raise Exception.Create('Connect call required before Execute');
newCon := fProps.MainConnection;
try
newCon.StartTransaction;
for I := Low(QSQL) to High(QSQL) do
begin
fProps.ExecuteInlined(QSQL[i],aExpectResults);
end;
newCon.Commit;
except
newCon.Rollback;
Result := False;
end;
end;
Server-side transaction, the client submits multiple SQL statements, error, how to solve, please help me
Pages: 1