|
@@ -8,6 +8,8 @@
|
|
|
<title>VSees Login</title>
|
|
|
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-..." crossorigin="anonymous" />
|
|
|
+ <!-- 引入 axios 的 JS 文件 -->
|
|
|
+ <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
</head>
|
|
|
<style type="text/css">
|
|
|
html,body{
|
|
@@ -320,33 +322,38 @@
|
|
|
var user = document.getElementById("user_text");
|
|
|
var pwd = document.getElementById("password_text");
|
|
|
if (user.value.length > 0) {
|
|
|
- showLoadingIcon();
|
|
|
- //console.log("user: " + user.value);
|
|
|
- //console.log("pwd: " + pwd.value);
|
|
|
-
|
|
|
- var params = ("user=" + user.value + "&pwd=" + pwd.value + "&state={{ state }}" + "&client_id={{ client_id }}"
|
|
|
- + "&response_type={{ response_type }}" + "&scope={{ scope }}" + "&redirect_uri={{ redirect_uri }}"
|
|
|
- + "&skill_name={{ skill_name }}");
|
|
|
- $.get("/oa2/login", params)
|
|
|
- .done(function (reUrl) {
|
|
|
- let data = JSON.parse(reUrl);
|
|
|
- if (data['code'] === 0) {
|
|
|
- console.log('request start');
|
|
|
- window.location = data['res'];
|
|
|
- } else {
|
|
|
- alert(data['msg']);
|
|
|
- }
|
|
|
- hideLoadingIcon();
|
|
|
- })
|
|
|
- .fail(function (xhr, textStatus, error) {
|
|
|
- // 请求失败的处理
|
|
|
- hideLoadingIcon();
|
|
|
- alert(textStatus);
|
|
|
- });
|
|
|
+ const params = {
|
|
|
+ user: user.value,
|
|
|
+ pwd: pwd.value,
|
|
|
+ state: '{{ state }}',
|
|
|
+ client_id: '{{ client_id }}',
|
|
|
+ response_type: '{{ response_type }}',
|
|
|
+ scope: '{{ scope }}',
|
|
|
+ redirect_uri: '{{ redirect_uri }}',
|
|
|
+ skill_name: '{{ skill_name }}'
|
|
|
+ };
|
|
|
+ showLoadingIcon();
|
|
|
+ axios.get('/oa2/login', { params: params })
|
|
|
+ .then(response => {
|
|
|
+ // 请求成功处理
|
|
|
+ hideLoadingIcon();
|
|
|
+ const data = response.data;
|
|
|
+ if (data['code'] === 0) {
|
|
|
+ console.log('request start');
|
|
|
+ window.location = data['res'];
|
|
|
+ } else {
|
|
|
+ alert(data['msg']);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ // 请求失败处理
|
|
|
+ hideLoadingIcon();
|
|
|
+ alert(error);
|
|
|
+ });
|
|
|
} else {
|
|
|
alert("please input user and password");
|
|
|
}
|
|
|
- }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
|