wanggang 1 year ago
parent
commit
bc5a451a66
  1. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js
  3. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  4. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/config/settings.js
  5. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs

@ -29,6 +29,16 @@ public class Startup
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" }); options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" });
}); });
services.AddScheduler(); services.AddScheduler();
services.AddCors(options =>
{
options.AddPolicy("Default", builder =>
{
builder.SetIsOriginAllowed(isOriginAllowed => true)
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials();
});
});
services.AddSingleton<JisBBACSeEdiCompareAppService>(); services.AddSingleton<JisBBACSeEdiCompareAppService>();
services.AddSingleton<JisHBPOSeEdiCompareAppService>(); services.AddSingleton<JisHBPOSeEdiCompareAppService>();
services.AddSignalR(o => o.EnableDetailedErrors = true); services.AddSignalR(o => o.EnableDetailedErrors = true);
@ -53,6 +63,7 @@ public class Startup
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.UseCors("Default");
app.UseResponseCompression(); app.UseResponseCompression();
app.UseRouting(); app.UseRouting();
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub")); app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js

@ -147,7 +147,7 @@ async function getLocalizationAsync() {
userAgent: "用户代理", userAgent: "用户代理",
["Invalid username or password!"]: "用户名或密码错误", ["Invalid username or password!"]: "用户名或密码错误",
["The user account has been locked out due to invalid login attempts. Please wait a while and try again."]: "用户已锁定,请稍后重试", ["The user account has been locked out due to invalid login attempts. Please wait a while and try again."]: "用户已锁定,请稍后重试",
["Volo.Abp.Identity:PasswordMismatch"]: "密码错误", ["Incorrect password."]: "密码错误",
}, },
en: { en: {
application: "WTA Framework", application: "WTA Framework",

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js

@ -26,12 +26,12 @@ export default {
</template> </template>
<template v-else-if="getInput(schema)==='tabs'"> <template v-else-if="getInput(schema)==='tabs'">
<el-tabs type="card" v-model="model[prop]" style="height:32px;margin:0;" class="form"> <el-tabs type="card" v-model="model[prop]" style="height:32px;margin:0;" class="form">
<el-tab-pane label="全部" key="all" :name="" /> <el-tab-pane label="全部" key="all" :name="''" />
<el-tab-pane v-for="item in options" :label="item.label" :name="item.value" /> <el-tab-pane v-for="item in options" :label="item.label" :name="item.value" />
</el-tabs> </el-tabs>
</template> </template>
<template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'"> <template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'">
<el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format??'YYYY-MM-DD HH:mm:ss'" /> <el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format??'YYYY-MM-DD HH:mm:ss'" size="small" />
</template> </template>
<template v-else-if="getInput(schema)==='number'"> <template v-else-if="getInput(schema)==='number'">
<el-input :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" type="number" /> <el-input :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" type="number" />

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/config/settings.js

@ -1,5 +1,5 @@
export default { export default {
enableLocale: false, enableLocale: false,
//baseURL: "http://dev.ccwin-in.com:10582/api", // baseURL: "http://dev.ccwin-in.com:16082/api",
baseURL: "/api", baseURL: new URLSearchParams(location.search).get("api") ?? "/api",
}; };

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -54,9 +54,6 @@ async function getResult(response) {
result.errors = error; result.errors = error;
console.log(error); console.log(error);
} }
const message = i18n.global.t(result.errors?.error?.code ?? "错误");
ElMessageBox({ title: "提示", message, type: "warning" });
} }
return result; return result;
} }
@ -93,7 +90,10 @@ async function request(url, data, options, notify = false) {
if (result.data?.code && result.data.code !== 200) { if (result.data?.code && result.data.code !== 200) {
result.errors = result.data.message ?? result.data.code; result.errors = result.data.message ?? result.data.code;
} }
if (!result.errors && notify && (!result.data?.code || result.data.code === 200)) { if (result.errors) {
const message = i18n.global.t(result.errors?.error?.message ?? result.errors?.error?.code ?? result.errors ?? "错误");
ElMessageBox({ title: "提示", message, type: "warning" });
} else if (notify && (!result.data?.code || result.data.code === 200)) {
ElMessage({ ElMessage({
type: "success", type: "success",
message: "操作成功", message: "操作成功",

Loading…
Cancel
Save