【发布时间】:2021-08-07 07:08:33
【问题描述】:
我使用 .net 应用程序来设计我的网站。我导入以下文件:
//html file like:
<script src="~/js/login/login.js" type="module"></script>
//code login.js below:
import reponsitoryfactory from "../../service/factory/reponsitoryfactory.js";
const authreponsitory = reponsitoryfactory.get("auth");
export function login() {
alert('fasfs');
var data = {
"username": $('#txt-username').val(),
"password": $('#txt-password').val()
};
authreponsitory.login(data).then(function (response) {
if (response.data.success) {
alert("success");
}
});
};
在 HTML 文件中,我将登录函数称为:
<span class="k t btn bnt-login" onclick="login1()">Login</span>
我尝试了一些方法来解决登录功能不存在的问题,谁能帮我在javascript文件模块中调用一个函数!
【问题讨论】:
标签: javascript c# .net asp.net-core module