angular.min.js POST 提交在本地没有问题为什么到了正式环境就 500 错误呢? win 环境

2017-10-23 16:39:44 +08:00
 yao978318542
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"]);
});

});

1490 次点击
所在节点    问与答
2 条回复
simon7
2017-10-23 18:20:21 +08:00
500 不是服务器错误么?
yao978318542
2017-10-24 09:32:36 +08:00
@simon7 #1 不完全是 请求的 php 文件是可以执行的 也能获取到参数 参数我也能写到 txt 文件里 就是不返回数据!已经解决了 是请求头的问题 需要修改一下 就 ok 了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/399962

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX