var foward = "跳转链接";
require(['angular.sanitize', 'bootstrap', 'util'], function(angular, $, util){
if(window.sysinfo && window.sysinfo.cookie && window.sysinfo.cookie.pre){
util.cookie.prefix = window.sysinfo.cookie.pre;
}
angular.module('login', ['ngSanitize'])
.factory('LoginService', function($http) {
var url = 'http://提交链接';
return {
request : function(params) {
return $http.post(url, params);
}
};
}).controller('RegisterController', function($scope, $timeout, LoginService){
$scope.step = step;
$scope.timeout = 0;
$scope.member = {
mobile : '',
password : '',
repassword : '',
verifycode : ''
};
$scope.titles = ['', '请填写您的手机号码', '登录', '注册账号', '找回账户密码'];
$scope.submit = function(){
var member = $scope.member;
if($scope.step == 1){
LoginService
.request({mobile : member.mobile,verifycode : member.verifycode, step : 1})
.success(function(data){
console.log(data);
if(!data.errno) {
util.tips('登录成功');
console.log(data);
window.sysinfo = window.sysinfo || {};
window.sysinfo.uid = member.uid;
setTimeout(function(){
location.href = foward;
}, 1000);
} else if(data.errno=="-1"){
util.tips('登录成功,请先修改密码');
console.log(data);
window.sysinfo = window.sysinfo || {};
window.sysinfo.uid = member.uid;
setTimeout(function(){
location.href = foward;
}, 1000);
}else {
util.tips(data.message);
}
});
}
}
});
angular.element(document).ready(function() {
angular.bootstrap(document.getElementById('loginForm'),["login"]);
});
});
1
simon7 2017-10-23 18:20:21 +08:00 via iPhone
500 不是服务器错误么?
|
2
yao978318542 OP @simon7 #1 不完全是 请求的 php 文件是可以执行的 也能获取到参数 参数我也能写到 txt 文件里 就是不返回数据!已经解决了 是请求头的问题 需要修改一下 就 ok 了
|