提交 f9398312 编写于 作者: 麦壳饼's avatar 麦壳饼

修正根据配置读取url问题

上级 f1abab6e
@namespace IoTSharp.ClientApp.Pages.Dashboard.Analysis
@page "/"
@page "/dashboard/analysis"
<GridContent>
<Row Type="flex" Gutter="24">
......
@namespace IoTSharp.ClientApp.Pages.Dashboard.Workplace
@using System.Text.RegularExpressions
@page "/dashboard/workplace"
@page "/"
@*dashboard/workplace*@
<PageContainer Title="Workplace">
<Breadcrumb>
<Breadcrumb>
......
......@@ -7,16 +7,6 @@
"children": [
{
"path": "/",
"name": "分析页",
"key": "dashboard.analysis"
},
{
"path": "/dashboard/monitor",
"name": "监控页",
"key": "dashboard.monitor"
},
{
"path": "/dashboard/workplace",
"name": "工作台",
"key": "dashboard.workplace"
}
......@@ -33,6 +23,16 @@
"name": "基础表单",
"key": "form.basic-form"
},
{
"path": "/dashboard/analysis",
"name": "分析页",
"key": "dashboard.analysis"
},
{
"path": "/dashboard/monitor",
"name": "监控页",
"key": "dashboard.monitor"
},
{
"path": "/form/step-form",
"name": "分布表单",
......
......@@ -36,6 +36,7 @@ namespace IoTSharp.Sdk.Http
public T Create<T>() where T : class
{
HttpClient.BaseAddress = new Uri ( BaseURL);
T t = Activator.CreateInstance(typeof(T), HttpClient) as T;
typeof(T).GetProperty("BaseUrl").SetValue(t, BaseURL);
return t;
......@@ -46,7 +47,7 @@ namespace IoTSharp.Sdk.Http
{
try
{
_act_client = new AccountClient(HttpClient);
_act_client = Create<AccountClient>();
_result = await _act_client.RegisterAsync( new RegisterDto() { Customer= customer, Email= username, Password=password, PhoneNumber= phoneNumber });
HttpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {Token.Access_token}");
ApiResultOfUserInfoDto userInfoDto = await _act_client.MyInfoAsync();
......@@ -62,7 +63,7 @@ namespace IoTSharp.Sdk.Http
{
try
{
_act_client = new AccountClient(HttpClient);
_act_client = Create<AccountClient>();
_result = await _act_client.LoginAsync(new LoginDto() { UserName = username, Password = password });
HttpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {Token.Access_token}");
ApiResultOfUserInfoDto userInfoDto = await _act_client.MyInfoAsync();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册