这是我的代码
async getAll(): Promise<GetAllUserData[]> {
return await dbQuery(); // dbQuery returns User[]
}
class User {
id: number;
name: string;
}
class GetAllUserData{
id: number;
}
Run Code Online (Sandbox Code Playgroud)
getAll函数返回User[],并且数组的每个元素都有name属性,即使它的返回类型是GetAllUserData[]。
我想知道是否可以out of the box在打字稿中将对象限制为仅由其类型指定的属性。
我需要在 上打开登陆页面,在 上打开/vueJS 应用程序/app。这是我当前的 nginx 设置:
server {
listen 80;
location /app {
alias /var/www/app/dist/;
try_files $uri $uri/ /index.html;
}
location / {
alias /var/www/landing/dist/;
try_files $uri $uri/ /index.html;
}
}
Run Code Online (Sandbox Code Playgroud)
/当我转到 时,它会打开登陆和 vueJS 应用程序/app,但是,如果我打开/app/login它会转到登陆页面而不是 vue 应用程序。我究竟做错了什么 ?