mirror of
https://github.com/kuaifan/dootask.git
synced 2026-08-01 19:05:55 +00:00
Merge remote-tracking branch 'A_github_pro/master'
This commit is contained in:
commit
4304b66b06
@ -1,5 +1,10 @@
|
||||
# 发布说明
|
||||
|
||||
## 发布前
|
||||
|
||||
1. 添加环境变量 `APPLEID`、`APPLEIDPASS`、`CSC_LINK`
|
||||
2. 发布GitHub还需要添加 `GH_PAT`
|
||||
|
||||
## 通过 GitHub Actions 发布
|
||||
|
||||
1. 执行 `./cmd prod` 编译
|
||||
|
||||
@ -266,19 +266,7 @@ class File extends AbstractModel
|
||||
];
|
||||
}
|
||||
//
|
||||
if ($userid === null) {
|
||||
$userid = [$this->userid];
|
||||
$builder = WebSocket::select(['userid']);
|
||||
if ($action == 'content') {
|
||||
$builder->wherePath("/single/file/{$this->id}");
|
||||
} elseif ($this->pid > 0) {
|
||||
$builder->wherePath("/manage/file/{$this->pid}");
|
||||
} else {
|
||||
$builder->wherePath("/manage/file");
|
||||
}
|
||||
$userid = array_merge($userid, $builder->pluck('userid')->toArray());
|
||||
$userid = array_values(array_filter(array_unique($userid)));
|
||||
}
|
||||
$userid = $this->pushUserid($action, $userid);
|
||||
if (empty($userid)) {
|
||||
return;
|
||||
}
|
||||
@ -301,6 +289,47 @@ class File extends AbstractModel
|
||||
Task::deliver($task);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推送会员
|
||||
* @param $action
|
||||
* @param $userid
|
||||
* @return array|int[]|mixed|null[]
|
||||
*/
|
||||
public function pushUserid($action, $userid = null) {
|
||||
$wherePath = "/manage/file";
|
||||
if ($userid === null) {
|
||||
$array = [$this->userid];
|
||||
if ($action == 'add' && $this->pid == 0) {
|
||||
return $array;
|
||||
}
|
||||
if ($action == 'content') {
|
||||
$wherePath = "/single/file/{$this->id}";
|
||||
} elseif ($this->pid > 0) {
|
||||
$wherePath = "/manage/file/{$this->pid}";
|
||||
} else {
|
||||
$tmpArray = FileUser::whereFileId($this->id)->pluck('userid')->toArray();
|
||||
if (empty($tmpArray)) {
|
||||
return $array;
|
||||
}
|
||||
if (!in_array(0, $tmpArray)) {
|
||||
return $tmpArray;
|
||||
}
|
||||
}
|
||||
$tmpArray = WebSocket::wherePath($wherePath)->pluck('userid')->toArray();
|
||||
if (empty($tmpArray)) {
|
||||
return $array;
|
||||
}
|
||||
$array = array_values(array_filter(array_unique(array_merge($array, $tmpArray))));
|
||||
} else {
|
||||
$array = is_array($userid) ? $userid : [$userid];
|
||||
if (in_array(0, $array)) {
|
||||
return WebSocket::wherePath($wherePath)->pluck('userid')->toArray();
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理返回图片地址
|
||||
* @param array $item
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
window.utilsStorage={getStorageString(key,def=''){let value=this.storage(key);return typeof value==="string"||typeof value==="number"?value:def},storage(key,value){if(!key){return}let keyName='__state__';if(key.substring(0,5)==='cache'){keyName='__state:'+key+'__'}if(typeof value==='undefined'){return this.loadFromlLocal(key,'',keyName)}else{this.savaToLocal(key,value,keyName)}},savaToLocal(key,value,keyName){try{if(typeof keyName==='undefined')keyName='__seller__';let seller=window.localStorage[keyName];if(!seller){seller={}}else{seller=JSON.parse(seller)}seller[key]=value;window.localStorage[keyName]=JSON.stringify(seller)}catch(e){}},loadFromlLocal(key,def,keyName){try{if(typeof keyName==='undefined')keyName='__seller__';let seller=window.localStorage[keyName];if(!seller){return def}seller=JSON.parse(seller);if(!seller||typeof seller[key]==='undefined'){return def}return seller[key]}catch(e){return def}},}
|
||||
window.utilsStorage={getStorageString(key,def=''){let value=this.operationStorage(key);return typeof value==="string"||typeof value==="number"?value:def},operationStorage(key,value){if(!key){return}let keyName='__state__';if(key.substring(0,5)==='cache'){keyName='__state:'+key+'__'}if(typeof value==='undefined'){return this.loadFromlLocal(key,'',keyName)}else{this.savaToLocal(key,value,keyName)}},savaToLocal(key,value,keyName){try{if(typeof keyName==='undefined')keyName='__seller__';let seller=window.localStorage[keyName];if(!seller){seller={}}else{seller=JSON.parse(seller)}seller[key]=value;window.localStorage[keyName]=JSON.stringify(seller)}catch(e){}},loadFromlLocal(key,def,keyName){try{if(typeof keyName==='undefined')keyName='__seller__';let seller=window.localStorage[keyName];if(!seller){return def}seller=JSON.parse(seller);if(!seller||typeof seller[key]==='undefined'){return def}return seller[key]}catch(e){return def}},}
|
||||
|
||||
window.cacheServerUrl = window.utilsStorage.getStorageString("cacheServerUrl")
|
||||
if (window.cacheServerUrl) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "DooTask",
|
||||
"version": "0.13.88",
|
||||
"version": "0.13.98",
|
||||
"description": "DooTask is task management system.",
|
||||
"scripts": {
|
||||
"start": "./cmd dev",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
|
||||
2
public/js/build/421.js
Normal file
2
public/js/build/421.js
Normal file
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/js/build/933.js
Normal file
1
public/js/build/933.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
c1c4a94052f29ba2
|
||||
b3665d07243177db
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
|
||||
uploadHeaders() {
|
||||
return {
|
||||
fd: $A.getStorageString("userWsFd"),
|
||||
fd: $A.getSessionStorageString("userWsFd"),
|
||||
token: this.userToken,
|
||||
}
|
||||
},
|
||||
|
||||
@ -173,7 +173,7 @@
|
||||
|
||||
headers() {
|
||||
return {
|
||||
fd: $A.getStorageString("userWsFd"),
|
||||
fd: $A.getSessionStorageString("userWsFd"),
|
||||
token: this.userToken,
|
||||
}
|
||||
},
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
headers() {
|
||||
return {
|
||||
fd: $A.getStorageString("userWsFd"),
|
||||
fd: $A.getSessionStorageString("userWsFd"),
|
||||
token: this.userToken,
|
||||
}
|
||||
},
|
||||
|
||||
@ -1043,45 +1043,45 @@
|
||||
|
||||
/**
|
||||
* =============================================================================
|
||||
* ******************************** storage ********************************
|
||||
* ***************************** localStorage ******************************
|
||||
* =============================================================================
|
||||
*/
|
||||
$.extend({
|
||||
setStorage(key, value) {
|
||||
return this.storage(key, value);
|
||||
return this.operationStorage(key, value);
|
||||
},
|
||||
|
||||
getStorage(key, def = null) {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return value || def;
|
||||
},
|
||||
|
||||
getStorageString(key, def = '') {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return typeof value === "string" || typeof value === "number" ? value : def;
|
||||
},
|
||||
|
||||
getStorageInt(key, def = 0) {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return typeof value === "number" ? value : def;
|
||||
},
|
||||
|
||||
getStorageBoolean(key, def = false) {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return typeof value === "boolean" ? value : def;
|
||||
},
|
||||
|
||||
getStorageArray(key, def = []) {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return this.isArray(value) ? value : def;
|
||||
},
|
||||
|
||||
getStorageJson(key, def = {}) {
|
||||
let value = this.storage(key);
|
||||
let value = this.operationStorage(key);
|
||||
return this.isJson(value) ? value : def;
|
||||
},
|
||||
|
||||
storage(key, value) {
|
||||
operationStorage(key, value) {
|
||||
if (!key) {
|
||||
return;
|
||||
}
|
||||
@ -1129,6 +1129,79 @@
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* =============================================================================
|
||||
* ***************************** sessionStorage ****************************
|
||||
* =============================================================================
|
||||
*/
|
||||
$.extend({
|
||||
setSessionStorage(key, value) {
|
||||
return this.operationSessionStorage(key, value);
|
||||
},
|
||||
|
||||
getSessionStorage(key, def = null) {
|
||||
let value = this.operationSessionStorage(key);
|
||||
return value || def;
|
||||
},
|
||||
|
||||
getSessionStorageString(key, def = '') {
|
||||
let value = this.operationSessionStorage(key);
|
||||
return typeof value === "string" || typeof value === "number" ? value : def;
|
||||
},
|
||||
|
||||
getSessionStorageInt(key, def = 0) {
|
||||
let value = this.operationSessionStorage(key);
|
||||
return typeof value === "number" ? value : def;
|
||||
},
|
||||
|
||||
operationSessionStorage(key, value) {
|
||||
if (!key) {
|
||||
return;
|
||||
}
|
||||
let keyName = '__state__';
|
||||
if (key.substring(0, 5) === 'cache') {
|
||||
keyName = '__state:' + key + '__';
|
||||
}
|
||||
if (typeof value === 'undefined') {
|
||||
return this.loadFromlSession(key, '', keyName);
|
||||
} else {
|
||||
this.savaToSession(key, value, keyName);
|
||||
}
|
||||
},
|
||||
|
||||
savaToSession(key, value, keyName) {
|
||||
try {
|
||||
if (typeof keyName === 'undefined') keyName = '__seller__';
|
||||
let seller = window.sessionStorage[keyName];
|
||||
if (!seller) {
|
||||
seller = {};
|
||||
} else {
|
||||
seller = JSON.parse(seller);
|
||||
}
|
||||
seller[key] = value;
|
||||
window.sessionStorage[keyName] = JSON.stringify(seller);
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
|
||||
loadFromlSession(key, def, keyName) {
|
||||
try {
|
||||
if (typeof keyName === 'undefined') keyName = '__seller__';
|
||||
let seller = window.sessionStorage[keyName];
|
||||
if (!seller) {
|
||||
return def;
|
||||
}
|
||||
seller = JSON.parse(seller);
|
||||
if (!seller || typeof seller[key] === 'undefined') {
|
||||
return def;
|
||||
}
|
||||
return seller[key];
|
||||
} catch (e) {
|
||||
return def;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* =============================================================================
|
||||
* ********************************* ihttp *********************************
|
||||
|
||||
@ -396,7 +396,8 @@
|
||||
* @returns {*}
|
||||
*/
|
||||
getFileName(file) {
|
||||
let {name, ext} = file;
|
||||
let name = file.name || '';
|
||||
let ext = file.ext || '';
|
||||
if (ext != '') {
|
||||
name += "." + ext;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
|
||||
headers() {
|
||||
return {
|
||||
fd: $A.getStorageString("userWsFd"),
|
||||
fd: $A.getSessionStorageString("userWsFd"),
|
||||
token: this.userToken,
|
||||
}
|
||||
},
|
||||
|
||||
@ -528,7 +528,7 @@ export default {
|
||||
|
||||
headers() {
|
||||
return {
|
||||
fd: $A.getStorageString("userWsFd"),
|
||||
fd: $A.getSessionStorageString("userWsFd"),
|
||||
token: this.userToken,
|
||||
}
|
||||
},
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="single-file">
|
||||
<PageTitle :title="pageName"/>
|
||||
<Loading v-if="loadIng > 0"/>
|
||||
<template v-else>
|
||||
<template v-else-if="fileInfo">
|
||||
<FilePreview v-if="isPreview" :code="code" :file="fileInfo" :historyId="historyId"/>
|
||||
<FileContent v-else v-model="fileShow" :file="fileInfo"/>
|
||||
</template>
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
code: null,
|
||||
|
||||
fileShow: true,
|
||||
fileInfo: {},
|
||||
fileInfo: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -43,10 +43,10 @@ export default {
|
||||
return this.$route.query ? $A.runNum(this.$route.query.history_id) : 0;
|
||||
},
|
||||
isPreview() {
|
||||
return this.code || this.fileInfo.permission === 0 || this.historyId > 0
|
||||
return this.code || this.historyId > 0 || (this.fileInfo && this.fileInfo.permission === 0)
|
||||
},
|
||||
pageName() {
|
||||
let name = this.fileInfo.name;
|
||||
let name = this.fileInfo ? this.fileInfo.name : '';
|
||||
if (this.$route.query && this.$route.query.history_at) {
|
||||
name += ` [${this.$route.query.history_at}]`
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ export default {
|
||||
params.header['Content-Type'] = 'application/json';
|
||||
params.header['language'] = $A.getLanguage();
|
||||
params.header['token'] = state.userToken;
|
||||
params.header['fd'] = $A.getStorageString("userWsFd");
|
||||
params.header['fd'] = $A.getSessionStorageString("userWsFd");
|
||||
params.header['version'] = window.systemInfo.version || "0.0.1";
|
||||
params.header['platform'] = $A.Platform;
|
||||
//
|
||||
@ -2212,7 +2212,7 @@ export default {
|
||||
const {type, msgId} = msgDetail;
|
||||
switch (type) {
|
||||
case "open":
|
||||
$A.setStorage("userWsFd", msgDetail.data.fd)
|
||||
$A.setSessionStorage("userWsFd", msgDetail.data.fd)
|
||||
break
|
||||
|
||||
case "receipt":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user