• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript entcore.http函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中entcore.http函数的典型用法代码示例。如果您正苦于以下问题:TypeScript http函数的具体用法?TypeScript http怎么用?TypeScript http使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了http函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

	$scope.connect = function () {
		console.log('connect');
		// picking up values manually because the browser autofill isn't registered by angular
		http().post('/auth/login', http().serialize({
			email: $('#email').val(),
			password: $('#password').val(),
			rememberMe: $scope.user.rememberMe,
			secureLocation: $scope.user.secureLocation,
			callBack: $scope.callBack,
			details: $scope.details
		}))
			.done(function (data) {
				if (typeof data !== 'object') {
					if (window.location.href.indexOf('callback=') !== -1) {
						window.location.href = (window as any).unescape(window.location.href.split('callback=')[1]);
					}
					else {
						window.location.href = $scope.callBack;
					}
				}
				if (data.error) {
					$scope.error = data.error.message;
				}
				if (!$scope.$$phase) {
					$scope.$apply();
				}
			});
	};
开发者ID:entcore,项目名称:entcore,代码行数:28,代码来源:login.ts


示例2: function

	$scope.forgotId = function({mail, firstName, structureId}, service){
		resetError();
		http().postJson('/auth/forgot-id', {mail: mail, firstName: firstName, structureId: structureId, service: service})
            .done(function(data){
				if(data.structures){
					$scope.structures = data.structures;
					if(firstName === null || structureId === null){
						$scope.user.mode = 'idExtras'
					}else{
						$scope.user.mode = 'notFound';
						setError('auth.notify.non.unique.result.mail');
					}
				}else {
					notify.info("auth.notify." + service + ".sent")
					if (data.mobile) {
						$scope.user.channels = {
							mobile: data.mobile
						}
					} else {
						$scope.user.channels = {}
					}
				}
				$scope.$apply()
			})
            .e400(function(data){
				const err = JSON.parse(data.responseText);
				if(err.error=="no.match" && $scope.user.mode=="idExtras"){
					setError('auth.notify.no.match.mail.laststep');
				}else{
					setError('auth.notify.' + err.error + '.mail');
				}
				$scope.$apply()
			})
	}
开发者ID:entcore,项目名称:entcore,代码行数:34,代码来源:forgot.ts


示例3: function

	const loadThemeConf = async function(){
		await skin.listSkins();
		conf = skin.themeConf;

		$scope.themes = skin.skins;

		if($scope.themes.length > 1){
			$scope.display.pickTheme = skin.pickSkin;
			http().get('/userbook/preference/theme').done(function(pref){
				if(pref.preference){
					$scope.account.themes[pref.preference] = true;
				}
				else{
					$scope.account.themes[skin.skin] = true;
					http().put('/userbook/preference/theme', skin.skin);
				}
				$scope.$apply();
			})
			if(!$scope.account.themes){
				$scope.account.themes = {};
			}
			
			$scope.$apply();
		}
	}
开发者ID:entcore,项目名称:entcore,代码行数:25,代码来源:account.ts


示例4: http

	http().get('/userbook/user-preferences').done(function(result){
		Birthday.currentClass = { id: result.result[0].userPreferencesBirthdayClass };
		http().get('/userbook/person/birthday').done(function(birthdays){
			lang.addBundle('/directory/i18n', function(){
				Birthday.emptyList = lang.translate('nobirthday');
				Birthday.birthdays = _.filter(birthdays, function(birthday){
					return moment(birthday.birthDate).month() === moment().month();
				});

				Birthday.birthdays = Birthday.birthdays.sort(function(a, b){
					return moment(a.birthDate).date() - moment(b.birthDate).date()
				});

				var classes = [];
				classes = _.pluck(Birthday.birthdays, 'classes');
				classes.forEach(function(classList){
					classList.forEach(function(myClass){
						if(!_.findWhere(Birthday.classes, {id :myClass[0] })){
							Birthday.classes.push({
								name: myClass[1],
								id: myClass[0]
							});
						}
					});
				});

				Birthday.currentClass = _.findWhere(Birthday.classes, { id: Birthday.currentClass.id })
				if(!Birthday.currentClass){
					Birthday.currentClass = Birthday.classes[0];
				}

				model.widgets.apply();
			});
		});
	});
开发者ID:entcore,项目名称:entcore,代码行数:35,代码来源:birthday.ts


示例5: function

				loadGroups: function(){
					var that = this
					http().get('/userbook/structure/' + this.search.structure.id).done(function(structure){
						this.search.groups = structure.profileGroups.concat(structure.manualGroups);
						_.map(this.search.groups, function(group){ group.translatedName = that.groupTranslation(group.name) })
						this.$apply('search');
					}.bind(this));
				},
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:behaviours.ts


示例6: function

 send: function () {
     this.message.to = _.map(this.snipletResource.shared, function (shared) { return shared.userId || shared.groupId });
     this.message.to.push(this.snipletResource.owner.userId);
     http().postJson('/conversation/send', this.message).done(function () {
         notify.info('ml.sent');
     }).e401(function () { });
     this.message = {}
 }
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:behaviours.ts


示例7: http

	$scope.setThemePreferences = (themeName: string) => {
		const addedThemes = [];
			
		for(let name in $scope.account.themes){
			if($scope.account.themes[name]){
				addedThemes.push(name);
			}
		}

		if(addedThemes.length > 1){
			const keptTheme = $scope.themes.find(t => t.parent === 'theme-open-ent').child;
			http().put('/userbook/preference/theme', keptTheme);
		}
		else{
			http().put('/userbook/preference/theme', addedThemes[0]);
		}
	};
开发者ID:entcore,项目名称:entcore,代码行数:17,代码来源:account.ts


示例8: function

 $scope.addBookmark = function($item){
     if(_.findWhere(model.me.bookmarkedApps, { name: $item.name }) !== undefined){
         return;
     }
     model.me.bookmarkedApps.push($item);
     $scope.$apply();
     http().putJson('/userbook/preference/apps', model.me.bookmarkedApps);
 };
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:app.ts


示例9: function

			sync: function(){
				oldHttp().get('/directory/class/' + model.me.preferences.selectedClass + '/users', { requestName: 'loadingUsers' }).done(function(data){
					data.sort(function(a, b) {
						return a.lastName > b.lastName?1:-1;
					});
					this.load(data);
				}.bind(this));
			},
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:model.ts



注:本文中的entcore.http函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript entcore.moment函数代码示例发布时间:2022-05-25
下一篇:
TypeScript ensime-client.dotEnsimeUtils类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap