V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yao978318542
V2EX  ›  问与答

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

  •  
  •   yao978318542 · 2017-10-23 16:39:44 +08:00 · 1479 次点击
    这是一个创建于 2368 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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"]);
    });
    

    });

    simon7
        1
    simon7  
       2017-10-23 18:20:21 +08:00 via iPhone
    500 不是服务器错误么?
    yao978318542
        2
    yao978318542  
    OP
       2017-10-24 09:32:36 +08:00
    @simon7 #1 不完全是 请求的 php 文件是可以执行的 也能获取到参数 参数我也能写到 txt 文件里 就是不返回数据!已经解决了 是请求头的问题 需要修改一下 就 ok 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5215 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 897ms · UTC 03:47 · PVG 11:47 · LAX 20:47 · JFK 23:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.