添加登录
This commit is contained in:
+12
-8
@@ -100,12 +100,12 @@
|
||||
<div class="center">
|
||||
<div class="item">
|
||||
<span class="icon icon-2"></span>
|
||||
<input type="text" name="username" value="api_data" lay-verify="required" data-i18n-placeholder="login.username" placeholder="请输入登录账号"/>
|
||||
<input type="text" name="username" value="" lay-verify="required" data-i18n-placeholder="login.username" placeholder="请输入登录账号"/>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="icon icon-3"></span>
|
||||
<input type="password" name="password" value="6ZgSVaQ#sQxPpFrWZg$jxqm5" lay-verify="required" data-i18n-placeholder="login.password" placeholder="请输入密码">
|
||||
<input type="password" name="password" value="" lay-verify="required" data-i18n-placeholder="login.password" placeholder="请输入密码">
|
||||
<span class="bind-password icon icon-4"></span>
|
||||
</div>
|
||||
|
||||
@@ -157,7 +157,8 @@
|
||||
$(this).addClass('icon-check');
|
||||
}
|
||||
});
|
||||
|
||||
// var baseUrl = "https://server.orzar.shop/";
|
||||
var baseUrl = "https://usedcar.server.hnxinyouhe.com/";
|
||||
// 进行登录操作
|
||||
form.on('submit(login)', function (data) {
|
||||
data = data.field;
|
||||
@@ -171,16 +172,19 @@
|
||||
}
|
||||
// $(".login-btn").attr('disabled', 'disabled')
|
||||
// var loading = layer.load(0, {shade: false});
|
||||
window.location = 'home.html';
|
||||
return false;
|
||||
// window.location = 'home.html';
|
||||
// return false;
|
||||
$.ajax({
|
||||
url:'/Api/server/login',
|
||||
url:baseUrl+'console/user/login',
|
||||
type:'POST',
|
||||
beforeSend: function(request) {
|
||||
request.setRequestHeader("lang",localStorage.getItem('language')?localStorage.getItem('language'):"zh");
|
||||
},
|
||||
data:data,
|
||||
success: function(result, textStatus){
|
||||
if(result.token){
|
||||
if(result.code==0){
|
||||
layer.msg(window.i18n.translate('login.success'), function () {
|
||||
sessionStorage.tokencar= result.token
|
||||
sessionStorage.tokencar= result.data.token
|
||||
window.location = 'home.html';
|
||||
});
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user