|
@@ -1,12 +1,14 @@
|
|
(function (app) {
|
|
(function (app) {
|
|
- app.controller('wechatLoginCtrl', ["$scope","userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","common",
|
|
|
|
- function ($scope,userService,$ionicNavBarDelegate, storage, $state, msg, $http, util,common) {
|
|
|
|
|
|
+ app.controller('wechatLoginCtrl', ["$scope","userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","common","config",
|
|
|
|
+ function ($scope, userService, $ionicNavBarDelegate, storage, $state, msg, $http, util, common, config) {
|
|
//$ionicNavBarDelegate.showBackButton(false);
|
|
//$ionicNavBarDelegate.showBackButton(false);
|
|
$scope.addvideo = function () {
|
|
$scope.addvideo = function () {
|
|
common.chooseVideo().then(function (file) {
|
|
common.chooseVideo().then(function (file) {
|
|
msg.loading();
|
|
msg.loading();
|
|
common.uploadFiles(file, 2).then(function (result) {
|
|
common.uploadFiles(file, 2).then(function (result) {
|
|
msg.hide();
|
|
msg.hide();
|
|
|
|
+ alert(result.respons);
|
|
|
|
+ console.log(result.respons);
|
|
var response = JSON.parse(result.response);
|
|
var response = JSON.parse(result.response);
|
|
$scope.video.server = response.data.file;
|
|
$scope.video.server = response.data.file;
|
|
var file = config.imgServer + response.data.file;
|
|
var file = config.imgServer + response.data.file;
|
|
@@ -65,6 +67,10 @@
|
|
$http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
|
|
$http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
|
|
$scope.user=storage.getObject('user');
|
|
$scope.user=storage.getObject('user');
|
|
$state.go('app.home');
|
|
$state.go('app.home');
|
|
|
|
+ if(localStorage['jpush']){
|
|
|
|
+ console.log("jpush: " + localStorage['jpush']);
|
|
|
|
+ userService.jpush({ jpush: localStorage['jpush']}).then(function (result) {}, function (erro) {});
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
$state.go("loginAccount",{wechat:result.data.data.openid})
|
|
$state.go("loginAccount",{wechat:result.data.data.openid})
|
|
}
|
|
}
|