[AppleScript] 纯文本查看 复制代码
/*登陆*/ export const login = params => {
//let loginRequest = querystring.stringify(params)
let loginRequest = qs.stringify(params);
return http.requestPostForm('/openapi/auth/userlogin',loginRequest);
}
[AppleScript] 纯文本查看 复制代码
import Home from '@/module/home/page/home.vue'; import Login from '@/module/home/page/loginpage.vue'; import Denied from '@/module/home/page/denied.vue'; import Logout from '@/module/home/page/logout.vue'; import order_pay from '@/module/order/page/order_pay.vue'; export default [{
path: '/',
component: Home,
name: '个人中心',
hidden: true
}, {
path: '/login',
component: Login,
name: 'Login',
hidden: true
}, .....
[AppleScript] 纯文本查看 复制代码
login: function () {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.editLoading = true;
let para = Object.assign({}, this.loginForm);
loginApi.login(para).then((res) => {
this.editLoading = false;
if(res.success){
this.$message('登陆成功');
//刷新 当前页面
// alert(this.returnUrl)
console.log(this.returnUrl)
if(this.returnUrl!='undefined' && this.returnUrl!=''
&& !this.returnUrl.includes("/userlogout")
&& !this.returnUrl.includes("/userlogin")){
window.location.href = this.returnUrl;
}else{
//跳转到首页
window.location.href = 'http://www.xuecheng.com/'
}
}else{
if(res.message){
this.$message.error(res.message);
}else{
this.$message.error('登陆失败');
}
}
},
(res) => {
this.editLoading = false;
});
}
});
},