1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| /** Admin-only sensitive-information viewer. Every request is audited by the server. */
| var SensitiveInfo = {
| view: function (url) {
| layer.confirm('查看完整敏感信息将记录操作日志,是否继续?', {
| icon: 3,
| title: '敏感信息查看'
| }, function (index) {
| $.ajax({
| url: Feng.ctxPath + url,
| type: 'GET',
| success: function (data) {
| layer.close(index);
| if (!data) {
| Feng.info('未查询到敏感信息');
| return;
| }
| // 弹窗只展示手机号;接口中的 id、name 等定位字段不应暴露给页面。
| var phone = data.phone || data.mobile || data.telephone || data.tel || data.name;
| if (!phone) {
| Feng.info('未查询到手机号');
| return;
| }
| var content = '<div class="form-horizontal" style="padding:20px"><div class="form-group">'
| + '<label class="col-sm-4 control-label">手机号:</label><div class="col-sm-8">'
| + '<p class="form-control-static">' + SensitiveInfo.escape(String(phone))
| + '</p></div></div></div>';
| layer.open({type: 1, title: '敏感信息', area: ['480px', 'auto'], content: content});
| },
| error: function (xhr) {
| layer.close(index);
| Feng.error(xhr.responseJSON && xhr.responseJSON.message ? xhr.responseJSON.message : '敏感信息查询失败');
| }
| });
| });
| },
| escape: function (value) {
| return value.replace(/[&<>'"]/g, function (char) {
| return {'&': '&', '<': '<', '>': '>', "'": ''', '"': '"'}[char];
| });
| }
| };
|
|